Preference of outputting sine function

Hello, can anybody help me with this:
sympref('FloatingPointOutput',true);
syms theta
F=2*sind(2*theta)
--------------------------
F =
2*sin(0.0349*theta)
--------------------------
I want the sine function to be sine in degrees in the output, I don't want the program to automatically convert it to radians.. Can anyone help ?
Thanks !!

댓글 수: 5

Matt J
Matt J 2020년 12월 25일
Isn't 2*sin(0.0349*theta) equivalent to 2*sind(2*theta)? I don't see the problem.
Ahmad Madkhanah
Ahmad Madkhanah 2020년 12월 25일
I want the form of the answer to be in sind and not in sin
That's my problem
It looks easy here but I have longer statements and functions, if I could get sind function in the output in would help me a lot..
Matt J
Matt J 2020년 12월 25일
Is it just an aesthetic preference? What would be the practical benefit of having things expressed in terms of sind?
No, I just don't wanna have to multiply every theta with 180/pi
Assume I have this:
sympref('FloatingPointOutput',true);
syms w
syms m
syms r
syms L
syms theta
alpha=input('Enter the angle alpha: ');
F1=m*r*w^2*(cosd(theta+alpha)+r/L*cosd(2*theta+2*alpha));
F1=simplify(F1,'Steps',10);
disp(F1)
---------------------------
Enter the angle alpha: 45
m*r*w^2*(cos(0.0175*theta + 0.7854) + (r*cos(0.0349*theta + 1.5708))/L)
---------------------------
I should get an answer like this: F1=m*r*w^2*(0.707*(cosd(theta) - sind(theta)) - r/L*sind(2*theta))
How can I get the to the closest form of this answer ?
the case might require a theta input too, how could I get an expression that is valid for these cases too ?
Ahmad Madkhanah
Ahmad Madkhanah 2020년 12월 25일
The answer is for machine dynamics class, so also yes, the form of the answer matters a bit..

댓글을 달려면 로그인하십시오.

답변 (0개)

제품

릴리스

R2019b

태그

질문:

2020년 12월 25일

댓글:

2020년 12월 25일

Community Treasure Hunt

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

Start Hunting!

Translated by