MATLAB Answers


Undefined function or method 'matrix' for input arguments of type 'double'.

Asked by Mario
on 1 Apr 2013

Hi there!

I have a problem when trying to solve a system of equations inside a loop like this:

 for j=1:iter
    syms a positive b positive %a^2=sin(theta1); b^2=cos(theta2)
    [solucion_a, solucion_b]=solve(L1*a^2-H-L2*sqrt(1-b^4)+cos(omega*t), L1*sqrt(1-a^4)-V+L2*b^2+sin(omega*t),a,b);

Every single data is correct, except for V. When I do


where Maximo_valor_V is a number previously calculated, everything works propoerly. However, if I do


where iter is a number and j comes from the statement of the loop, it occurs this error:

 ??? Error using ==> eval
Undefined function or method 'matrix' for input arguments of type 'double'.
 Error in ==> Sist_Ecuaciones_valido at 90

In both cases, the data V is given inside the loop. Please, may anyone help me out?

Thanks, Mario



No products are associated with this question.

2 Answers

Answer by Walter Roberson
on 1 Apr 2013
 Accepted answer

Do not eval() a symbolic expression. eval() is only for MATLAB code, and symbolic expressions are MuPAD rather than MATLAB.

You should research subs()


Answer by Mario
on 2 Apr 2013

Thanks a lot. That was quite helpful!!


Join the 15-year community celebration.

Play games and win prizes!

Learn more
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

MATLAB Academy

New to MATLAB?

Learn MATLAB today!