Why does vpasolve fail when I try to use sind() in my equation to be solved numerically?
2 ビュー (過去 30 日間)
古いコメントを表示
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.
0 件のコメント
回答 (2 件)
John D'Errico
2016 年 4 月 14 日
Is it really that difficult to write this
sin(D*pi/180)
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. :)
3 件のコメント
John D'Errico
2016 年 4 月 16 日
編集済み: John D'Errico
2016 年 4 月 16 日
Do some versions of MATLAB charge by the number of characters you type? :) Must be so.
Hey the good news is, there are probably some coding jobs that pay by the number of characters typed, as that clearly means one is doing a great deal of work if they are typing a lot.
And, hey, back when I was a kid, we did not have computers, or even pencils. I had to write my own homework using my own blood, pricked from my finger. My slide rule was two sticks, of roughly the same lengths, where I had chiseled marks along the length using a log scale. Some kids had an abacus, but I only had a chunk of board, with some pebbles I picked up from the ground. Then I got a computer, but it was the kind where you had to turn a crank on the side. So be happy that you have a sin function at all. :) :)
Walter Roberson
2016 年 4 月 16 日
Wow, do you still have that cranked computer? Those are valuable antiques now!
Walter Roberson
2016 年 4 月 15 日
You can always define sind locally
sind = @(D) sin(D*sym('pi')/sym(180))
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Symbolic Math Toolbox についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!