plot the first sample with different color

1 回表示 (過去 30 日間)
talayeh ghodsi
talayeh ghodsi 2019 年 11 月 4 日
コメント済み: talayeh ghodsi 2019 年 11 月 4 日
hello every body. i have a function called Fun which i want to plot the result. i wrote the line below and the result is attached.
now, i want to show the first sample in different color. for example the first sample in green and from the second to the end be red,
could anyone help me please?
plot(Fun(:,1)Fun(:,2),'.r-')
  1 件のコメント
KALYAN ACHARJYA
KALYAN ACHARJYA 2019 年 11 月 4 日
Can you share more details?
First sample means? data Fun?

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

採用された回答

Adam Danz
Adam Danz 2019 年 11 月 4 日
編集済み: Adam Danz 2019 年 11 月 4 日
plot(Fun(:,1)Fun(:,2),'.r-')
hold on
plot(Fun(1,1)Fun(1,2),'.g') % if you want the first coordinate
% -OR-
plot(Fun(1:2,1)Fun(1:2,2),'.g-') % if you want the first segment
BTW, I'm guessing that Fun is just an example function name and that the real function name is more descriptive and unique.
  1 件のコメント
talayeh ghodsi
talayeh ghodsi 2019 年 11 月 4 日
thanks it works great

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by