MATLAB Answers

suppose i have a vector 'bw' if in there value '0' exist than total value of bw=0 is estimated.

1 view (last 30 days)
RAVI
RAVI on 25 Oct 2018
Commented: madhan ravi on 25 Oct 2018
bw=[120 1322 5542 5653 0 0 0 45451]; than bw=0 because zero exist in vector....if bw=[121 5454 24 54 4 5454 545 4654]; than bw=121;

  0 Comments

Sign in to comment.

Accepted Answer

madhan ravi
madhan ravi on 25 Oct 2018
bw=[120 1322 5542 5653 0 0 0 45451]
if any(bw==0)
bw = 0
else
bw=bw(1)
end

  1 Comment

madhan ravi
madhan ravi on 25 Oct 2018
the above code demonstrates, if any value is zero in bw it displays zero, if not displays first element of bw

Sign in to comment.

More Answers (0)


Translated by