How to assign numbers
3 ビュー (過去 30 日間)
古いコメントを表示
Hi all I have got a table where I want to assign number bigger than the highest number already there in the table to the ones assigned zero. How can I do that.
5 件のコメント
Guillaume
2019 年 8 月 6 日
@madhan,can you write that as an answer? I don't think it can be done any simpler.
採用された回答
その他の回答 (1 件)
Joel Handy
2019 年 8 月 6 日
Something like this?
table = randi([0 10],10,10);
tableMax = max(max(table));
table(table==0) = tableMax+1;
% Or Just
table(table==0) = Inf;
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!