필터 지우기
필터 지우기

Plotting vectors with different values on each other

조회 수: 1 (최근 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 CenterFile Exchange에서 Line Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by