Specifically, I want to do this so that I can grab the coefficients of the expression. It's a simple conceptual question but I really have no clue how to go about it in code. Right now, I can just look at the symbolic expression in the workspace and get what I am looking for just by inspection, but I'd have to do this every time I change the variables and if I wanted to use that coefficient for anything else I would have to manually assign the value. Here's what I am trying to do:
Z = 50 - 25cos(3x+3*pi/2);
Val1 = 3;
Val2 = 3*pi/2;
Val1 and Val2 correspond to values that I need for other calculations, and I can see them from fitting the equation to one of a general form. Is there any way to do this without having to type their values?