Evaluate Symbolic Expression in MATLAB Programming


Matlab allows user to create symbolic math expressions. This is useful when user don't want to immediately compute an answer, or when user have a math "formula" to work on but don't know how to "process" it.

Matlab allows symbolic operations several areas including:

  • • Calculus


  • • Linear Algebra


  • • Algebraic and Differential Equations


  • • Transforms (Fourier, Laplace, etc)


These key function in Matlab is used to create a symbolic representation of data is: sym() or syms if user have multiple symbols to make.

Defining Symbolic Expressions

User can define symbolic functions using the sym function command and syms function command. Here is an example for creating a symbolic function for (a*X^2) + (b*x) + c:

>> syms a b c x % define the symbolic math variables

>> f = sym('a*x^2 + b*x + c');

Evaluation of Symbolic Expressions

The keyfunction subs (which stands for substitute) is for replacing symbolic variables with either new symbolic variables or with acutal values. The syntax of the subs function is: subs( symbolic_function, list_of_symbols, list_of_values). Here is an example:

>> f = sym('a*x^2 + b*x + c');

>> subs(f,x,5)

ans =

25 * a + 5 * b + c

>> subs(f,[x a b c],[5 1 2 3])

ans =

38

Plotting Symbolic Function

In Matlab, user can plot a symbolic function over one variable by using the function ezplot function. Here is an example:

>> y = sin(x)

y =

sin(x)

>> ezplot(y)

Matlabsolutions.com provides guaranteed satisfaction with a commitment to complete the work within time. Combined with our meticulous work ethics and extensive domain experience, We are the ideal partner for all your homework/assignment needs. We pledge to provide 24*7 support to dissolve all your academic doubts. We are composed of 300+ esteemed Matlab and other experts who have been empanelled after extensive research and quality check.

Matlabsolutions.com provides undivided attention to each Matlab assignment order with a methodical approach to solution. Our network span is not restricted to US, UK and Australia rather extends to countries like Singapore, Canada and UAE. Our Matlab assignment help services include Image Processing Assignments, Electrical Engineering Assignments, Matlab homework help, Matlab Research Paper help, Matlab Simulink help. Get your work done at the best price in industry.