Solving MATLAB Surf Plotting Problems

  • MATLAB
  • Thread starter dooleygav
  • Start date
  • Tags
    Matlab
In summary, the person is having problems with plotting their matrix, which is approximately 100 rows and 3 columns (x, y, z). When using the surf command to plot the surface, the image does not appear as a plane. They are wondering if the matrix needs to be sorted and what command they should use to plot. They also mention that the matrix is between 100 and 1000 rows and 3 columns, and they are using the surf command. They question if the matrix needs to be in a specific order, as it appears as a perfect plane when using the plots command.
  • #1
dooleygav
4
0
I have to following problems with my plotting problems:


my matrix is as follows :

x y z
[ ]
its approx 100 rows...


When i try to plot the surface... The following image occurs, does the matrix need ot be sorted or somehting?

It should be a plane...
Thanks.
 

Attachments

  • untitled.jpg
    untitled.jpg
    38 KB · Views: 448
Physics news on Phys.org
  • #2
what command are you using to plot?

also, what are the dimensions of your matrix that you are plotting?
 
  • #3
swraman said:
what command are you using to plot?

also, what are the dimensions of your matrix that you are plotting?


the matrix is between 100 & 1000 rows * 3 (x , y, z)


Im using the surf command...

Does the matrix need to be in some kind of order?... It is a perfect plane when i use plots and display circles... using 'o'
 

1. How do I create a surf plot in MATLAB?

To create a surf plot in MATLAB, you can use the surf function. This function takes in three input matrices representing the x, y, and z coordinates of the data points and creates a 3D surface plot.

2. How can I customize the appearance of my surf plot in MATLAB?

To customize the appearance of your surf plot, you can use various optional parameters in the surf function. These include changing the color map, adding a color bar, and adjusting the lighting and shading of the plot.

3. How do I add labels and a title to my surf plot in MATLAB?

To add labels and a title to your surf plot, you can use the xlabel, ylabel, and zlabel functions to add labels to the x, y, and z axes, respectively. The title function can be used to add a title to your plot.

4. Is it possible to save my surf plot in MATLAB as an image or PDF?

Yes, it is possible to save your surf plot as an image or PDF in MATLAB. You can use the saveas function and specify the desired file format to save your plot as an image. To save as a PDF, you can use the print function and specify the file name and format.

5. How can I troubleshoot common issues with surf plotting in MATLAB?

If you encounter any issues with surf plotting in MATLAB, some common troubleshooting steps include checking for typos in your code, making sure your data is in the correct format, and ensuring that you are using the correct functions and syntax. You can also consult the MATLAB documentation or seek assistance from online forums or tutorials.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
32
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
826
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
11
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
Back
Top