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에서 Images에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!