Thursday, 8 December 2011

Create symbolic variable in matlab | Matlab symbolic variable expression addition,multiplication examples | Evaluate symbolic variables in Matlab

Here we give some notes for matlab symbolic variable creation,expression and evaluation.Symbolic variable are used to design a Mathematical expression with some variables.if you can create Symbolic variable means you must use sym or syms function on Matlab.
Syntax : syms ('var1','var2'........'varn');

above syntax for symbolic variable creation. In below example represent symbolic variable creation and expression with evaluation.
>> syms s % symbolic object name is 's'
>> a = (1+2)/s^2 %symbolic equation generation
a =
3/s^2
>> b = (1+s)/s^2
b =
(1+s)/s^2
Two symbolic variable are addition into one varaible as 'c'.
>> c = a+b;
>> c
c =
3/s^2+(1+s)/s^2

>> subs(c,10)

ans =

0.1400

Finally two symbolic variables added and evaluated.In symbolic variable evaluation using subs function.This function evaluate the object on matlab.finally we got the result.

Kindly Bookmark and Share it:

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...