I have two cell arrays of strings with different dimension:
A={'Arut';'Babu';'Christ';'Daniel'};B={'Selvan';'Mahesh';'Colin';'Balaji';'Sathish'};
I need to give an header for these two arrays as 'FIRSTNAME' and 'LASTNAME' in excel file followed by the data of A and B. I have tried to concatenate and write the elements into an excel as follows:
X=[{'FirstName','LastName'};A,B] xlswrite('A.xls',A{:},B{:})
For which I am getting an error,
Error using horzcat Dimensions of matrices being concatenated are not consistent.
This is due to concatenation of A and B with different length.
Please suggest me how to export these data to an excel with headers
Best Answer