how to convert 1100111 to 1 1 0 0 1 1 1
2 次查看(过去 30 天)
显示 更早的评论
Dear All,
I need to convert a matrix of
a=[11100;10000;10101];
to
s=[1 1 1 0 0;1 0 0 0 0;1 0 1 0 1];
to convert s to a we use
char(s+'0');
but how form a to s. Thanks in advance for any help.
regards,
Imola
0 个评论
采纳的回答
更多回答(2 个)
Azzi Abdelmalek
2015-6-26
a={'11100';'10000';'10101'}
out=cell2mat(cellfun(@(x) x-'0',a,'un',0))
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Type Conversion 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!