How can I plot multiple signals in a single plot? Please give me suggestions which functions have used for this.
18 ビュー (過去 30 日間)
古いコメントを表示
採用された回答
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 件のコメント
Dyuman Joshi
2023 年 11 月 26 日
@Walter Roberson has already mentioned a function below. Did you try that?
その他の回答 (1 件)
Walter Roberson
2023 年 11 月 24 日
See stackedplot
4 件のコメント
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 Center および File Exchange で Measurements and Spatial Audio についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!