How to change nonzero values to 1 within a table?
11 views (last 30 days)
Show older comments
How to change nonzero values to '1' within a table? for all columns at once.
0 Comments
Accepted Answer
Ridwan Alam
on 19 Dec 2019
tempTable = table2array(myTable);
tempTable(tempTable~=0)=1;
myTable = array2table(tempTable);
More Answers (0)
See Also
Categories
Find more on Tables 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!