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

1 view (last 30 days)
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
dpb
dpb on 24 Nov 2013
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

Matt J
Matt J on 24 Nov 2013
Edited: Matt J on 24 Nov 2013
Hint:
N=size(A,1);
i=1;
while i<=N
%...stuff...
i=i+1;
end
  4 Comments

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!