Can one substitute string values in a matrix?

1 vue (au cours des 30 derniers jours)
alpedhuez
alpedhuez le 7 Déc 2020
Commenté : alpedhuez le 7 Déc 2020
I create
dum=zeros(height(T),1)
I want Matlab to fill all the values of dum with a string 'January'. How is it possible?

Réponse acceptée

madhan ravi
madhan ravi le 7 Déc 2020
dum = strings(height(T), 1); % you could also use repmat or repelem to do it in one line
dum(:) = "January";

Plus de réponses (0)

Catégories

En savoir plus sur Matrices and Arrays dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by