Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
minus Matrix dimensions

Subject: minus Matrix dimensions

From: fereshte

Date: 9 May, 2014 16:15:12

Message: 1 of 2

i'm trying to plot contourlet code but i'm getting this error:
 Error using ==> minus Matrix dimensions must agree.
this code run for image with 255*255 or 512*512 in size.my image is 47*106.
please help me.

Subject: minus Matrix dimensions

From: Steven Lord

Date: 9 May, 2014 17:26:42

Message: 2 of 2


"fereshte " <serena.bme85@yahoo.com> wrote in message
news:lkiuuf$ekf$1@newscl01ah.mathworks.com...
> i'm trying to plot contourlet code but i'm getting this error:
> Error using ==> minus Matrix dimensions must agree.
> this code run for image with 255*255 or 512*512 in size.my image is
> 47*106.
> please help me.
>

When you compute A-B, if A and B are numeric arrays, then one or both of the
following relationships about their sizes MUST hold:

1) A and B are EXACTLY the same size. In this case, the result will be the
same size as A and B.
2) One of A and B are scalar (1-by-1.) In this case, the result will be the
size of the non-scalar (or the result will be scalar if they're both 1-by-1,
but that falls into rule 1.)

[Note that if one or both of them are objects, these rules may not apply as
the author(s) of the classes involved can define MINUS to work however they
want.]

In the situation where you receive that error, the two arrays you're trying
to subtract are not the same size and neither is scalar.

If you show the group a SMALL segment of code with which you can reproduce
the problem then maybe someone can offer suggestions on how to correct it.

--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us