syms x;
x0=[1647675.523 1746190.081 1142223.713 8667201.385]';
I=[384620*1.1;0;0;0];%系统输入
w=[exp((0.0045*(x-2000))) exp((0.0048*(x-2000))) exp((0.0038*(x-2000))) exp((0.0037*(x-2000)))];%退保率与价格之间的关系
k=[0.346611934 0.320210272*(1-w(2)) 0.099424481*(1-w(3)) 0;0.646316-w(1) 0 0 0.080055715*(1-w(4));0 0.666438-w(2) 0 0;0 0 0.898569-w(3) 0.919135-w(4)];%状态转移矩阵
x1=k*x0+I;%下一年系统保险人数
r=[1020 1223 947 805];%平均修理费
m=[915.6 738.6 493.8 488.4];%出事故的人群中未死的人员的平均医疗费
d=[33984.7 37005.7 60015.2 70971.2];%死亡人员不同类的平均赔偿费
a=[0.353684 0.333562 0.101431 0.080865];%事故率
g=[0.01194 0.024 0.01188 0.006];%死亡人员占事故数的比率
a4=[0 0 0 0];%求解注销率
for i=1:4
a4(i)=a4(i)+w(i)+a(i)*g(i);
end
a4=a4';
a5=[0 0 0 0];%求解每类的赔偿费
for i=1:4
a5(i)=a5(i)+a(i)*x1(i)*(r(i)+(1-g(i))*m(i)+g(i)*d(i));
end
a5=a5';
a1=0;a2=0;a3=0;
for i=1:4
a1=a(i)*x1(i)*r(i)+a1;%求解修理费
a2=a(i)*x1(i)*(1-g(i))*m(i)+a2;%求解医疗费
a3=a(i)*x1(i)*g(i)*d(i)+a3;%求解赔偿费
end
P=0;%求解总赔偿费
for i=1:4
P=P+a(i)*x1(i)*(r(i)+(1-g(i))*m(i)+g(i)*d(i));
end
s=[1 0.75 0.6 0.5];%求解收入
S=0;
for i=1:4
S=s(i)*x1(i)*x+S;
end
z=[2.017417 2.943368 2.207951 6.805974];
c=0;%求解偿还退还费
for i=1:4
c=z(i)*x1(i)*x/775+c;
end
B=149000000;Z=(P+c+B);
S-Z %求解利润(收入与总支出之差)
错误如下
??? The following error occurred converting from sym to double:
Error using ==> sym.double
DOUBLE cannot convert the input expression into a double array.
If the input expression contains a symbolic variable, use the VPA function instead.
谢谢大虾~