Plot several graphs with distance in Y-axis!

4 ビュー (過去 30 日間)
M G
M G 2013 年 9 月 12 日
編集済み: the cyclist 2022 年 7 月 8 日
Hi Matlab experts,
If we have matrix M with the size 20x100. I want to plot 20 rows (each row has 100 points) in one figure in a way that graphs do not overlap on each other. How can I plot them with distance from each others on Y-axis while preserving the scaling? Something similar to EEG.
Thanks for your help. Mehdi

採用された回答

the cyclist
the cyclist 2013 年 9 月 12 日
編集済み: the cyclist 2022 年 7 月 8 日
Here's one way:
% Create some data
M = 0.3*rand(20,100);
offset = 1; % Make this big enough to prevent overlap
offset_vector = (offset:offset:20*offset)';
M_plus_offset = bsxfun(@plus,M,offset_vector);
figure
plot(M_plus_offset')
  1 件のコメント
Kaushik Pradhan
Kaushik Pradhan 2022 年 7 月 7 日
Thank you very much!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by