How to remove leading zeros in decimal representation?
9 次查看(过去 30 天)
显示 更早的评论
A = [23, 15, 256, 75];
B= dec2bin(A)
B =
4×9 char array
'000010111'
'000001111'
'100000000'
'001001011'
But I'm interested in output B as;
10111
1111
100000000
1001011
I want to remove leading zeros?
0 个评论
采纳的回答
更多回答(1 个)
Abderrahim. B
2022-8-10
Hi!
Use str2num.
A = [23, 15, 256, 75];
B= dec2bin(A)
B = str2num(B)
Hope this helps
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!