Help me to fix the error " Array dimensions must match for binary array op"

回答 (1 件)

Jan
Jan 2017 年 6 月 20 日
編集済み: Jan 2017 年 6 月 20 日
Well, what is your question? You cannot subtract a [240, 432, 3] array from a [720,1280, 3] array. This is not defined mathematically and I cannot guess, what you expect as output. Before you can expect a useful answer, you have to define, what you want to achieve. Perhaps a (linear) interploation (see imresize) of the smaller image to the dimensions of the larger image will help? Or the other way around? Or you want to subtract a part of the image only:
y = rand(720, 1280, 3);
x = rand(240, 432, 3);
r = y(1:240, 1:432, 3) - x
? I assume, as soon as you know, what you want to achieve, the solution is trivial. Therefore I dare to post this as answer, although it does not contain the solution.

2 件のコメント

Dwi Devywinda Jeanette
Dwi Devywinda Jeanette 2017 年 6 月 22 日
Thanks for your answer
Rayankula Srilekha
Rayankula Srilekha 2019 年 2 月 28 日
then what dimensssions we should take

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

カテゴリ

ヘルプ センター および File Exchange で Matrix Indexing についてさらに検索

質問済み:

2017 年 6 月 20 日

コメント済み:

2019 年 2 月 28 日

Community Treasure Hunt

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

Start Hunting!

Translated by