Regarding concatenated error.

1 visualización (últimos 30 días)
Feihao Sun
Feihao Sun el 17 de Jul. de 2020
Respondida: Khaled Hamed el 17 de Jul. de 2020
Hi guys! I tried to put a 2x1 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});

Respuesta aceptada

Khaled Hamed
Khaled Hamed el 17 de Jul. de 2020
data = cell2mat(data1')

Más respuestas (0)

Categorías

Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by