フィルターのクリア

Plotting vectors with different values on each other

5 ビュー (過去 30 日間)
Sokratis Panagiotidis
Sokratis Panagiotidis 2022 年 3 月 31 日
回答済み: Star Strider 2022 年 3 月 31 日
Hello,
I am trying to plot a set of vectors (about 3 to 6, depending on the experiment) and would like to adjust them, so they are stacked upon each other to examine their similarities or in some case their differences. I only know one way, which would be to plot them in EXCEL and adjust thir values but this would take too mich time to do so, since it's about 60 of them I have to plot.
This is how it would look if I plot them, and I would like for them to be stacked upon each other like a stack of papers. Is there a certain function I can use to do so? Thanks in advance for your time and help!

回答 (1 件)

Star Strider
Star Strider 2022 年 3 月 31 日
One approach —
Data = randn(5, 25); % Create Data Matrix
x = 0:size(Data,2)-1; % Create Independent Variable Vector
ofst = (0:size(Data,1)-1)*10; % Offset Vector
figure
plot(x, Data+ofst(:))
grid
The (:) subscript notation forces ‘ofst’ to be a column vector.
Functions such as stackedplot or tiledlayout may be more appropriate for this.
.

カテゴリ

Help Center および File ExchangeLine Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by