Find a column number referring to an array

1 vue (au cours des 30 derniers jours)
luca
luca le 9 Oct 2019
Commenté : Jon le 9 Oct 2019
Given the following
V = [310 285 334 302 306 312 316 304 305 291 310];
M= [273.381 245.231 203.334 212.814 239.183 276.148 231.269 291.846 258.205 276.486 236.715];
I obtain a vector
point= [-304 -291.846]
Now I want to find the column of V and M where I have this result.
In this case: column number 8
May someone help me?

Réponse acceptée

Jon
Jon le 9 Oct 2019
Modifié(e) : Jon le 9 Oct 2019
You could use
idx = find(V==point(1))
or you could check the column the second element of point matched the second row of A using
idx = find(M==point(2))
  1 commentaire
Jon
Jon le 9 Oct 2019
Had my screen scrolled way over to the right and didn't realize that you had already defined the two vectors V and M. I edited my response to use your variable names.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Get Started with MATLAB dans Help Center et File Exchange

Tags

Produits


Version

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by