repmat usage for cellarray
Show older comments
data = 32 x 1
double_array=[repmat(data,1,286);]; %= 286 x 32 double
Now, I need to replace data with data_string as follows:
data_string = 32 x 3 char aray
Then, I need to create cell array using the above repmat operation. I tried the below but it gave error:
cell_array=repmat({data_string,1,286});
What is the proper way to construct cell_array matrix? My matlab version is 2019a.
Accepted Answer
More Answers (1)
data_string = reshape(char(32:127), 3, []) % some characters32 x 3 char aray
cell_array=repmat({data_string},1,3)
cell_array{3}
1 Comment
sermet OGUTCU
on 18 Nov 2021
Edited: sermet OGUTCU
on 18 Nov 2021
Categories
Find more on Operators and Elementary Operations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!