MATLAB: Converting cell array to matrix converting cell array to matrix I have a cell array a = {'a' , 'b' , 'c' ,'d' , 'e'} I need to convert a cell array to matix with ','(comma in between) my answer should be a = a,b,c,d,e how can i do it? thanks a lot Best Answer a = {'a' , 'b' , 'c' ,'d' , 'e'};a = sprintf('%c,',[a{:}]);a = a(1:end-1); Related SolutionsMATLAB: Detecting NaN in cell array cellfun(@(C) any(isnan(C(:)), YourCell)However in your situation you could probably go withcellfun(@isnumeric, C)Oh wait, when you say NaN, do you mean the string 'NaN' ? If so thencellfun(@(C) strcmp(C, 'NaN'), C) MATLAB: Concatenating characters in different column to a string ['a' 'b' 'c' 'd' 'e'] is not a 1 x 5 array of strings: it is a single string of length 5, 'abcde', exactly as you want.{'a' 'b' 'c' 'd' 'e'} on the other hand would be a 1 x 5 cell array of strings. You can convert this cell array to a single string by using cell2mat() Related QuestionCell array to string arraySort cell array columns by two dimensionsXlswriteTransfer a matrix in a quick wayConcatenate cell array into one stringCreate a cell array of mixed dimensionShifting column cell array of string into rowSearch smaller string array to bigger string array
Best Answer