draw a control plot for a function
Afficher commentaires plus anciens
hello everyone, I need to generate a contour plot for the following code:- e=2.71828; dt=.01; A=-1; B=1; a=cell(12,12); data=zeros(1,220) for i=1:20 eps=i for j=0:0.1:1 beta=j for t=0:0.01:1.9 t=t+dt xp=0.1 fxp=eps*xp fz0=1/1+power(e,beta*(-t)) fzi=A+(B-A)*rand(1,12) for ii=1:12 for jj=1:12 if ii==jj a2(ii,jj)=fzi(jj) else a2(ii,jj)=0; end end end s=fxp*fz0 *a2 x=xp+(s*dt) xp=x end p=abs(fft(x)) p=p.^2 ne=max(p(1:10)) ne1=max(p(10:30)) ne2=max(p(80:120)) end end figure (1) [C,h]=contour(eps,beta,ne,'linewidth',2) figure (2) [C,h]=contour(eps,beta,ne1,'linewidth',2) figure (3) [C,h]=contour(eps,beta,ne2,'linewidth',2)
ne,ne1,ne2 is holding the value only for the last loop..but i need all the values of ne,ne1,ne2.. what should i do..please help....
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Programming 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!