|
On Jun 3, 10:37 pm, "Jack "
<use.text.after.underscore.only_jcan...@csu.edu.au> wrote:
> Hi Sadik,
>
> Thanks for the reply... i tried your suggestion, however the returned variable is an empty matrix...?
>
> Jack
>
>
>
> "Sadik " <sadik.h...@gmail.com> wrote in message <h07b65$jv...@fred.mathworks.com>...
> > You could say
>
> > firstIndex = find(F==98,1);
>
> > "Jack " <use.text.after.underscore.only_jcan...@csu.edu.au> wrote in message <h079fp$16...@fred.mathworks.com>...
> > > I have a single column vector "F". How can I index to the first occurrence of a the value "98". Only the row at which "98" first occurs is needed (... yes, I am a newbie to matlab). I am having trouble correctly using the find and index functions... Any help would be greatly appreciated. Thanks- Hide quoted text -
>
> - Show quoted text -
------------------------------------------------------------------------------
Then 98 isn't in your array. Try this:
clc;
close all;
F = randperm(150)
firstIndex = find(F==98,1)
|