clc clear all disp('PURPOSE') disp(' Show how to use symbolic characters') disp('EXAMPLES') % using symbolic ops disp('Example 1 - Symbolic operations') syms t r s % t r and s are now symbolic varibles a =t^2+r; y =t^3+a+s; eqn=char(y); %char will convert the equation to a string fprintf(' The symbolic equation is\n %s\n\n',eqn) % using the inline command % inline function is y(t)=t^2+7t+9 disp('Example 2 - The inline command') y =inline('t^2+7*t+9'); yeqn=char(y); % find the value of y(a) using the inline notation % a=4 a=4; ya=y(a); fprintf(' The function is: y(t)=%s\n',yeqn) fprintf(' y(%g)=%g\n\n',a,ya)