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

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.

 Respuesta aceptada

Grouped_Weights.Country(cellfun(@isempty,Grouped_Weights.Country),:) = {'OTHER'}

2 comentarios

thanks a lot!
OUTPUT = fillmissing(INPUT, 'previous');
is probably what you are asking about.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Characters and Strings en Centro de ayuda y File Exchange.

Productos

Versión

R2020a

Preguntada:

el 1 de Jun. de 2020

Comentada:

el 24 de Mzo. de 2025

Community Treasure Hunt

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

Start Hunting!

Translated by