-1

Hello I am new to matlab I have problem solving this simple expression

 r=10*sin(10)+10*cos(y);

This expression is basically a result of the simple integeral equation I coded but now I am unable to solve this equation what i want is to simplify and the answer should look like

 r=-5.440+10*cos(y);

1 Answers1

1

The symbolic toolbox can do this:

syms y                   % Declare symbolic variable y
r=10*sin(10)+10*cos(y);
simplify(r)              % Simplify expression

Note that, for precision, you will get the answer as a fraction:

10*cos(y) - 3062566590353811/562949953421312

You can use the vpa command to represent this as a single number:

vpa(simplify(r) )

With the result:

10.0*cos(y) - 5.4402111088936973004592800862156
devrobf
  • 6,973
  • 2
  • 32
  • 46