Replace all numbers in a cell array that are less than 10 to 10.
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Austin Sowers
am 24 Apr. 2019
Kommentiert: Austin Sowers
am 24 Apr. 2019
I have a cell array that holds mutiple different sized cell arrays inside it. The values are all numbers. I want to replace all numbers that are less than 10 to 10.
Thanks in advance!
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 24 Apr. 2019
cellfun(@(C) cellfun(@(M) max(M,10), C, 'uniform', 0), YourOuterCellArray, 'uniform', 0)
4 Kommentare
Walter Roberson
am 24 Apr. 2019
Bearbeitet: Walter Roberson
am 24 Apr. 2019
You had posted that you have a cell array that holds different sizes of cell arrays in it. However, that is not accurate: it holds different sizes of numeric arrays in it.
cellfun(@(THIS_IS_A_DUMMY_VARIABLE_THAT_STANDS_IN_FOR_A_PARTICULAR_ARRAY) max(THIS_IS_A_DUMMY_VARIABLE_THAT_STANDS_IN_FOR_A_PARTICULAR_ARRAY,10), h1c, 'uniform', 0)
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Matrix Indexing 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!