how to remove Error using contour (line 48) Z must be at least a 2x2 matrix to plot contour lines
1 回表示 (過去 30 日間)
古いコメントを表示
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 件のコメント
回答 (1 件)
Cris LaPierre
2019 年 4 月 3 日
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 件のコメント
参考
カテゴリ
Help Center および File Exchange で Contour Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!