how to plot specific row to specific row?

2 ビュー (過去 30 日間)
Kun-Lin Lee
Kun-Lin Lee 2015 年 3 月 31 日
コメント済み: Kun-Lin Lee 2015 年 3 月 31 日
I have two matrices, frequency and phase, each row indicate one measurement. I need to plot frequency vs phase for each measurement. However, my lines below plots 1-by-n plots for each frequency row. i=1:n; plot(f(i,:),phase(i,:));
I know I can just write something like plot(f(1,:),phase(1,:),f(2,:),phase(2,:),f(3,:),phase(3,:)....). But I have hundreds of measurements.
Could anyone please show me how to plot specific row to specific row?
Thank you very much

採用された回答

Michael Haderlein
Michael Haderlein 2015 年 3 月 31 日
編集済み: Michael Haderlein 2015 年 3 月 31 日
Just transpose it:
>> f=[1:10;11:20;21:30];
>> phase=1./f;
>> figure, plot(f',phase')
If the parameters for the plot functions are matrices, each column will be one line.
  1 件のコメント
Kun-Lin Lee
Kun-Lin Lee 2015 年 3 月 31 日
Thank you Michael. It works. May I ask the reason for that?

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAnnotations についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by