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

findfor loop

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)

Best Answer

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');