How to replace a missing value in a table with a string?

조회 수: 14 (최근 30일)
Mario Diaco
Mario Diaco 2020년 6월 1일
댓글: Walter Roberson 2025년 3월 24일
Hi.
I would find and replace the missing values (0x0 char) in a table column with the string 'OTHER'.
I tried this way, but it doesn't find the missing value:
strrep(Grouped_Weights{1,1}.Country,'','OTHER')
I've to automatize this process and I can't simply replace the single value.
Thanks.

채택된 답변

madhan ravi
madhan ravi 2020년 6월 1일
Grouped_Weights.Country(cellfun(@isempty,Grouped_Weights.Country),:) = {'OTHER'}
  댓글 수: 2
Mario Diaco
Mario Diaco 2020년 6월 1일
thanks a lot!
Walter Roberson
Walter Roberson 2025년 3월 24일
OUTPUT = fillmissing(INPUT, 'previous');
is probably what you are asking about.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Characters and Strings에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by