how to create surface plot during each time calculation for several times?
Info
Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.
Ältere Kommentare anzeigen
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
Antworten (1)
Walter Roberson
am 26 Jun. 2016
0 Stimmen
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 Kommentare
Donyau Chiang
am 28 Jun. 2016
Bearbeitet: Walter Roberson
am 28 Jun. 2016
Walter Roberson
am 28 Jun. 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
am 29 Jun. 2016
Diese Frage ist geschlossen.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!