Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

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


Math Forum » Discussions » Software » comp.soft-sys.matlab

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

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
asif khan

Posts: 16
Registered: 6/24/13
Re: finding index of any element in a matrix
Posted: Jun 24, 2013 5:27 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On Monday, June 24, 2013 2:46:20 PM UTC+5:30, Nasser M. Abbasi wrote:
> On 6/24/2013 4:11 AM, asif khan wrote:
>

> > I have a matrix
>
> > A = [3 5 8;
>
> > 5 1 3;
>
> > 9 4 7]
>
> >
>
> > i want to find the index of the 4 from the above matrix...
>
> >
>
> > by seeing the matrix, we can say it is r=3 & c=2.
>
> >
>
> > i want to get it by using command...
>
> >
>
>
>
>
>
> If you use the find() command with [I,J] as return values,
>
> you will get the result.
>
>
>
> EDU>> [I,J]=find(A==4)
>
>
>
> I =
>
>
>
> 3
>
>
>
>
>
> J =
>
>
>
> 2

Thanks for reply...
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...



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.