Declaring plot arguments/options beforehand

I would like to declare arguments of plot function once and beforehand, so than I can use them in a loop or for many plots, which would avoid clutter. I need something like optimset.
I want something like following
lineColor = {'k', 'r', 'b', 'm'};
linestyle = {'-'; '--'; ':'; '-.'};
options = {'color',lineColor{j}, 'LineStyle', linestyle{j}}
for j = 1:4
plot(X(:,j), Y(:,j), options)
end

 採用された回答

Bruno Luong
Bruno Luong 2018 年 10 月 6 日

0 投票

lineColor = {'k', 'r', 'b', 'm'};
linestyle = {'-'; '--'; ':'; '-.'};
for j = 1:4
options = {'color',lineColor{j}, 'LineStyle', linestyle{j}};
plot(X(:,j), Y(:,j), options{:})
end

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeProgramming についてさらに検索

質問済み:

2018 年 10 月 6 日

回答済み:

2018 年 10 月 6 日

Community Treasure Hunt

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

Start Hunting!

Translated by