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

조회 수: 6 (최근 30일)
Anil
Anil 2023년 2월 8일
편집: Sulaymon Eshkabilov 2023년 2월 10일
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!

채택된 답변

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2023년 2월 8일
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
Anil
Anil 2023년 2월 9일
Thank you so much! This worked perfectly after I played around with the transposes! :)
Sulaymon Eshkabilov
Sulaymon Eshkabilov 2023년 2월 10일
편집: Sulaymon Eshkabilov 2023년 2월 10일
Most welcome!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by