Error using contour: Z must be at least a 2x2 matrix.
6 ビュー (過去 30 日間)
古いコメントを表示
What's the problem with the following code?
f=input('enter function: ','s');
f = str2func(['@(x,y)' vectorize(f)]);
[X,Y]=meshgrid(-10:.5:10);
contour(X,Y,f(x,y));
When I enter sin(x)+cos(y) the following error occurs:
Z must be at least a 2x2 matrix.
0 件のコメント
採用された回答
Andrei Bobrov
2017 年 5 月 13 日
Your typo
Should be:
contour(X,Y,f(X,Y));
2 件のコメント
Steven Lord
2017 年 5 月 13 日
Use the figure function to open a new figure window, or use subplot to create two or more separate axes in one figure window.
その他の回答 (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!