MATLAB: Regarding concatenated error.

cell array to matrix

Hi guys! I tried to put a 2×1 cell array into a one row matrix. I tried to use cell2mat but it didn't work. Please help!
i used the following code:
filename = 'glider.txt'
data1 = importdata(filename)
data = cell2mat(data1)
so glider.txt intitally shoud be
x=3, y=3
bo$2bo$3o!
All i really wanted it to be is just x=3,y=3bo$2bo$3o!
but when I ran my code i got 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});

Best Answer

data = cell2mat(data1')