Error using ./ Matrix Dimensions Must Agree ??!! how to solve this??
이전 댓글 표시
im getting error in the 4th line for ./ wat should i change ?
l=getimage(handles.axes1);
s=getimage(handles.axes3);
imsave(handles.axes3);
r=double(s)./(double(l)+1.0);
imshow(r,'Parent',handles.axes5);
i used images of same dimensions too
댓글 수: 13
Stephen23
2017년 1월 18일
"wat should i change"
The size of s and/or l.
Divya Praisy
2017년 1월 18일
Stephen23
2017년 1월 18일
@Divya Praisy: please put these two commands on the line before the one with the error:
size(l)
size(s)
and then tell us exactly what they print in the command window.
Divya Praisy
2017년 1월 18일
Divya Praisy
2017년 1월 18일
Divya Praisy
2017년 1월 18일
It must be noted that if Divya was using the latest version of matlab the error would not have occured due to the implicit expansion for compatible array sizes introduced in R2016b.
It's always worth mentioning in your question if you're not using the latest version.
Divya Praisy
2017년 1월 18일
Guillaume
2017년 1월 18일
Either you're not using R2016b, or the dimensions are not as you've stated:
s = rand(370, 278); %a 370 x 278 matrix
l = rand(370, 278, 3); %a 370 x 278 x 3 matrix
r = double(s) ./ (double(l) + 1)
produces no error in R2016b. r has size 370 x 278 x 3
Divya Praisy
2017년 1월 18일
Divya Praisy
2017년 1월 18일
Guillaume
2017년 1월 18일
I answered your question over an hour ago with a solution that works in any version of matlab. See down there
||
||
\/
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Image Filtering and Enhancement에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
