How to find a value in matrix column and extract the another column equal to that value?
4 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
iyyappan c
il 14 Lug 2017
Commentato: Akira Agata
il 17 Lug 2017
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)
0 Commenti
Risposta accettata
Akira Agata
il 16 Lug 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 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Matrices and Arrays in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!