How to plot iterations?
22 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hi I have this simple code and I would like to make graph between rez_p and iterations. I have created this, but the plot, that is coming out is blank. Could you please tell me, what I am doing wrong? Thank you so much.
nx=80;
nx=40;
nit=30000;
for it=1:nit
A=Pn-P; %Pn and P is matrix 81x41.. I dont have it here
sou=0.0;
for i=1:nx+1
for j=1:ny+1
sou=sou+A(i,j)*A(i,j);
end
end
rez_p=sqrt(sou)/(nx*ny);
if mod(it,30000)==0 || it ==1; %plot
figure
plot(it, rez_p)
end
end
1 Commento
KALYAN ACHARJYA
il 15 Ago 2019
I have created this, but the plot, that is coming out is blank
Because rez_p return as single value,not range of values. See the @Star answered, he cretes a rez_p(it) with equal length of it.
for ...
end
it=1:nit;
plot(it,rez_p)
Risposte (0)
Vedere anche
Categorie
Scopri di più su Annotations in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!