Horizontally concatenate three 1d arrays of different lengths into one 2d array in matlab -
is possible?
say have 3 cell arrays of different lengths in matlab:
"hello" "hi" "whats" "your" "name" "how" "are" "you"
and want concatenate them 2d array:
"hello" "whats" "how" "hi" "your" "are" 0 "name" "you"
is possible? have tried using cat() , horzcat() because of different lengths of matrices, comes error.
according matlab's help,
concatenating arrays next 1 using commas called horizontal concatenation. each array must have same number of rows. similarly, when arrays have same number of columns, can concatenate vertically using semicolons.
so impossible, since array should have rows of different length.
i think best alternative utilize cell
.
arrays matlab matrix merge concatenation
No comments:
Post a Comment