フィルターのクリア

Plot a row with different color

1 回表示 (過去 30 日間)
Asim Ismail
Asim Ismail 2017 年 5 月 12 日
編集済み: Asim Ismail 2017 年 5 月 12 日
I have a simple 10x2 matrix with random values, scattered in a plot
a=rand(10, 2)*10;
scatter(a(:, 1),a(:, 2))
Suppose somehow I got values of a row, without knowing which row exactly it is, is there a way to draw the plot again, but this time the certain row will be painted in a different color than the others?

採用された回答

KL
KL 2017 年 5 月 12 日
編集済み: KL 2017 年 5 月 12 日
a=rand(10, 2)*10;
scatter(a(:, 1),a(:, 2))
hold on
x = randi(length(a)) %your random row
scatter(a(x,1),a(x,2),'m')
  1 件のコメント
Asim Ismail
Asim Ismail 2017 年 5 月 12 日
編集済み: Asim Ismail 2017 年 5 月 12 日
Its working, thanks a lot

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeScatter Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by