Plotting a Surface with ezsurf in MATLAB

  • Thread starter lmannoia
  • Start date
  • Tags
    Matlab
In summary, the conversation is about a MATLAB assignment for a calc 3 class where the task is to plot a surface using ezsurf. The specific equation given is f(x,y)=ye^-(x^2+y^2), and the individual has tried various methods with syms x y and e, but encountered errors. They received help and successfully plotted the surface using the exp() function.
  • #1
lmannoia
32
0

Homework Statement


For a project for my calc 3 class, we have a small MATLAB assignment. The one question I can't plot is the surface (using ezsurf) f(x,y)=ye^-(x^2+y^2)


Homework Equations


i've tried ezsurf('y*e^(-x^2+y^2)') with syms x y and even syms x y e
I also tried ezsurf('y*e^-x^2-y^2')
Matlab tells me there are errors. What am I doing wrong?
Thanks in advance for the help!


The Attempt at a Solution

 
Physics news on Phys.org
  • #2
Is 'e' in your equation is the exponential?
if it is so then you have to use the Matlab function exp()
 
  • #3
worked perfectly; thanks so much!
 

1. What is the purpose of ezsurf in Matlab?

Ezsurf is a built-in function in Matlab that allows you to create a 3D surface plot of a mathematical expression or a set of data points. It is useful for visualizing and analyzing complex data sets or mathematical functions.

2. How do I use ezsurf in Matlab?

To use ezsurf, you need to provide it with a mathematical expression or a set of data points. You can do this by defining the expression in the command window or by loading a data file. Then, use the ezsurf function with the appropriate input arguments to generate the 3D surface plot.

3. Can I customize the appearance of the ezsurf plot?

Yes, you can customize the appearance of the ezsurf plot by changing the color, lighting, and viewing angle. You can also add labels, titles, and legends to the plot to make it more visually appealing and informative.

4. Is ezsurf only limited to 3D plots?

No, ezsurf can also be used to create 2D plots by setting one of the input arguments to be a constant value. This will result in a contour plot of the function or data points.

5. Can I save the ezsurf plot as an image file?

Yes, you can save the ezsurf plot as an image file in various formats such as jpg, png, or pdf. You can do this by using the "print" function in Matlab and specifying the desired file format.

Similar threads

  • Calculus and Beyond Homework Help
Replies
10
Views
931
  • Calculus and Beyond Homework Help
Replies
2
Views
2K
  • Calculus and Beyond Homework Help
Replies
2
Views
2K
  • Calculus and Beyond Homework Help
Replies
6
Views
825
  • Calculus and Beyond Homework Help
Replies
1
Views
416
  • Calculus and Beyond Homework Help
Replies
8
Views
343
  • Calculus and Beyond Homework Help
Replies
2
Views
401
  • Calculus and Beyond Homework Help
Replies
5
Views
1K
  • Calculus and Beyond Homework Help
Replies
8
Views
826
  • Calculus and Beyond Homework Help
Replies
8
Views
992
Back
Top