Azzera filtri
Azzera filtri

Plotting vectors with different values on each other

5 visualizzazioni (ultimi 30 giorni)
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!

Risposte (1)

Star Strider
Star Strider il 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.
.

Categorie

Scopri di più su Line Plots in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by