To make a surface plot in MATLAB without knowing the x value, you can use the meshgrid
function to create a grid of x-y values, and then use the surf
or mesh
function to create the surface plot.
Here's an example code snippet that generates a surface plot without knowing the x-value:
301 chars11 lines
This code will generate a surface plot of the function f(y,z) = y^2 + z^2
. The meshgrid
function creates a grid of 101 x-y values between -1 and 1, and the surf
function uses those values to create the surface plot of the function.
Note that you will need to define your own function to plot, based on your data and requirements. Also note that the grid points can be adjusted using different parameters in the meshgrid
function call, depending on your specific needs.
gistlibby LogSnag