Assign double array to cell array
Ältere Kommentare anzeigen
Hello,
This seems like it should be obvious, but it isn't: I have several n x 1 cell arrays that I put into a table. Now I want to add the contents of an n x 1 double array, and it needs to be an n x 1 cell array.
Let's say n = 78. I've tried creating x = cell(78,1), but then can't seem to find a way to assign the the 78 x 1 double array y to x! Tried deal(), but that didn't work.
Missing something obvious, I am sure! Thanks.
Doug
Akzeptierte Antwort
Weitere Antworten (1)
KSSV
am 12 Nov. 2021
A = rand(3)
B = mat2cell(A,size(A,1),ones(1,size(A,2)))
1 Kommentar
Douglas Anderson
am 12 Nov. 2021
Kategorien
Mehr zu Matrix Indexing finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!