Regarding integer and floating point number in an array
4 次查看(过去 30 天)
显示 更早的评论
i want to have matrix that can store integer values as well as floating point number in an matrix,but it makes integer value 0.
0 个评论
回答(2 个)
Azzi Abdelmalek
2016-4-22
编辑:Azzi Abdelmalek
2016-4-22
Maybe it displays it as 0, but doesn't makeit equal to zero, for example
a=[1235.25 1]
displays it as
1.0e+05 *
1.2554 0.0000
Now try to change the format
format long
a
0 个评论
Walter Roberson
2016-4-22
You might be talking about having a uint8 or other integer data type stored in the same matrix as single or double. That cannot be done in MATLAB; the closest you can get is to use cell arrays.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrices and Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!