Error using contour: Z must be at least a 2x2 matrix.
6 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
geometry geometry
il 13 Mag 2017
Commentato: Steven Lord
il 13 Mag 2017
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 Commenti
Risposta accettata
Andrei Bobrov
il 13 Mag 2017
Your typo
Should be:
contour(X,Y,f(X,Y));
2 Commenti
Steven Lord
il 13 Mag 2017
Use the figure function to open a new figure window, or use subplot to create two or more separate axes in one figure window.
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Contour Plots in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!