How to make specific elements of a cell equal to zero?
6 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
採用された回答
その他の回答 (1 件)
Walter Roberson
2022 年 9 月 15 日
newCell = cellfun(@(M) M.*(M<=0.5), YourCell, 'uniform', 0)
However this will fail in locations that contain infinite values.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Workspace Variables and MAT-Files についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!