problem using mesh, only ezmesh works
Ältere Kommentare anzeigen
I have a problem when I try to use mesh, I get the wrong graph for my function. But when i use ezmesh insted, I get the correct graph. How can i solve this so I get the same result with mesh as I get with ezmesh? Does it have something to do with the elementwise operation?
x=-3:0.1:3;
y=-3:0.1:3;
[x1,y1] = meshgrid(x,y);
f1=((x1.^3)*(y1+5*x1.^2)*(y1.^2))./(exp(x1.^2)+3*(y1.^4));
mesh(x1,y1,f1)
figure()
hold on;
syms x y;
ezmesh((((x^3)*y)+(5*(x^2)*(y^2)))/(exp(x^2)+3*y^4)),[-3,3,-3,3]
Antworten (1)
Walter Roberson
am 24 Mär. 2018
The function that you are ezmesh() is not the same as the function you calculate in f1.
The f1 that is equivalent to what you ezmesh is
f1 = ((x1.^3.*y1)+(5*x1.^2).*(y1.^2))./(exp(x1.^2)+3*(y1.^4))
Notice the difference in * (algebraic matrix multiplication) compared to .* (element-by-element multiplication) and the difference in x^3*y + something * y^2 compared to x^3*(y+something) * y^2
Kategorien
Mehr zu Operators and Elementary Operations finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!