This problem can be solved by the following steps:
1, according to the meaning of the question, create a custom function, such as mffunc (x).
2. Use the find () function and the length () function to find 0 and 1. that is
N = length (find(X==0))
M = length (find(X== 1))
3. Use the fprintf () output function to output the numbers 0 and 1, that is
Fprintf (number of' 0% d \ n', n);
FPRINTF (number of'1%d \ n', m)
4. Use the window command to find the number of 0 and 1 in the array, that is
a =;
mfunc(A)
Step 5 get the results