How do i plot a graph between 3 variables?graph for x y and z

 Réponse acceptée

You need to index the variable Z,
Z = zeros(size(X));
for i=2:37
Z(i)=(Y(i,1)-Y(i-1,1))/X(i,1);
endl
plot3(X,Y,Z);

5 commentaires

Thanks. It worked! How can i generate surface from these variables?
For surface plot you will need a 2D grid of X and Y values i.e. 2D matrices. Right now your X and Y values are a one-dimensional vector. See mesh() and surf() for more details.
Can i build a surface by importing 3 variables from excel sheet?
It depends on the values of 3 variables, If they are in the form of the grid then you can plot a surface. Can you attach the file so that I can make a proper suggestion?

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur 2-D and 3-D Plots dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by