How to Plot a 3D Waterfall Plot given X, Y, and Z datasets

6 vues (au cours des 30 derniers jours)
Anil
Anil le 8 Fév 2023
Hello,
I have a dataset (x) called 'Length' and a dataset (y) called 'TVMS'. This dataset changes incrementally as a function of (z) 'Steps'. I Would like to plot my TVMS vs Length data ina waterfall fashion for every Step in the z direction. How can I accomplish this? Right now the data is of the form:
Length = 181x1 double
TVMS = 181x566 double (meaning there are 181 y values indexed over 566 steps in the z direction)
Steps = 566x1 double
Thanks!

Réponse acceptée

Sulaymon Eshkabilov
Sulaymon Eshkabilov le 8 Fév 2023
Use meshgrid() and waterfall() fcns, e.g.:
Length = (1:181).';
Steps = (1:556)';
[X,Y] = meshgrid(Length, Steps);
Z = X.^2+Y.^2; %Z = TVMS;
waterfall(X', Y', Z')
  2 commentaires
Anil
Anil le 9 Fév 2023
Thank you so much! This worked perfectly after I played around with the transposes! :)
Sulaymon Eshkabilov
Sulaymon Eshkabilov le 10 Fév 2023
Modifié(e) : Sulaymon Eshkabilov le 10 Fév 2023
Most welcome!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange

Produits


Version

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by