For Programmers: Free Programming Magazines  


Home > Archive > Matlab > October 2006 > find the position of a number









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author find the position of a number
andrea

2006-10-31, 8:02 am

hello all,
i have an array [1xN] which contains N random numbers.
Among those, there is the number 555.
How can i find the position where the number 555 is?
thank in advance.
Steve Amphlett

2006-10-31, 8:02 am

andrea wrote:
>
>
> hello all,
> i have an array [1xN] which contains N random numbers.
> Among those, there is the number 555.
> How can i find the position where the number 555 is?
> thank in advance.


The answer is in your question. Matlab finds it easy to find things.
Loren Shure

2006-10-31, 8:02 am

In article <ef44e64.-1@webcrossing.raydaftYaTP>, eureka_@libero.ut
says...
> hello all,
> i have an array [1xN] which contains N random numbers.
> Among those, there is the number 555.
> How can i find the position where the number 555 is?
> thank in advance.
>


Read the help for find

--Loren
http://blogs.mathworks.com/loren/
Igor

2006-10-31, 8:02 am

On Tue, 31 Oct 2006 06:23:49 -0500, andrea wrote:

> hello all,
> i have an array [1xN] which contains N random numbers.
> Among those, there is the number 555.
> How can i find the position where the number 555 is?
> thank in advance.


ind=find(array_name==555)

Igor
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com