How to change nonzero values to 1 within a table?

18 ビュー (過去 30 日間)
A DDD
A DDD 2019 年 12 月 19 日
コメント済み: Ridwan Alam 2019 年 12 月 20 日
How to change nonzero values to '1' within a table? for all columns at once.

採用された回答

Ridwan Alam
Ridwan Alam 2019 年 12 月 19 日
tempTable = table2array(myTable);
tempTable(tempTable~=0)=1;
myTable = array2table(tempTable);
  1 件のコメント
Ridwan Alam
Ridwan Alam 2019 年 12 月 20 日
Sure. Glad to help.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeTables についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by