what is the right 3D plotting function for my code?

1 visualización (últimos 30 días)
Romik
Romik el 22 de Abr. de 2013
Respondida: SAI SRUJAN el 6 de Oct. de 2023
Hi all, I have a simple question about 3D plotting.
Consider this simple loop, which provides y and O for any x. and I am able to plot y vs O for given x.
for Omega=0:.01:5
y(i)=(x*Omega^2);
O(i)=Omega;
i=i+1;
end
now consider I want to change the value of x, for x=0:.1:3 and plot the group of y's and O's in one plot.(y~O~x) which one of the 3D plot functions are right for this purpose and what will be the code?
I would appreciate you time and help,
Romik

Respuestas (1)

SAI SRUJAN
SAI SRUJAN el 6 de Oct. de 2023
Hi Romik,
I can understand that you uncertain about the appropriate choice of a 3D plotting function to address your requirements.
The selection of a specific 3D plotting function is contingent upon the unique requirements and objectives of the use case at hand..In MATLAB, there are several functions available to plot in 3D. Here are some commonly used functions for 3D plotting:
  • plot3: This function is used to create 3D line plots. It takes three vectors representing the x, y, and z coordinates of the points and connects them with lines.
  • scatter3: This function is used to create 3D scatter plots. It takes three vectors representing the x, y, and z coordinates of the points and plots them as individual markers.
  • surf: This function is used to create 3D surface plots. It takes a matrix of z-values and generates a surface plot based on the x and y coordinates.
  • mesh: This function is similar to surf and creates a wireframe mesh plot. It takes a matrix of z-values and generates a mesh plot based on the x and y coordinates.
  • contour3: This function creates 3D contour plots. It takes a matrix of z-values and generates contour lines at specified levels based on the x and y coordinates.
For further insights, I have provided links to relevant documentation.

Categorías

Más información sobre Surface and Mesh Plots en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by