How to turn string into numbers it represents without using str2num?
显示 更早的评论
The only functions allowed are:
zeros, ones, reshape, repmat, length, size, max, min, mod, all, any, sort, find, floor, ceil, round, log10, sum
1 个评论
James Tursa
2015-11-29
If you were to do this by hand, do you have any ideas about how you would go about it? E.g., how could you figure out the first digit?
回答(1 个)
Walter Roberson
2015-11-29
0 个投票
You cannot do that. Converting a string into a number requires addition (and multiplication makes it easier.) You would also need to index into the string, but indexing is a function.
类别
在 帮助中心 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!