Hi Yash
I have an understanding that you want to concatenate array.
If a and b are cell arrays, then you concatenate them in the same way you concatenate other arrays: using []:
>> a={1,'f'}
a =
1×2 cell array
{[1]} {'f'}
>> b={'q',5}
b =
1×2 cell array
{'q'} {[5]}
>> [a,b]
ans =
1×4 cell array
{[1]} {'f'} {'q'} {[5]}
To append a single element, you can do a{end+1}=1 or a(end+1)={1}.
Hope this helps
Regards Answer from Anay Aggarwal on mathworks.com
MathWorks
mathworks.com › matlab › language fundamentals › data types › cell arrays
Add or Delete Cells in Cell Array - MATLAB & Simulink
A common way to expand a cell array is to concatenate cell arrays vertically or horizontally.
MathWorks
mathworks.com › matlab › language fundamentals › matrices and arrays
cat - Concatenate arrays - MATLAB
Concatenate a date character vector, a string date, and a datetime into a single column of dates. The result is a datetime vector. chardate = '2016-03-24'; strdate = "2016-04-19"; t = datetime('2016-05-10','InputFormat','yyyy-MM-dd'); C = cat(1,chardate,strdate,t) C = 3×1 datetime 24-Mar-2016 19-Apr-2016 10-May-2016 ... Create a cell array containing two matrices, and concatenate the matrices both vertically and horizontally.
MathWorks
mathworks.com › matlab › language fundamentals › matrices and arrays
horzcat - Concatenate arrays horizontally - MATLAB
To construct a single piece of delimited text from a cell array of character vectors or a string array, use the strjoin function. When concatenating an empty array to a nonempty array, horzcat omits the empty array in the output.
Omics
matlab.omics.wiki › matrix › cell-array
Matlab by Examples - cell array
Append single element to cell array A = {'a1','a2'}; A{end+1} = 'a3' 'a1' 'a2' 'a3' Append multiple elements to cell array (combine / concatenate cell arrays horizontally) A = {'a1','a2'}; B = {'b1','b2'}; A = [ A, B ] 'a1' 'a2' 'b1' 'b2' → Cell arrays: edit text in cell fields
MathWorks
mathworks.com › matlabcentral › answers › 6064-bulk-concatenation-of-cell-array-contents-without-looping
Bulk concatenation of cell array contents (without looping)? - MATLAB Answers - MATLAB Central
April 23, 2011 - Bulk concatenation of cell array contents... Learn more about cell, concatenate, loop, looping, element, bulk, array MATLAB
MathWorks
mathworks.com › matlabcentral › answers › 2106901-concatenating-a-cell-array
Concatenating a cell array - MATLAB Answers - MATLAB Central
April 15, 2024 - Given: A cell array with names where names={'Harry','Xavier','Sue'}; Find: How to concantenate a '1' at the end of each character array using a for-loop and the strcat function, among others. Iss...
MathWorks
mathworks.com › matlabcentral › answers › 361522-concatenating-horizontally-two-cell-arrays
Concatenating horizontally two cell arrays - MATLAB Answers - MATLAB Central
October 16, 2017 - Hi, A{1,1}=00016510; B{1,1}=0; C=horzcat(A{1,1},B{1,1});% is giving C=00016510 (1x9 char although 8 digits appear) C=horzcat(A,B);%gives C= '00016510' [0] (1×2 cell array) I a...
MathWorks
mathworks.com › matlabcentral › answers › 373261-how-to-combine-two-cell-array-to-be-1-cell-array
How to Combine two Cell Array to be 1 cell array? - MATLAB Answers - MATLAB Central
December 16, 2017 - How to Combine two Cell Array to be 1 cell array?. Learn more about .