Can one substitute string values in a matrix?

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?

 採用された回答

madhan ravi
madhan ravi 2020 年 12 月 7 日

0 投票

dum = strings(height(T), 1); % you could also use repmat or repelem to do it in one line
dum(:) = "January";

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeIntroduction to Installation and Licensing についてさらに検索

タグ

質問済み:

2020 年 12 月 7 日

コメント済み:

2020 年 12 月 7 日

Community Treasure Hunt

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

Start Hunting!

Translated by