Regarding concatenated error.

1 回表示 (過去 30 日間)
Feihao Sun
Feihao Sun 2020 年 7 月 17 日
回答済み: Khaled Hamed 2020 年 7 月 17 日
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});

採用された回答

Khaled Hamed
Khaled Hamed 2020 年 7 月 17 日
data = cell2mat(data1')

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCell Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by