MATLAB: Error using when cell2mat (with string characters)

arraycell2matcharacterserrorMATLABmatrixstringusing

Hi, I have the following cell array that I would like to convert into a matrix with cell2mat() :
Matrix =
7×1 cell array
{'Longueur d''onde' }
{'Position 0.txt' }
{'Position_12500.txt'}
{'Position_15015.txt'}
{'Position_19000.txt'}
{'Position_4200.txt' }
{'Position_9100.txt' }
However, I get the following error :
Error using cat
Dimensions of arrays being concatenated are not consistent.
Error in cell2mat (line 83)
m{n} = cat(1,c{:,n});
It surely has something to do with the string characters, but I'm clueless at what I should do.
Thanks for your help!

Best Answer

Try
char(Matrix)
or
string(Matrix)