Choose the correct option.

Choose the correct option.
A. any() shows all the elements in a matrix while all() shows every element of a vector
B. any() is ‘true’ if elements in a vector is zero
C. all() is ‘true’ if every element in a vector is non zero
D. all() is ‘true’ if every element in a vector is 0
 
Answer: c
Explanation: ‘any()’ and ‘all()’ are pre-defined functions in MATLAB. The function ‘any()’ returns 1 if every element of the vector, mentioned within the parentheses, is non-zero. The function ‘all()’ returns 1 if any element of the vector is non-zero.
 

Tìm kiếm

Back
Top