Afficher commentaires plus anciens
clc;clear;
x0= [174 179 189 207 234 220.5 256 270 285];%原始数列 x0
n = length(x0);
lamda=x0(1:n-1)./x0(2:n)%计算级比
range=minmax(lamda)%计算级比的范围
x1 =cumsum(x0);%对原始数列 x0 做累加得到数列 x1
for i=2:n
z(i)=0.5*(x1(i)+x1(i-1));
end
B=[-z(2:n)',ones((n-1),1)];
Y=x0(2:n)';
u=B\Y %拟合参数
x=dsolve('Dx+a*x=b','x(0)=x0');
x=subs(x,{'a','b','x0'},{u(1),u(2).x1(1)});
yuce1=double(subs(x,'t',[0:n-1]));
y=vpa(x)
yuce=[x0(1),diff(yuce1)]
epsilon=x0-yuce
delta=abs(epsilon./x0)
rho=1-(1-0.5*u(1))/(1+0.5*u(1))*lamda
上面是代码,最后运行出来是这样的
结构体内容引用自非结构体数组对象。
出错 ggg (line 14)
x=subs(x,{'a','b','x0'},{u(1),u(2).x1(1)});
Réponses (1)
真人庄闲游戏官网【359663.tv】
le 14 Oct 2022
你把逗号打成句号当然会有问题了
x=subs(x,{'a','b','x0'},{u(1),u(2).x1(1)});
这句改成
x=subs(x,{'a','b','x0'},{u(1),u(2),x1(1)});
Catégories
En savoir plus sur 图像算术 dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!