フィルターのクリア

How to use trignometric functions in the symbolic toolbox

1 回表示 (過去 30 日間)
Muhammad Waqar
Muhammad Waqar 2013 年 10 月 10 日
コメント済み: Muhammad Waqar 2013 年 10 月 11 日
Hi!
I know that symbolic toolbox can evaluate the functions when the symbols are assigned their respective values however when i use the trignometric function, the evaluation comes as following rather than a number
e.g. Let J(thetha1,theta2,theta3) = sin(theta1 - theta2)/3 - cos(theta1 - theta3) - cos(theta1 - theta2) + sin(theta1 - theta3)/3;
now equating theta1,theta2 and theta3 values the answer comes out to be - cos(10) - cos(20) - sin(10)/3 - sin(20)/3
however when i type the above answer in the editor the value comes out to be 0.308. How can i solve this problem?
Thanks and regards, Muhammad Waqar Ahmed

回答 (1 件)

Walter Roberson
Walter Roberson 2013 年 10 月 10 日
It is not clear which of the two you consider to be the problem.
If you want a floating point resolution of the formula, use double() on the symbolic formula.
Caution: cos(10) means cosine of 10 radians, not 10 degrees.
  1 件のコメント
Muhammad Waqar
Muhammad Waqar 2013 年 10 月 11 日
yes i want the answer to be numeric or floating point resolution as you said and yes i am aware that the angle is in radians for trignometric functions.

サインインしてコメントする。

製品

Community Treasure Hunt

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

Start Hunting!

Translated by