1
votes

I need to solve this equation for the variable \theta:

enter image description here

using Matlab WITHOUT using symbolic toolbox. The reason for this is that I am compiling the m-file to .Net Assembly and symbolic toolbox can not be used.

I know how to solve it using vpasolve, but as far as I know it needs the variable to be defined using syms.

I appreciate if you can suggest me a method to solve this equation in Matlab without symbolic toolbox.

1
Are the other variables known a priori? If they're not known, then what you ask for is not possible. - rayryeng
yes, as I mentioned in my post the only variable is \theta - NESHOM
The other variables being known a priori was not established in your question, which is why I had to ask. Knowing that they are, the answer by McMa is a perfectly example answer for your application. - rayryeng
thank you for your comment and sorry for that. - NESHOM

1 Answers

3
votes

As @rayryeng said, that is only possible if you know the value of the other variables, is so, you can declare f as an anonymous function and use fsolve() like this:

f=@(x)((cos(x)*sqrt(2^2+3^2)-4*sin(x))/(cos(x)-1)-5/x);
fsolve(f,0.1)

but using your correct values.