How can I store my data into a 2D array?
15 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Antworten (3)
Renato Agurto
am 16 Dez. 2015
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 Kommentare
Renato Agurto
am 16 Dez. 2015
Bearbeitet: Renato Agurto
am 16 Dez. 2015
sorry, it should be:
out{i,j} = dec2bin(abs(x(i,j)));
;-)
Siehe auch
Kategorien
Mehr zu Matrices and 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!