Hy , I would like to create maxim vector what is should contain the numbers, when the if is true,then the index of the number it was saven in the empty maxim vector…the if is 3 times is true in for cyklus but the output is , always rewrite the before value what was in the maxim
maxim = []; for i=2:80 if (y(i-1)<y(i) && y(i+1)<y(i)) for j=1:(j+1) maxim(j) = y(i) end end endy1 = maxim(1)y2 = maxim(2)
Best Answer