replace [ ] in an array with 0's
조회 수: 4 (최근 30일)
이전 댓글 표시
talks about replace [] with 0's for one column. But suppose I have a table with many columns and I want to run this operation for multiple colmns. Is there any way simpler than writing another loop?
댓글 수: 0
채택된 답변
Image Analyst
2020년 7월 7일
tables use functions like ismissing() and fillmissing():
newTable = fillmissing(badTable, 'constant', 0)
추가 답변 (2개)
KSSV
2020년 7월 7일
You can get all the emtpy functions in a cell using cellfun ..
idx = cellfun(@isempty,C) ; % get empty cells in a cell array C
C(idx) = 0 ; % replace with zero
Note that, cellfun also uses loop inside.
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!