Plotting vectors with different values on each other

1 view (last 30 days)
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!

Answers (1)

Star Strider
Star Strider on 31 Mar 2022
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.
.

Categories

Find more on Line Plots in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!