how to plot specific row to specific row?
1 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
采纳的回答
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.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Line Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!