Finding matrix values associated with plot point
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I have a 2304x24 double matrix, and a plot based on the first two values in each row (i.e., listThings(6,:)=[X, Y, more data, ..., end of row]). I want to see the full row for specific points I have chosen on the plot, but can't figure out how to find the rows based on the data from each point on the plot.
For example, I want to find the row associated with the point (75,.995) because I want to see the rest of the values in the row. There may be several dozen rows with 75 in the first column, and several dozen with .995 in the second column, but there should only be one that matches exactly.
I have looked at multiple answers in here regarding how to find values, and can find one value, but none of them seem to work to find two different values in the same row.
Any help is greatly appreciated. Thank you.
0 commentaires
Réponses (1)
Star Strider
le 15 Sep 2019
One approach:
A = rand(10,2);
A(4,:) = [75 0.995];
Lrow = ismembertol(A, [75 0.995], 0.01, 'ByRows',1)
RowNr = find(Lrow)
producing:
Lrow =
10×1 logical array
0
0
0
1
0
0
0
0
0
0
RowNr =
4
Experiment go tet the result you want.
0 commentaires
Voir également
Catégories
En savoir plus sur Surface and Mesh Plots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!