MATLAB: In an assignment A(:) = B, the number of elements in A and B must be the same

cell array

I want to convert a cell array to a data vector, but matlab is showing this error: "In an assignment A(:) = B, the number of elements in A and B must be the same"
My code:
A = textread(['S1223.dat'],'%s');
x = zeros([size(A) 1]);
for i=1:size(A)
x(i) = A{i};
end
I do not understand, because the vector x has the same number of rows as the cell array. How can I fix this?

Best Answer

Are the contents of the cells of A strings? Or even strings with multiple numbers in them? If so, you might have to use str2double() or sscanf().
Then attach S1223.dat after reading this link