MATLAB: How to call any element of array

arrayerrorif statement

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

Best Answer

If x is your array, then
any(x(:)==0)
will return logical true if any elements are zero.