Error using + Matrix dimensions must agree

RGB=real(DFT)+WMI;

6 件のコメント

Mostfa Abd El-Aziz
Mostfa Abd El-Aziz 2021 年 11 月 8 日
Error using +
Matrix dimensions must agree.
RGB=real(DFT)+WMI;
Chunru
Chunru 2021 年 11 月 8 日
What are the sizes of DFT and WMI? Show the result of running "whos" in matlab.
Steven Lord
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
Voss 2021 年 11 月 8 日
My guess would be that the dimensions of matrices DFT and WMI do not agree.
Steven Lord
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
Mostfa Abd El-Aziz 2021 年 11 月 9 日
how to call reshape?

サインインしてコメントする。

回答 (1 件)

yanqi liu
yanqi liu 2021 年 11 月 9 日

0 投票

RGB=real(DFT)+imresize(WMI,[size(DFT,1) size(DFT,2)], 'bilinear');

4 件のコメント

Mostfa Abd El-Aziz
Mostfa Abd El-Aziz 2021 年 11 月 9 日
Error using + Matrix dimensions must agree.
The same error still founded
yanqi liu
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
Mostfa Abd El-Aziz 2021 年 11 月 9 日
It is run good for this code line
but the next code line :
DFT_W=complex(RGB,imag(DFT));
display also an error which : "Error using complex Input arrays must have the same size.""
yanqi liu
yanqi liu 2021 年 11 月 10 日
yes, sir, may be upload mat file to analysis

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeCreating and Concatenating Matrices についてさらに検索

質問済み:

2021 年 11 月 8 日

コメント済み:

2021 年 11 月 10 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by