Error using contour: Z must be at least a 2x2 matrix.
2 次查看(过去 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!