how to remove Error using contour (line 48) Z must be at least a 2x2 matrix to plot contour lines
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
I need to plot contour lines but I have got the error Error using contour (line 48) Z must be at least a 2x2 matrix.So what is the problem and how can i solve it.The code is given below.
dt=1e-6;
v1=11:0.2:16;
v2=250:10:450;
[V1,V2] = meshgrid(v1,v2);
L=18.7e-6;
IP=(sum(V1-n.*V2.^2).*dt)/L ;
contour(V1,V2,rms(Ip))
0 Kommentare
Antworten (1)
Cris LaPierre
am 3 Apr. 2019
The error is that the third input to countour (Z) must be a matrix. This doc link describes what the inputs to contour must be.
To at least get something plotted, try this.
n=.4;
dt=1e-6;
v1=11:0.2:16;
v2=250:10:450;
[V1,V2] = meshgrid(v1,v2);
L=18.7e-6;
IP=((V1-n.*V2.^2).*dt)/L ;
contour(V1,V2,IP)
I made IP a matrix by removing the sum and rms commands.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Contour Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!