How to call any element of array

I have a code where I want to define an arugment "If any element of the array is 0 then return error"

 Accepted Answer

the cyclist
the cyclist on 16 May 2017
Edited: the cyclist on 16 May 2017
If x is your array, then
any(x(:)==0)
will return logical true if any elements are zero.

More Answers (0)

Asked:

on 16 May 2017

Edited:

on 16 May 2017

Community Treasure Hunt

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

Start Hunting!