How to plot using STACKEDPLOT in MATLAB
14 ビュー (過去 30 日間)
古いコメントを表示
i'm hoping to reproduce a plot like this using the function STACKEDPLOT.
In the description https://www.mathworks.com/matlabcentral/mlc-downloads/downloads/submissions/24368/versions/4/previews/Stackedplot.html#description here, is says that in order to plot
figh = stackedplot(z,style,spacing,labels,varargin) Z needs to be an array defined as follows
- "z" is a two dimensional array to plot.
- First dimension is the spectroscopic axis.
- Second dimension has the various spectra or plots (e.g. along time)."
However, i'm stuck trying to figure out what that means. What does it mean when it says that the second dimension (presumably)
I have 22 different arrays that i'm hoping to stack together to produce the plot, but i don't see how i can combine them all into an array of Z and it be expressed as an array?

Thanks
0 件のコメント
回答 (1 件)
Star Strider
2022 年 8 月 24 日
The core MATLAB version of stackedplot was introduced in R2018b. The posted plot image seems to be more like a waterfall or ribbon plot, or perhaps even a surf plot.
If the arrays (and I assume that means vectors) all have the same lengths and independent variable values, it would likely be easiest to just concatenate them into a matrix and then use that as the ‘z’ argument to whatever plot function you choose.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Graphics Object Programming についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!