Convert number vector back to segmented string
1 次查看(过去 30 天)
显示 更早的评论
Hi all
Does anybody know how to convert a number vector back to a "segmented", equispaced string? For example: x=str2num('0:2:6 10:5:30') results in [0 2 4 6 10 15 20 25 30]. But when I have the vector, how can I get back to the string showing the segments, not just the full list of numbers as a string, which is what num2str will result in. Thanks
0 个评论
采纳的回答
Jan
2011-9-23
See:
Note that this procedure is instable: 0:0.1:1 is not equidistant due to the limited numerical precision. But for integers < 2^53-1 the methods are expected to work as expected.
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!