Find a column number referring to an array

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?

 채택된 답변

Jon
Jon 2019년 10월 9일
편집: Jon 2019년 10월 9일

0 개 추천

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

Jon
Jon 2019년 10월 9일
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.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

제품

릴리스

R2019b

태그

질문:

2019년 10월 9일

댓글:

Jon
2019년 10월 9일

Community Treasure Hunt

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

Start Hunting!

Translated by