Clear Filters
Clear Filters

how to convert matrix to binary matrix?

4 views (last 30 days)
if i have this matrix
A = [ 0 5 0 1
6 7 2 0
0 0 4 1 ]
HOW CAN I CONVERT IT TO THIS BY REPLACE THE NUMBER > 1 TO ONE LIKE A_C
A_C = [ 0 1 0 1
1 1 1 0
0 0 1 1 ]

Accepted Answer

Azzi Abdelmalek
Azzi Abdelmalek on 26 Apr 2016
Edited: Azzi Abdelmalek on 26 Apr 2016
A_C=~~A
Or
A_C=logical(A)

More Answers (0)

Categories

Find more on Numeric Types in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!