How to find a value in matrix column and extract the another column equal to that value?

1 回表示 (過去 30 日間)
want to find a value from c column(example 35) and want to plot between data in column a and d equal to the value(example 35)

採用された回答

Akira Agata
Akira Agata 2017 年 7 月 16 日
I think the code will be like:
% Sample array
data = randi([30,40],100,3);
% Index where column-2 == 35
idx = data(:,2) == 35;
% Plot column-1 and column-3 under the condition that column-2 == 35
plot(data(idx,1),data(idx,3),'o');
  3 件のコメント
iyyappan c
iyyappan c 2017 年 7 月 17 日
vt = x(:,2) == 1410 & x(:,3) == 35 plot(x(vt,1),x(vt,5)) hold on to caompare two values can i use this?
Akira Agata
Akira Agata 2017 年 7 月 17 日
Yes, you can use this to compare two graphs. Please try it!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGraphics Performance についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by