How to make specific elements of a cell equal to zero?
10 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Haitham AL Satai
il 15 Set 2022
Risposto: Walter Roberson
il 15 Set 2022
I have a cell 41 * 41 dimension and I would like to make the values that over 0.5 zeros and the rest of the values keep them without any changes.
Any assistance, please?
0 Commenti
Risposta accettata
Più risposte (1)
Walter Roberson
il 15 Set 2022
newCell = cellfun(@(M) M.*(M<=0.5), YourCell, 'uniform', 0)
However this will fail in locations that contain infinite values.
0 Commenti
Vedere anche
Categorie
Scopri di più su Numeric Types 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!