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

3 vues (au cours des 30 derniers jours)
Mario Diaco
Mario Diaco le 1 Juin 2020
Commenté : Walter Roberson le 24 Mar 2025
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.

Réponse acceptée

madhan ravi
madhan ravi le 1 Juin 2020
Grouped_Weights.Country(cellfun(@isempty,Grouped_Weights.Country),:) = {'OTHER'}
  2 commentaires
Mario Diaco
Mario Diaco le 1 Juin 2020
thanks a lot!
Walter Roberson
Walter Roberson le 24 Mar 2025
OUTPUT = fillmissing(INPUT, 'previous');
is probably what you are asking about.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Characters and Strings dans Help Center et File Exchange

Produits


Version

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by