i have a large matrix whose elements is 1 and 0; how to conver each row to decimal ,like bin2dec
Afficher commentaires plus anciens
i do it like this
if true
rownum = size(Qbinnum,1);
for i = 1:rownum
cgroup(i)=bin2dec(num2str(Qbinnum(i,:)));
end
end
as the matrix is big, so it takes a lot of seconds ,any way easier ,less time ways?
2 commentaires
Rick Rosson
le 15 Sep 2014
How many columns are there in Qbinnum?
Roger
le 15 Sep 2014
Réponse acceptée
Plus de réponses (1)
Catégories
En savoir plus sur Matrices and Arrays dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!