How do I replace [ ] in an array with 0's
80 ビュー (過去 30 日間)
古いコメントを表示

How can i replace the [] in the pathrisk field with 0's?
Thanks for your help!
0 件のコメント
採用された回答
その他の回答 (1 件)
Jos (10584)
2014 年 1 月 15 日
編集済み: Jos (10584)
2014 年 1 月 15 日
If I am not mistaken, the variable pathrisk is a cell array with some empty cells?
pathrisk = {1 [] 5 3 [] [] 9} % example data
tf = cellfun('isempty',pathrisk) % true for empty cells
pathrisk(tf) = {0} % replace by a cell with a zero
4 件のコメント
参考
カテゴリ
Help Center および File Exchange で Migrate GUIDE Apps についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!