Formatting Multiple Curves in One Plot

4 ビュー (過去 30 日間)
cabrego
cabrego 2013 年 11 月 8 日
回答済み: cabrego 2013 年 11 月 8 日
I have a fairly basic question that I have not been able to figure out.
I would simply like to code in the plotting format so I do not have to manually change the solid lines to dash via editor tools.
I am confused because I can not use plot(x,y,'-r') since I am plotting a large array. See below..
plot(Parse(1).data(1:256,1),[Parse(1).data(1:256,2) Parse(2).data(1:256,2) Parse(3).data(1:256,2) Parse(4).data(1:256,2) Parse(5).data(1:256,2) Parse(6).data(1:256,2) Parse(7).data(1:256,2) Parse(8).data(1:256,2)])
Thanks in advanced..

回答 (2 件)

Vivek Selvam
Vivek Selvam 2013 年 11 月 8 日
Try plot(x,y1,x,y2,...,x,yn) instead of plot(x,[y1 y2 ... yn]).

cabrego
cabrego 2013 年 11 月 8 日
Your solution would work but I think it is a bit cumbersome.
here is something I figured out...
LineSpec={'r','g','b','c','r:','g:','b:','c:'};
for p=1:8
semilogy(Parse(1).data(1:256,1),Parse(p).data(1:256,2),LineSpec{p})
hold on
end

カテゴリ

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