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
Error-checking for integers: illustrations of running this script as shown below: >> readoneint Enter an integer: 9.5 Invalid! Enter an integer: 3.6 Invalid

Labels and Prompts: The script loads all the numbers from file into a row vector. It then splits the vector; it stores the initial element that is the experiment number in a v

Illustration of Variance For illustration, for the vector [4, 6, 1, 5], there are n = 4 values therefore n - 1 is 3. The mean of this data set is also 4. The variance will be

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

how can reconstruct just part of an image using imreconstruct?

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

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

Error-Checking for Integers: As MATLAB uses the type double by default for all the values, to check to make confirm that the user has entered an integer, the program have to c

Example of Minimum and Maximum Value For matrices, the functions min and max operate column wise by the default: >> mat = randint(2,4,[1 20]) mat =    9   10   1

Three-dimensional pie and bar: For the bar3 function, x & y vectors are passed and the function displays three-dimensional bars as shown in figure: Figure: Three-dimen