MATLAB: I would add one variable inside function

symbolicSymbolic Math Toolboxsyms

I have x(t) and I would to create x(t+ta) by matlab code. For example
if I have x(t)= 2t+3 , I need to create x(t+ta)= 2t+2ta+3 and so on.
Please consider x(t)=5sin(2t+theta), and x(t+ta)=5sin(2t+2ta+theta) for your explaintion.
Thank you in advance.

Best Answer

Read about subs() :
syms a t theta
x(t)=5*sin(2*t+theta);
subs(x(t)*x(t+a),{t,a,theta},{1,2,3}) % t with value one ,a with 2 and theta 3 are example values