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:
??? Error using ==> mtimes Inner matrix dimensions must agree.

Subject: ??? Error using ==> mtimes Inner matrix dimensions must agree.

From: amir

Date: 20 Apr, 2011 08:35:46

Message: 1 of 2

I am new to Matlab and I am trying to calculate Matric function. But
When the parameter Value exceed 9, the problem appeared!!

??? Error using ==> mtimes
Inner matrix dimensions must agree.

Error in ==> FEM_TEST2>K_Calculation_Callback at
185
y = E*A/(sqrt((x2-x1)*(x2-x1) +
(y2-y1)*(y2-y1)))*[C*C C*S -C*C -C*S ; C*S S*S -C*S
-S*S ;

Error in ==> gui_mainfcn at 96
        feval(varargin{:});

Error in ==> FEM_TEST2 at 42
    gui_mainfcn(gui_State, varargin{:});

Error in ==>
@(hObject,eventdata)FEM_TEST2('K_Calculation_Callback',hObject,eventdata,guidata(hObject))


??? Error while evaluating uicontrol Callback

Subject: ??? Error using ==> mtimes Inner matrix dimensions must agree.

From: Wayne King

Date: 20 Apr, 2011 10:27:05

Message: 2 of 2

amir <aizuddin0943@gmail.com> wrote in message <290bcece-1f38-4de5-a371-77a348d3a2e9@l14g2000pre.googlegroups.com>...
> I am new to Matlab and I am trying to calculate Matric function. But
> When the parameter Value exceed 9, the problem appeared!!
>
> ??? Error using ==> mtimes
> Inner matrix dimensions must agree.
>
> Error in ==> FEM_TEST2>K_Calculation_Callback at
> 185
> y = E*A/(sqrt((x2-x1)*(x2-x1) +
> (y2-y1)*(y2-y1)))*[C*C C*S -C*C -C*S ; C*S S*S -C*S
> -S*S ;
>
> Error in ==> gui_mainfcn at 96
> feval(varargin{:});
>
> Error in ==> FEM_TEST2 at 42
> gui_mainfcn(gui_State, varargin{:});
>
> Error in ==>
> @(hObject,eventdata)FEM_TEST2('K_Calculation_Callback',hObject,eventdata,guidata(hObject))
>
>
> ??? Error while evaluating uicontrol Callback

Hi, This error indicates that somewhere your matrices (and/or vectors) are not conformable. For example,

 A = randn(3,2);
 B = randn(3,2);
 A*B
??? Error using ==> mtimes
Inner matrix dimensions must agree.

You should put a breakpoint in your code where the calculation of y occurs and determine what the sizes are of the variables included there are.


Wayne

Tags for this Thread

No tags are associated with 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