Réponse acceptée

José-Luis
José-Luis le 6 Mai 2014
Modifié(e) : José-Luis le 13 Mai 2014

0 votes

Two alternatives, since I am not exactly sure what you want.
a = num2cell(randi(10,10,10));
your_mat = cell2mat(a);
your_mat_alt = [a{:}];

2 commentaires

andrew
andrew le 13 Mai 2014
so i currently have apple.doc, apple.xlsx, apple.csv, banana.doc, banana.xlsx ,etc. in seperate columns. the output should be ['apple.doc;''apple.xslx;' 'banana.doc;' 'banana.xlsx;'] all in one cell
A=[ {'1'},{'1'},{'1'},{'1'},{'0'},{'1'},{'0'},{'1'}];
unique_cell = {sprintf('%s;',A{:})};
Please accept an answer if it helped you.

Connectez-vous pour commenter.

Plus de réponses (1)

Jos (10584)
Jos (10584) le 13 Mai 2014

0 votes

Another option using STRCAT
A = {'apple.doc', 'apple.xlsx', 'apple.csv', 'banana.doc', 'banana.xlsx'}
B = strcat(A,';')
C = [B{:}]

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by