matlabsymbolic-math

Solve equation without using symbolic toolbox in Matlab


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.


Solution

  • 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.