I have a problem with surface parameters (fsurf)
Show older comments
Hello there, this is my first time using this site for help so if i don't get the etiquette right please do let me know. OK so i am trying to plot the following surface f(x,y)= (3*x^2+y^2)*exp(-x-y) with intervals -2 < x < 2 and -2 < y < 2 i have produced the following code:
syms x y
f(x,y) = (3*x^2+y^2)*exp(-y-x);
fsurf(f,[-2 2 -2 2])
However the results are terrible i have tried changing the parameters and tried using a mesh but i get nowhere. Now i have been using a tool online called Calcplot3D see here https://www.monroecc.edu/faculty/paulseeburger/calcnsf/CalcPlot3D/ this tool displays the function how i would expect it to look, i don't understand why i can't replicate this in matlab.
Any help would be brilliant Best Regards Jake
Accepted Answer
More Answers (1)
f = @(x,y) (3*x.^2+y.^2).*exp(-y-x);
fsurf(f,[-2 2 -2 2])
Categories
Find more on Surface and Mesh Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!