How can I plot multiple signals in a single plot? Please give me suggestions which functions have used for this.

조회 수: 16 (최근 30일)

채택된 답변

Chunru
Chunru 2023년 11월 23일
편집: Chunru 2023년 11월 23일
% Generate som data
fs = 1000;
t=(0:1/fs:1)';
f = 10:10:40;
x = sin(2*pi*t*f);
x = x + 0.1*randn(size(x));
n = size(x, 2); % num of channels
yyaxis left
s = 0.4; % scale factor
plot(t, s*x + (0:n-1) );
yticks(-1:n)
yticklabels(["" "abc" "def" "a" "b" ""])
yyaxis right
ylim( [-1 n]/s)
yticks( [0 1]/s)
  댓글 수: 5
Komal
Komal 2023년 11월 26일
Dear experts, how can I plot in this type? Which function is used for this plotting?

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Walter Roberson
Walter Roberson 2023년 11월 24일
  댓글 수: 4
Walter Roberson
Walter Roberson 2023년 11월 27일
편집: Walter Roberson 2023년 11월 27일
Create a timetable() object with variable names {'Input Signal', 'Clean Signal', 'Artifact'} and with 'RowTimes' set to the time vector.
Now stackedplot() that timetable object.
For example,
TT = timetable(input_signal(:), clean_signal(:), artifact(:), 'VariableNames', {'Input Signal', 'Clean Signal', 'Artifact'}, 'RowTimes', t);
stackedplot(TT);

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by