Position of element in a row

3 views (last 30 days)
Inna Pelloso
Inna Pelloso on 9 Feb 2021
Commented: madhan ravi on 9 Feb 2021
Hi,
I have a 3 x 2 matrix, A:
A = [1 2 3; 3 5 4]
How can I find the position of the number 3 in each row? I want to create B = [3;1]
Any help would be aprpeciated!
Inna

Accepted Answer

madhan ravi
madhan ravi on 9 Feb 2021
Use second output of find()
help find
  4 Comments
Inna Pelloso
Inna Pelloso on 9 Feb 2021
Thank you. What does the '.' do?

Sign in to comment.

More Answers (0)

Categories

Find more on Shifting and Sorting Matrices in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!