How can I store my data into a 2D array?
13 ビュー (過去 30 日間)
古いコメントを表示
My code is attached below and it has the "Subscripted assignment dimension mismatch." error
How can I fix this? and how can I store my data into a 2D array? Thanks!
0 件のコメント
回答 (3 件)
Renato Agurto
2015 年 12 月 16 日
Hi. The output of dec2bin is a char not a double. So you should define "out" as a cell:
[m,n] = size(x);
out = cell(m,n);
for i = 1:m
for j = 1:n
out{m,n} = dec2bin(abs(x(m,n)));
end
end
Cheers! Renato
2 件のコメント
Renato Agurto
2015 年 12 月 16 日
編集済み: Renato Agurto
2015 年 12 月 16 日
sorry, it should be:
out{i,j} = dec2bin(abs(x(i,j)));
;-)
参考
カテゴリ
Help Center および File Exchange で Matrices and Arrays についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!