How do I replace [ ] in an array with 0's
80 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Kenneth Morley
am 15 Jan. 2014
Kommentiert: Ioannis Vourvachakis
am 11 Okt. 2021
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/155106/image.jpeg)
How can i replace the [] in the pathrisk field with 0's?
Thanks for your help!
0 Kommentare
Akzeptierte Antwort
Weitere Antworten (1)
Jos (10584)
am 15 Jan. 2014
Bearbeitet: Jos (10584)
am 15 Jan. 2014
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 Kommentare
Siehe auch
Kategorien
Mehr zu Migrate GUIDE Apps 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!