MATLAB: How to display the symbolic rational answer as a number

rational fractional numerical answer result

Hello. I have a problem with my code. It gives a rational expression. E.g.: 1/2 instead of 0.5. I tried floor, format, rats commands but no cure.
syms VA1(RD1); %RD1 is a parameter of VA1
VCC=5; %VCC=5
RF=58.7*10^3; %RF=58.7Kohms
RS=27.28*10^3; %RS=27.28Kohms
VA1=VCC*((RF/(RF+RD1))-(RS/(RS+RD1))); %The equation of VA1
dVA1=diff(VA1); %dVA1= derivative of VA1
RD1=abs(solve(dVA1==0)); %solve dVA1=0 and find the absolute value of RD1
RD1=RD1(1)%RD1=Positive root of RD1
VA1=VCC*((RF/(RF+RD1))-(RS/(RS+RD1))) %Substitute the RD1 value in the equation
VA1max=VCC*(RF/(RF+RD1)) %Maximum output voltage value
VA1min=VCC*(RS/(RS+RD1)) %Minimum output voltage value

Best Answer

Have you tried the vpa function? It should do what you want.
For example:
RD1 = vpa(RD1,5)
produces:
RD1 =
40017.0