Is there a method to rearrange symbolic expression in terms of trig function

Viewed 20

Is there a method to rearrange symbolic expression l*sin(B) + d*sin(B) into (l+d)*sin(B) in MATLAB symbolic expression?

I tried to use combine and collect. Both of them don't work the way needed.

The symbolic expression is x = d*sin(B) + l*sin(B), and I want to rearrange it as x = (l+d)*sin(B) in MATLAB live script.

1 Answers

Solution found.

It work as wanted by using collect(d*sin(B) + l*sin(B), sin(B)) rather than collect(d*sin(B)+l*sin(B), l+d).

Related