MATLAB: Help on trigonometric operations using syms variable.

symbolic

I'm performing trigonometric operations on a syms variable 't4'.
The input is:
sind(t4-90)
The output that I'm getting is 'sin(pi*(t4-90)/180)'. How do I get it displayed in terms of 'cos' instead? I wish to get the answer in a simplified form.
Thanks!

Best Answer

You probably need to use rewrite.
syms t4
S = sind(t4-90)
S =
sin((pi*(t4 - 90))/180)
rewrite(expand(S),'sincos')
ans =
-cos((pi*t4)/180)
I did need to expand the extrpession to get rewrite to work.
rewrite(expand(S),'cos')
would also have worked.
rewrite was introduced in R2012a, so most people should have it.