Filter löschen
Filter löschen

Regarding concatenated error.

1 Ansicht (letzte 30 Tage)
Feihao Sun
Feihao Sun am 17 Jul. 2020
Beantwortet: Khaled Hamed am 17 Jul. 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});

Akzeptierte Antwort

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

Weitere Antworten (0)

Kategorien

Mehr zu Cell Arrays finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by