As the title already mentions, how is it possible to add a new cell array 1x1 at the end of an existing cell array, let's call him Q
, which is a cell array 1x3256?
% Create a new cell array. ca % Display in command window. newStuff = rand(2); % Create some new data. % Prepend it before cell #1, and show resulting array in the command window.
C = num2cell( A ) converts array A into cell array C by placing each element of A into a separate cell in C . The num2cell function converts an array that has any data type—even a nonnumeric type.
If you mean adding a single cell to the end (i.e. so your 1-by-3256 cell array becomes a 1-by-3257 cell array) then:
Q{end+1} = []
and you can replace []
with your value directly
Alternatively:
Q(end+1) = {[]}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With