Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: finding index of any element in a matrix
Replies: 6   Last Post: Jun 24, 2013 2:07 PM

 Messages: [ Previous | Next ]
 asif khan Posts: 16 Registered: 6/24/13
Re: finding index of any element in a matrix
Posted: Jun 24, 2013 6:13 AM

On Monday, June 24, 2013 3:12:33 PM UTC+5:30, Nasser M. Abbasi wrote:
> > the problem is i have taken a matrix
>
> >
>
> > R = rand(6,4)
>
> >
>
> > and i gave the same command that you mentioned...
>
> >
>
> > but it is not giving the answer...
>
> >
>
>
>
> Well, yes, ofcourse, the number 4 will not be in R,
>
> so typing find(R==4) will not return anything.
>
>
>
> Matlab rand returns numbers from 0 to 1 only.
>
>
>
> "from the standard uniform distribution on the open interval(0,1)"
>
>
>
> --Nasser

same command means... not find(R==4)...

eg,R = rand(3,3)

R =

0.4820 0.2262 0.2518
0.1206 0.3846 0.2904
0.5895 0.5830 0.6171

I = find(R==0.6171)

I =

Empty matrix: 0-by-1
that is the problem... is there any precision problem???

Date Subject Author
6/24/13 asif khan
6/24/13 Nasser Abbasi
6/24/13 asif khan
6/24/13 Nasser Abbasi
6/24/13 asif khan
6/24/13 Nasser Abbasi
6/24/13 asif khan