Plotting vectors with different values on each other

2 visualizaciones (últimos 30 días)
Sokratis Panagiotidis
Sokratis Panagiotidis el 31 de Mzo. de 2022
Respondida: Star Strider el 31 de Mzo. de 2022
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!

Respuestas (1)

Star Strider
Star Strider el 31 de Mzo. de 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.
.

Categorías

Más información sobre Line Plots en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by