Hi,
try:
a = [1 2 3 4 5 6 7 6 5 4 3 2 1]; % 1x13 double
for i = 1:length(a)-1
out(i) = (a(i)>a(i+1));
in(i) = (a(i)<a(i+1));
end
in = find(in)
out = find(out)
Note that you can get the same reult without a loop:
in_easy = find(diff(a)>0)
out_easy = find(diff(a)<0)
Best regards
Stephan