Error using + Matrix dimensions must agree
이전 댓글 표시
RGB=real(DFT)+WMI;
댓글 수: 6
Mostfa Abd El-Aziz
2021년 11월 8일
Chunru
2021년 11월 8일
What are the sizes of DFT and WMI? Show the result of running "whos" in matlab.
Steven Lord
2021년 11월 8일
What do the following commands show immediately before you execute that line of code?
size(DFT)
size(real(DFT))
size(WMI)
Voss
2021년 11월 8일
My guess would be that the dimensions of matrices DFT and WMI do not agree.
Steven Lord
2021년 11월 8일
Yes, I agree that likely the dimensions don't agree. Seeing the size of each array may give us some insight into what the cause of that discrepancy may be and suggest a solution. For instance, if both are vectors but one is one element shorter I'd ask if they called diff to create the shorter vector. If one is a vector and the other has the same number of elements but is a different shape, calling reshape may be what the poster wants.
Mostfa Abd El-Aziz
2021년 11월 9일
답변 (1개)
yanqi liu
2021년 11월 9일
RGB=real(DFT)+imresize(WMI,[size(DFT,1) size(DFT,2)], 'bilinear');
댓글 수: 4
Mostfa Abd El-Aziz
2021년 11월 9일
yanqi liu
2021년 11월 9일
RGB=real(DFT(:,:,1))+imresize(WMI(:,:,1),[size(real(DFT(:,:,1)),1) size(real(DFT(:,:,1)),2)], 'bilinear');
Mostfa Abd El-Aziz
2021년 11월 9일
yanqi liu
2021년 11월 10일
yes, sir, may be upload mat file to analysis
카테고리
도움말 센터 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!