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
Empty Vectors: An empty vector or in another words, a vector which stores no values, can be generated using the empty square brackets: >> evec = [] evec = [] >> lengt

5 p2+8p+15, 3 p2-3p-18, 12 p2-p-30

Illustration of Empty vectors: The Empty vectors can also be used to delete elements from the arrays. For illustration, to remove the third element from array, an empty vector

Example of Recursive functions: This definition is recursive as a factorial is defined in terms of the other factorial. There are two parts to any recursive definition: the co

Illustrations of Variable number of output arguments: In the illustrations shown here, the user should actually know the type of the argument in order to establish how many va

Illustration of Advanced file input and output: For illustration, to refer to the third number in the first element of the cell array: >> subjdata{1}(3) ans =

sprintf function: The sprintf function works precisely like the fprintf function, but rather than printing it generates a string. Here are some illustrations in which the outp

Illustration of Labels and prompts: The program below prompts the user for endpoints (x1, y1) and (x2, y2) of a line segment, and computes the midpoint of the line segment, th

Functions to create special matrices: The MATLAB also has various functions which create special matrices. For illustration, the zeros function generates a matrix of all zeros

Find Minimum and Maximum for each row To find the maximum (or minimum) for each row, the dimension of 2 (that is how a MATLAB refers to rows) can be identified as the third arg