# Extremely basic question for MATLAB's solve()

• MATLAB

## Main Question or Discussion Point

Hello,

Although I recently had a MATLAB class it didn't really touch on variable types or use of the solve() function, and now I'm stumped on an embarrassingly basic problem; I'm trying to solve an equation in this form, with the other variables defined as doubles:

solve('Dy*sin(Cy*atan(By*alpha1-Ey*(By*alpha1-atan(By*alpha1))))+Svy=2131','alpha1')

This returns an "Explicit solution could not be found" warning and an empty answer set. From what I've been able to gather, the command attempts to solve the equation symbolically, and it works fine when I manually replace the variables with their numerical values, e.g:

solve('2119.16*sin(1.2739*atan(11.981*alpha1-0.0012*(11.981*alpha1-atan(11.981*alpha1))))+27.6617=2131','alpha1')

Could anyone tell me how to make the command work without having to explicitly enter the numerical values?

Related MATLAB, Maple, Mathematica, LaTeX News on Phys.org
I think they use two different tool boxes, so they cant really be mashed together. I tried to do this the other day but couldnt.

Any solutions for this issue?

perhaps a bit late, but I have an answer to your question. as I was looking into it myself and needed an answer as well.
You can use the subs command to enter your variables.

DyS = some formula
ByS =
SvyS =
EyS =
CyS =

Eq='Dy*sin(Cy*atan(By*alpha1-Ey*(By*alpha1-atan(By*alpha1))))+Svy=2131';

subs(Eq,Dy,DyS);
subs(Eq,By,ByS);
subs(Eq,Svy,SvyS);
subs(Eq,Ey,EyS);
subs(Eq,Cy,CyS);

solve(Eq,'alpha1')
% or [alpha1] = solve(Eq,'alpha1')

There may be a more elegant solution, but this works.