Array dimensions must match for binary array op. error how to solve this problem thanks for all
You are now following this question
- You will see updates in your followed content feed.
- You may receive emails, depending on your communication preferences.
An Error Occurred
Unable to complete the action because of changes made to the page. Reload the page to see its updated state.
Show older comments
Accepted Answer
Star Strider
on 19 Jun 2019
Apparently ‘InputImage’ does not have the same row, column (and perhaps third-dimension) sizes as ‘ReconstructedImage’.
You have to determine that.
The solution depends on what you want as the end result.
8 Comments
the two images dont have the same size
whats your consedration to solve the error
thanks dear Star Strider
If you want to subtract them, they must have the same sizes.
You could possibly interpolate one to the size of the other, perhaps using the imresize (link) function, however that may not result in an accurate measure of what you are doing, and so an unreliable result. You have to decide how best to resolve this problem.
i have using imresize function but the error still happen
Be sure that both your images have exactly the same row and column sizes, and the same number of dimensions (2 or 3).
how to determine these attributes
thanx alot dear star strider
Thanx alot dear Star Stider to your cooperation with me
The Problem Solved
The Problem was in images dimention
thanks alot
First:
RIsize = size(ReconstructedImage);
IIsize = size(InputImage);
Then, compare them. For images, try this:
Test = @(I1size,I2size) all((I1size(1:2) == I2size(1:2)) & (numel(I1size) == numel(I2size))); % True If Image Dimensions Are The Same
Check = Test(RIsize,IIsize)
Dear Star Strider how to check our images have exactly the same row and column sizes, and the same number of dimensions (2 or 3). ?
More Answers (0)
Categories
Find more on Multidimensional Arrays in Help Center and File Exchange
Tags
See Also
on 19 Jun 2019
on 9 Oct 2020
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
