How can MATLAB's buit-in function give output as class single intead of double?
2 次查看(过去 30 天)
显示 更早的评论
All matlab function gives output as class double.
e.g.
[I,J] = ind2sub([H W],idx);
it is clear that I & J will be integer type but then also matlab gives values of I & J as class double.
How can get output as class interger 'int16'?
5 个评论
Walter Roberson
2018-8-26
Well, they could be done as uint64.
It would not be unreasonable for MATLAB to support passing in the name of the output type for ind2sub, but it does not currently do so.
回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
