Using a base bigger than 36
11 次查看(过去 30 天)
显示 更早的评论
Hi everyone,
Do you know how can I possibly transform a vector that could be base2 , base7 , but also bigger like base128 or base150 into a decimal. Because base2dec seems to only go as high as base36
0 个评论
采纳的回答
Niklas Nylén
2014-4-14
You can see the code of base2dec by writing
edit base2dec
The reason it is limited to base 36 seems to be that you run out of letters in the english alphabet. You should be able to copy base2dec and add more symbols for a higher base.
2 个评论
Niklas Nylén
2014-4-14
编辑:Niklas Nylén
2014-4-14
That requires some other, still small, adaptations of base2dec. More specifically you need to remove the value conversion lines near the end and use your vector as input.
Or you could write your own conversion code, which is not that difficult.
更多回答(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!