cell and strings in an array
1 回表示 (過去 30 日間)
古いコメントを表示
Hello,
how does one do the following:
data = cell(4:24);
data(:) = {'AD';'ED';'FA';'DE'}; <--I get an error when I assign this to the cell. How can I insert each string on the cell size above?
0 件のコメント
採用された回答
Voss
2022 年 1 月 29 日
try
data = cell(4:24);
catch ME
disp(ME.message);
end
If you want each cell of data to contain {'AD';'ED';'FA';'DE'}:
data = cell(4,24);
data(:) = {{'AD';'ED';'FA';'DE'}};
disp(data);
If instead you want each column of data to be {'AD';'ED';'FA';'DE'}:
data = repmat({'AD';'ED';'FA';'DE'},1,24);
disp(data);
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Characters and Strings についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!