MATLAB: How to write a simple algorithm that can allow the user to know the index of the first negative element in a column matrix.

findhomeworkindex

Using a WHILE statement….. how to write a simple algorithm that can allow the user to know the index of the first negative element in a column matrix.? I have to do this using a while statement….! Help needed!!

Best Answer

Hint:
N=size(A,1);
i=1;
while i<=N
%...stuff...
i=i+1;
end