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

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!!

1 Comment

Seems like strange request for while but...for HW, post at least an attempt and specific questions where get stuck, don't just expect a solution.

Sign in to comment.

 Accepted Answer

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

More Answers (0)

Asked:

on 24 Nov 2013

Commented:

on 24 Nov 2013

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!