cant add matrices of same dimensions
显示 更早的评论
im trying to add an image to a matrix of ones for which i have used the following code:
c=imread('C:\Users\Richik\Desktop\ima.png');
[x,y]=size(c)
m=ones(x,y);
g=m+c;
but even when the matrix dimensions are same,im getting this error:
??? Error using ==> plus
Matrix dimensions must agree.
i cant figure out why this is happening.....
采纳的回答
更多回答(1 个)
Eng. Fredius Magige
2015-10-12
0 个投票
Hi It has to follow its rule, and might be g=[m,c];
1 个评论
Walter Roberson
2015-10-12
That would, if it worked, append c after m, not add 1 to each element of c.
类别
在 帮助中心 和 File Exchange 中查找有关 Image Arithmetic 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!