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: 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

Refer the subset of a matrix: It is also possible to refer to the subset of a matrix. For illustration, this refers to the first & second rows, second & third columns: >> m

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

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).

Changing Dimensions: In addition to transpose operator, the MATLAB has some built-in functions which change the dimensions or configuration of matrices, involving fliplr, resh

Writing to Files: There are many lower level functions which can write to files. We will focus on the fprintf function that can be used to write a file and also to append to a

Sorting The Sorting is a process of putting a list in order; either in descending (maximum to minimum), or ascending (minimum to maximum) order. For illustration, here is a li

Referring to and Modifying the Matrix Elements: To refer to matrix elements, the row and then the column indices are given in parentheses (always the row index initially and t

Function xlsread - file function: The function xlsread will read from the spreadsheet file. For illustration, to read from file just generated: >> ssnums = xlsread('ranexc

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