フィルターのクリア

How can I set multiple text descriptions' colours at one time

2 ビュー (過去 30 日間)
Greer Gray
Greer Gray 2018 年 11 月 28 日
コメント済み: madhan ravi 2018 年 11 月 29 日
Suppose I have
xt = [1 2 3 4];
yt = [1 2 3 4];
str = {'one','two','three','four'};
tt = text(xt,yt,str);
xlim([0 5])
ylim([0 5])
How do I set 1 and 3 to the color red together without a loop
i.e. tt([1 3]).Color = 'r'

採用された回答

madhan ravi
madhan ravi 2018 年 11 月 28 日
[tt(1).Color,tt(3).Color] = deal('r')
  2 件のコメント
Greer Gray
Greer Gray 2018 年 11 月 29 日
Thanks
madhan ravi
madhan ravi 2018 年 11 月 29 日
Anytime :)

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by