Why does vpasolve fail when I try to use sind() in my equation to be solved numerically?

2 views (last 30 days)
I want to get some numerical solutions for an equation that I have at various values of parameters. My expression to be solved includes sines and cosines. I came across the help page for vpasolve, here:
The second example even includes a function with cos() in it. However, I wanted to express my arguments in degrees rather than radians. So I used sind() and cosd() functions, but it failed. It gave me an error about undefined function "sind". If I revert to sin() and cos() functions and express my argument as radians, it works. Why is this? Does Matlab not know how to convert a "regular" number into degrees at the end? Or what? My objective was to extract a value for degrees (or radians) that would satisfy the equation.

Answers (2)

John D'Errico
John D'Errico on 14 Apr 2016
Is it really that difficult to write this
instead of sind(D)? Yes, it would be nice if the symbolic TB recognized sind. Maybe that will happen in a future release. Until then, you will just be forced to type a few extra characters. Life is tough. :)

Sign in to comment.

Walter Roberson
Walter Roberson on 15 Apr 2016
You can always define sind locally
sind = @(D) sin(D*sym('pi')/sym(180))

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!