Rounding Vector Entries with zeros after the decimal place to integers
显示 更早的评论
I have a vector T (attached file) which is an input for a function. Row 44 is a problem for me (112.0000). How can I do a loop which says, if you have an entry in my vector which has only zeros after the decimal place, convert the number to an integer (112). If I do round, ceil etc. on vector T, my function afterwards works, however, the rounding leads to answers which are too far away from reality. Thank you for your help.
1 个评论
Azzi Abdelmalek
2015-7-7
What is your problem? Do you just need to display your data the way you asked or what?
采纳的回答
更多回答(1 个)
Azzi Abdelmalek
2015-7-7
编辑:Azzi Abdelmalek
2015-7-7
sprintf('%d\n',T)
or
out=num2str(T)
类别
在 帮助中心 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!