how to create surface plot during each time calculation for several times?
Infos
Cette question est clôturée. Rouvrir pour modifier ou répondre.
Afficher commentaires plus anciens
Greeting to instructors:
I tried to create 6 surface plots, 2 plots each time. The coding logic is below:
XP=linspace(0,1,50); YP=linspace(0,1,50); [X,Y]=meshgride(XP,YP);
for i=1:3
----
A1=some function of X and Y, A2=another function form of X and Y;
figure
mesh(X,Y,A1)
figure
mesh(X,Y,A2)
end
MatLab gives me 6 figures without curves in it.
I modify my code to another form, using subplot command, as below
XP=linspace(0,1,50); YP=linspace(0,1,50); [X,Y]=meshgride(XP,YP);
for i=1:3
----
A1=some function of X and Y, A2=another function form of X and Y;
subplot(3,2,2*i-1)
mesh(X,Y,A1)
subplot(3,2,2*i)
mesh(X,Y,A2)
end
this time, Matlab gives me 2 plots without curve in it. Could you teach me how to create 6 correct figures. Your kindly helps will be deeply appreciated. With best regards,
Donyau
Réponses (1)
Walter Roberson
le 26 Juin 2016
0 votes
It is likely that your X or your Y or your A1 and A2 are empty or consist of a single point.
If you are using division in your formula, make sure you use ./ instead of / as the operator.
3 commentaires
Donyau Chiang
le 28 Juin 2016
Modifié(e) : Walter Roberson
le 28 Juin 2016
Walter Roberson
le 28 Juin 2016
All of your A6 is infinite. This is due to your A5 being quite large, on the order of 10^214 or more in the real and imaginary parts.
Not all of your A4 is infinite, but all of the part that is selected for plotting is.
The first 4 plots look okay to me when I try.
Donyau Chiang
le 29 Juin 2016
Cette question est clôturée.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!