Can one substitute string values in a matrix?

1 回表示 (過去 30 日間)
alpedhuez
alpedhuez 2020 年 12 月 7 日
コメント済み: alpedhuez 2020 年 12 月 7 日
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 日
dum = strings(height(T), 1); % you could also use repmat or repelem to do it in one line
dum(:) = "January";

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrices and Arrays についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by