How to assign numbers
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
karishma koshy
am 6 Aug. 2019
Kommentiert: karishma koshy
am 6 Aug. 2019
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 Kommentare
Guillaume
am 6 Aug. 2019
@madhan,can you write that as an answer? I don't think it can be done any simpler.
Akzeptierte Antwort
Weitere Antworten (1)
Joel Handy
am 6 Aug. 2019
Something like this?
table = randi([0 10],10,10);
tableMax = max(max(table));
table(table==0) = tableMax+1;
% Or Just
table(table==0) = Inf;
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!