How do I replace Matrix elements
130 views (last 30 days)
Show older comments
Given a matrix A replace elements not equal 0 and not equal 1 by 5. Use disp() function to print out the resulting array.
So far I've got
A(A~=0) = 5;
disp(A);
but do not know how to make it 0 AND 1.
Accepted Answer
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!