79074254

Date: 2024-10-10 11:52:30
Score: 0.5
Natty:
Report link

I realised my mistake. Writing the answer here in case other might encounter the same issue.

I didn't set a variable to the equation.

using the same problem as above:

sol=solve(x*sin(20)==5000)

still gives the output:

warning: passing floating-point values to sym is dangerous, see "help sym"
warning: called from
    double_to_sym_heuristic at line 50 column 7
    sym at line 379 column 13
    mtimes at line 54 column 5

sol = (sym)

  7106000
  ───────
   413⋅π

If I write sol it provides with the following output:

>> sol
sol = (sym)

  7106000
  ───────
   413⋅π

However. If I write this

>> double(sol)
ans = 5476.8

Which means that I can now set a variable to it and use it for further equations.

Like this:

>> z = double(sol)
z = 5476.8

Which means that z is now the value I wanted in the first place.

>> z
z = 5476.8
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Michael L