What is going wrong with my mesh command?
Mostra commenti meno recenti
I am trying to visualize this function and eventually its contour lines:
clear all
[x,y]=meshgrid(-10:0.1:10)
d=max([sqrt(x.^2+y.^2);sqrt((x-5).^2+(y+1).^2);sqrt((x-4).^2+(y-6).^2);...
sqrt((x-1).^2+(y-3).^2)])+eps;
mesh(d)
I get an error message saying Z should be a matrix. I looked at the example here http://www.mathworks.com/help/matlab/ref/mesh.html, and I don't understand why their function generates a matrix and mine don't. Altough mine is a 'weird' function with a max it shouldn't be conceptually too different, what am I missing here?
Risposta accettata
Più risposte (1)
Walter Roberson
il 6 Mag 2013
d=max( cat(3, sqrt(x.^2+y.^2), sqrt((x-5).^2+(y+1).^2), sqrt((x-4).^2+(y-6).^2), sqrt((x-1).^2+(y-3).^2)), 3) + eps;
1 Commento
Gian Lorenzo
il 6 Mag 2013
Categorie
Scopri di più su Lighting, Transparency, and Shading in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!