Bug: size(I, 1)*size(I, 2) returns size(I, 1) Instead of Product
1 次查看(过去 30 天)
显示 更早的评论
I = imread('image.png');
Why does
size(I, 1)*size(I, 2)
return the value of size(I, 1) instead of the product? It gives the product if I do
a = size(I, 1);
b = size(I, 2);
a*b
0 个评论
回答(1 个)
Steven Lord
2019-6-24
This works for me. Let's make sure you haven't overloaded the size function. What does this command return?
which -all size
Also check if the variable I has size 1 in the second dimension.
0 个评论
另请参阅
类别
在 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!