MATLAB: How to find a raw and column number of an element in a matrix

column numberfindraw number

I know this is a basic question, but I couldn´t find an answer from what I´ve read. I want to find a column number of a certain number.
m = [1 2; 3 4 ; 5 6; 7 8] is my matrix and I want to find the column number of 3. It should be 1. I used the function ´find´ , but I don´t understand the result I get. How to find this? Thank you!
>> m=[ 1 2; 3 4; 5 6; 7 8]
m =
1 2
3 4
5 6
7 8
>> [raw,col] = find(3)
raw =
1
col =
1

Best Answer

my code
m=[ 1 2; 3 4; 5 6; 7 8]
[r,c]=find(m==3)
your code
you are trying to find the index of the number by itself which is 3 so you get the result as 1,1 which is correct see my code