How to add a numerical array
a=[1 2 3 4]
as row into my cell
C = |'a' 'b' 'c' 'd'| |'e' 'f' 'g' 'h'| |'i' 'j' 'k' 'l'| |'m' 'n' 'o' 'p'|
so, that
C = |'1' '2' '3' '4'| |'a' 'b' 'c' 'd'| |'e' 'f' 'g' 'h'| |'i' 'j' 'k' 'l'| |'m' 'n' 'o' 'p'|
or as new column into cell C:
C = |'1' 'a' 'b' 'c' 'd'| |'2' 'e' 'f' 'g' 'h'| |'3' 'i' 'j' 'k' 'l'| |'4' 'm' 'n' 'o' 'p'|
(the numerical values become strings).
AND: How to transform for example a 2×4 cell into a 1×8 (or 8×1) cell:
C= |'a' 'b' 'c' 'd'| ----> C = |'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h'| |'e' 'f' 'g' 'h'| or:----> C = |'a'| |'e'| |'b'| |'f'| |'c'| |'g'| |'d'| |'h'|
I can solve these problems with for-loops, but imagine you have a huge size of the cell array, it is not very efficient. Is there an easier way? Thanks!
Best Answer