Finding matrix values associated with plot point

1 visualizzazione (ultimi 30 giorni)
Robert Rieke
Robert Rieke il 15 Set 2019
Risposto: Star Strider il 15 Set 2019
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.

Risposte (1)

Star Strider
Star Strider il 15 Set 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.

Categorie

Scopri di più su Line Plots 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!

Translated by