Symbolic expression, MATLAB in Mathematics

Symbolic Expression

The solve function solves an equation and returns the solution(s) as symbolic expressions. The answer can be converted to numbers by using any numeric function, like double:

>> x = sym('x');

>> solve('2*x^2 + x = 6')

ans =

3/2

   -2

>> double(ans)

ans =

      1.5000

    -2.0000

When an expression is passed to the solve function instead of an equation, it will set the expression equivalent to 0 and solve the resulting equation. For illustration, this will solve

3x2 + x = 0:

>> solve('3*x^2 + x')

ans =

       0

 

 -1/3

Posted Date: 10/22/2012 6:46:39 AM | Location : United States







Related Discussions:- Symbolic expression, Assignment Help, Ask Question on Symbolic expression, Get Answer, Expert's Help, Symbolic expression Discussions

Write discussion on Symbolic expression
Your posts are moderated
Related Questions
Illustration of logical built-in functions: The function find returns the indices of a vector which meet certain criteria. For illustration, to find all the elements in a vect

bar and barh functions: For a matrix, the bar and barh functions will group altogether the values in each and every row. The illustration is as shown: rm = randint(2,4,[1

Use of logical vector: Determine how many elements in the vector vec were greater than 5, the sum function can be used on the resulting vector isg: >> sum(isg) ans =

Illustration of Minimum and Maximum Value Both of these functions also return the index of the minimum or maximum value; when there is more than one occurrence, it returns the

Symbolic Expression The solve function solves an equation and returns the solution(s) as symbolic expressions. The answer can be converted to numbers by using any numeric funct

Strings as matrix: The matrix can be generated, that consists of strings in each row. Therefore, essentially it is created as a column vector of strings, but the final result

Give the formula for a rational function that has a hole at x=7 & vertical asmptote at x=-3/2

Strcat function - Concatenation : The strcat function, though, will eliminate the trailing blanks from strings before concatenating. Note that in these illustrations, the trail

Built-in functions for Complex numbers:   We know that in MATLAB both i and j are built-in functions which return √-1 (therefore, they can be thought of as built-in constants).

fprintf function - File function: The fprintf function really returns the number of bytes which was written to the file, therefore if you do not want to see that number, suppr