Extremely basic question for MATLAB's solve()

  • MATLAB
  • Thread starter BilalX
  • Start date
7
0

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?
 

Answers and Replies

155
0
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.
 
1
0
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.
 

Related Threads for: Extremely basic question for MATLAB's solve()

  • Last Post
Replies
1
Views
3K
  • Last Post
Replies
2
Views
1K
  • Last Post
Replies
10
Views
3K
Replies
1
Views
3K
  • Last Post
Replies
4
Views
5K
Replies
1
Views
3K
Replies
4
Views
2K
Top