How to change nonzero values to 1 within a table?

18 visualizzazioni (ultimi 30 giorni)
How to change nonzero values to '1' within a table? for all columns at once.

Risposta accettata

Ridwan Alam
Ridwan Alam il 19 Dic 2019
tempTable = table2array(myTable);
tempTable(tempTable~=0)=1;
myTable = array2table(tempTable);

Più risposte (0)

Categorie

Scopri di più su Tables in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by