What does the function all() do?

What does the function all() do?
A. Returns 1 if all elements within it are 0
B. Returns 0 if all elements within it are 0
C. Returns 0 if all elements within it are non-zero
D. Returns 1 if all elements within it are non-zero
 
Answer: d
Explanation: The all() function is inbuilt in MATLAB. If we give a vector input to our function, it will return a 1 if all the elements of the vector are non-zero.
 

Tìm kiếm

Back
Top