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

4 views (last 30 days)
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)

Accepted Answer

Akira Agata
Akira Agata on 16 Jul 2017
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 Comments
iyyappan c
iyyappan c on 17 Jul 2017
vt = x(:,2) == 1410 & x(:,3) == 35 plot(x(vt,1),x(vt,5)) hold on to caompare two values can i use this?

Sign in to comment.

More Answers (0)

Categories

Find more on Matrices and Arrays in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!