hi, i use the following code . the output is 15 values , i want stored this values automatically in array in order to Call these values again
Ältere Kommentare anzeigen
for sw=1:15
n=[10;20;30;40;50;60;70;80;90;100];phi=0.5;
s=2;
z0=0.4;
index=0;
o=10;
for nn=1:o
a=normrnd(0,s^2,n(nn),1);
z=zeros(n(nn),1);
z(1)=phi*z0+a(1);
for i=2:n(nn)
z(i)=phi*z(i-1)+a(i);
end
for i=2:n(nn)
g(i)=z(i)*z(i-1);
end
k=sum(g,2);
num= (n(nn)-2)*k;
for i=3:n(nn)
f(i)=z(i-1)*z(i-1);
end
p=sum(f,2);
den=(n(nn)-1)*p;
index=index+1;
ma(index)=n(nn);
phihat(index)=num/den;
end
for i=1:o
da(i)=(phihat(i)-phi)^2;
end
MSEreal=num2str((sum (da)/(o)),'% .10f')
end
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Logical finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!