I can't tell what relation there is between your time(y) vector and the
other, so I can't really include it here.
j=1;
for i=2:length(th)
if th(i)/th(i1)==.1
A(j) = i;
j = j+1;
end
end
for ex, with
th = [100 10 1 0.5 0.25];
this loop returns
A =
2 3
You may wish to preallocate A as a vector of zeros if you're dealing with a
large number of checks.
"Mary " <22luongo@cardinalmail.cua.edu> wrote in message
news:kl9s92$ptr$1@newscl01ah.mathworks.com...
> This is the jist of what I want to set up, I'm just fuzzy on how to go
> about it:
>
> th(k)= vector of values [ko k1 k2 k3...]
> time(y) = time vector of values [t1 t2 t3]
> the vectors have equal lengths and are going to be plotted together
>
> for ( to cycle through all values of th(k));
> if k1/ko == .1
> then stop code and show the value of k and y that was true for
> else
> continue cycling through each th(k) vector value until that becomes true
> (example next cycle would check k2/k1 ==.1 etc)
>
> ko = initial value
> k1 = value right next to it
>
> I havent worked with vectors in forever and I would appreciate any help!
>
> Thanks!
