MATLAB: How to replace equations in symbolic function

MATLABreplacevariables

Good Morning,
Please I have a function F = 3*a*b
Therefore how can i change (a*b) with a variable 'x' to obtain F = 3*x
Think you.

Best Answer

By using subs function:
syms a b x
F=3*a*b;
Fnew=subs(F,{a,b},{x,1})