An object that represents a symbolic expression in Mathematica. More...

Inheritance diagram for SymExpression:
[legend]

Public Member Functions

 SymExpression (x, varargin)
 The class constructor function. More...
 
function  delete ()
 object destruction function More...
 
function  display (namestr)
 Display the symbolic expression. More...
 
function y = argnames ()
 Symbolic function input variables ARGNAMES(F) returns a sym array [X1, X2, ... ] of symbolic variables for F(X1, X2, ...). More...
 
function x = formula ()
 Symbolic expression formula body FORMULA(F) returns the definition of symbolic function F as a sym object expression. More...
 
function x = symbol ()
 Symbolic expression symbol string SYMBOL(F) returns the symbolc string of symbolic expression F as a sym object expression. More...
 
function y = privToCell ()
 
function y = length ()
 The length of the symbolic vector LENGTH(X) returns the length of vector X. It is equivalent to MAX(SIZE(X)) for non-empty arrays and 0 for empty ones. More...
 
function varargoutsize ()
 The size of the symbolic expression tensor. More...
 
function status = islist ()
 Check if the symbolic expression is a scalar (non-list) More...
 
function X = first ()
 
function B = uminus ()
 ------------— Arithmetic --------------— Symbolic negation. More...
 
function B = uplus ()
 Unary plus. More...
 
function X = plus (B)
 Symbolic plus operation. More...
 
function X = minus (B)
 Symbolic minus operation. More...
 
function X = times (B)
 Symbolic array multiplication. TIMES(A,B) overloads symbolic A .* B. More...
 
function X = mtimes (B)
 Symbolic matrix multiplication. MTIMES(A,B) overloads symbolic A * B. More...
 
function B = mpower (p)
 Symbolic matrix power. MPOWER(A,p) overloads symbolic A^p. More...
 
function B = power (p)
 Symbolic array power. POWER(A,p) overloads symbolic A.^p. More...
 
function X = rdivide (B)
 Symbolic array right division. RDIVIDE(A,B) overloads symbolic A ./ B. More...
 
function X = ldivide (B)
 Symbolic array left division. LDIVIDE(A,B) overloads symbolic A . B. More...
 
function X = mrdivide (B)
 / Slash or symbolic right matrix divide. A/B is the matrix division of B into A, which is roughly the same as A*INV(B) , except it is computed in a different way. More precisely, A / B = (B \ A)'. See SYM/MLDIVIDE for details. Warning messages are produced if X does not exist or is not unique. Rectangular matrices A are allowed, but the equations must be consistent; a least squares solution is not computed. More...
 
function X = mldivide (B)
 Symbolic matrix left division. MLDIVIDE(A,B) overloads symbolic A \ B. X = A \ B solves the symbolic linear equations A*X = B. Warning messages are produced if X does not exist or is not unique. Rectangular matrices A are allowed, but the equations must be consistent; a least squares solution is not computed. More...
 
function B = transpose ()
 Symbolic matrix transpose. TRANSPOSE(A) overloads symbolic A.' . More...
 
function B = ctranspose ()
 Symbolic matrix complex conjugate transpose. CTRANSPOSE(A) overloads symbolic A' . More...
 
function B = inv ()
 Symbolic matrix inverse. INV(A) computes the symbolic inverse of A INV(VPA(A)) uses variable precision arithmetic. More...
 
function y = eq (B)
 Symbolic equality test. EQ(A,B) overloads symbolic A == B. If A and B are integers, rational numbers, floating point values or complex numbers then A == B compares the values and returns true or false. Otherwise A == B returns a sym object of the unevaluated equation which can be passed to other functions like solve. To force the equation to perform a comparison call LOGICAL or isAlways. LOGICAL will compare the two sides structurally. isAlways will compare the two sides mathematically. More...
 
function y = ne (B)
 NE Symbolic inequality test. NE(A,B) overloads symbolic A ~= B. The result is the opposite of A == B. More...
 
function C = subsasgn (Idx, R)
 Subscripted assignment for a sym array. C = SUBSASGN(L,Idx,R) is called for the syntax L(Idx)=R. Idx is a structure array with the fields: type – string containing () specifying the subscript type. Only parenthesis subscripting is allowed. subs – Cell array or string containing the actual subscripts. More...
 
function B = subsref (Idx)
 Subscripted reference for a sym array. B = SUBSREF(A,S) is called for the syntax A(I). S is a structure array with the fields: type – string containing () specifying the subscript type. Only parenthesis subscripting is allowed. subs – Cell array or string containing the actual subscripts. More...
 
function y = end (varargin)
 Last index in an indexing expression for a sym array. END(A,K,N) is called for indexing expressions involving the sym array A when END is part of the K-th index out of N indices. For example, the expression A(end-1,:) calls A's END method with END(A,1,2). More...
 
function X = double ()
 Converts symbolic matrix to MATLAB double. DOUBLE(S) converts the symbolic matrix S to a matrix of double precision floating point numbers. S must not contain any symbolic variables, except eps. More...
 
function M = char ()
 Convert scalar or array sym to string. CHAR(A) returns a string representation of the symbolic object A in MuPAD syntax. More...
 
function [ SymExpression obj , file , SymExpression obj ] = load (char file_path, file,SymExpression obj, varargin,SymExpression obj,char file_path, file)
 load the saved symbolic expression from a wolframe MX file More...
 

Protected Attributes

char f
 The body (or formula) of the symbolic expression. More...
 
char s
 The symbol that represents the symbolic expression. More...
 

Additional Inherited Members

- Public Attributes inherited from handle
 addlistener
 Creates a listener for the specified event and assigns a callback function to execute when the event occurs. More...
 
 notify
 Broadcast a notice that a specific event is occurring on a specified handle object or array of handle objects. More...
 
 delete
 Handle object destructor method that is called when the object's lifecycle ends. More...
 
 disp
 Handle object disp method which is called by the display method. See the MATLAB disp function. More...
 
 display
 Handle object display method called when MATLAB software interprets an expression returning a handle object that is not terminated by a semicolon. See the MATLAB display function. More...
 
 findobj
 Finds objects matching the specified conditions from the input array of handle objects. More...
 
 findprop
 Returns a meta.property objects associated with the specified property name. More...
 
 fields
 Returns a cell array of string containing the names of public properties. More...
 
 fieldnames
 Returns a cell array of string containing the names of public properties. See the MATLAB fieldnames function. More...
 
 isvalid
 Returns a logical array in which elements are true if the corresponding elements in the input array are valid handles. This method is Sealed so you cannot override it in a handle subclass. More...
 
 eq
 Relational functions example. See details for more information. More...
 
 transpose
 Transposes the elements of the handle object array. More...
 
 permute
 Rearranges the dimensions of the handle object array. See the MATLAB permute function. More...
 
 reshape
 hanges the dimensions of the handle object array to the specified dimensions. See the MATLAB reshape function. More...
 
 sort
 ort the handle objects in any array in ascending or descending order. More...
 

Detailed Description

An object that represents a symbolic expression in Mathematica.

Copyright (c) 2016-2017, AMBER Lab All right reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted only in compliance with the BSD 3-Clause license, see http://www.opensource.org/licenses/bsd-license.php

Constructor & Destructor Documentation

◆ SymExpression()

SymExpression.SymExpression (   x,
  varargin 
)
inline

The class constructor function.

Parameters
xit could be one of the followings:
  • SymExpression: it will copy one SymExpression object to antother
  • numeric: create a numeric symbolic expression
  • char: create symbolic expression specified by x
Required fields of x:

Referenced by SymVariable.subsref(), and SymVariable.SymVariable().

Member Function Documentation

◆ argnames()

function y = SymExpression.argnames ( )
inline

Symbolic function input variables ARGNAMES(F) returns a sym array [X1, X2, ... ] of symbolic variables for F(X1, X2, ...).

◆ char()

function M = SymExpression.char ( )
inline

Convert scalar or array sym to string. CHAR(A) returns a string representation of the symbolic object A in MuPAD syntax.

Note
This method has the MATLAB method attribute Hidden set to true.
matlab documentation of method attributes.

◆ ctranspose()

function B = SymExpression.ctranspose ( )
inline

Symbolic matrix complex conjugate transpose. CTRANSPOSE(A) overloads symbolic A' .

Example
[a b; 1-i c]' returns [ conj(a), 1+i] [ conj(b), conj(c)].
See also
SYM/TRANSPOSE.

◆ delete()

function SymExpression.delete ( )
inline

object destruction function

◆ display()

function SymExpression.display (   namestr)
inline

Display the symbolic expression.

◆ double()

function X = SymExpression.double ( )
inline

Converts symbolic matrix to MATLAB double. DOUBLE(S) converts the symbolic matrix S to a matrix of double precision floating point numbers. S must not contain any symbolic variables, except eps.

See also
SYM, VPA.
Note
This method has the MATLAB method attribute Hidden set to true.
matlab documentation of method attributes.

◆ end()

function y = SymExpression.end (   varargin)
inline

Last index in an indexing expression for a sym array. END(A,K,N) is called for indexing expressions involving the sym array A when END is part of the K-th index out of N indices. For example, the expression A(end-1,:) calls A's END method with END(A,1,2).

See also
SYM.
Note
This method has the MATLAB method attribute Hidden set to true.
matlab documentation of method attributes.

◆ eq()

function y = SymExpression.eq (   B)
inline

Symbolic equality test. EQ(A,B) overloads symbolic A == B. If A and B are integers, rational numbers, floating point values or complex numbers then A == B compares the values and returns true or false. Otherwise A == B returns a sym object of the unevaluated equation which can be passed to other functions like solve. To force the equation to perform a comparison call LOGICAL or isAlways. LOGICAL will compare the two sides structurally. isAlways will compare the two sides mathematically.

See also
SYM/LOGICAL, SYM/isAlways
Required fields of B:

◆ first()

function X = SymExpression.first ( )
inline

◆ formula()

function x = SymExpression.formula ( )
inline

Symbolic expression formula body FORMULA(F) returns the definition of symbolic function F as a sym object expression.

◆ inv()

function B = SymExpression.inv ( )
inline

Symbolic matrix inverse. INV(A) computes the symbolic inverse of A INV(VPA(A)) uses variable precision arithmetic.

Examples
Suppose B is [ 1/(2-t), 1/(3-t) ] [ 1/(3-t), 1/(4-t) ]

Then inv(B) is [ -(-3+t)^2*(-2+t), (-3+t)*(-2+t)*(-4+t) ] [ (-3+t)*(-2+t)*(-4+t), -(-3+t)^2*(-4+t) ]

◆ islist()

function status = SymExpression.islist ( )
inline

Check if the symbolic expression is a scalar (non-list)

◆ ldivide()

function X = SymExpression.ldivide (   B)
inline

Symbolic array left division. LDIVIDE(A,B) overloads symbolic A . B.

See also
SYM/RDIVIDE, SYM/MRDIVIDE, SYM/MLDIVIDE, SYM/QUOREM.
Required fields of B:

◆ length()

function y = SymExpression.length ( )
inline

The length of the symbolic vector LENGTH(X) returns the length of vector X. It is equivalent to MAX(SIZE(X)) for non-empty arrays and 0 for empty ones.

See also
NUMEL, SIZE

◆ load()

function SymExpression obj = SymExpression.load ( char  file_path,
  file,
SymExpression  obj,
  varargin,
SymExpression  obj,
char  file_path,
  file 
)

load the saved symbolic expression from a wolframe MX file

Parameters
file_paththe path to export the file
filenamethe (full) file name of exported file
objthe expressions other than the main object
Note
This method has the MATLAB method attribute Hidden set to true.
matlab documentation of method attributes.

◆ minus()

function X = SymExpression.minus (   B)
inline

Symbolic minus operation.

Required fields of B:

◆ mldivide()

function X = SymExpression.mldivide (   B)
inline

Symbolic matrix left division. MLDIVIDE(A,B) overloads symbolic A \ B. X = A \ B solves the symbolic linear equations A*X = B. Warning messages are produced if X does not exist or is not unique. Rectangular matrices A are allowed, but the equations must be consistent; a least squares solution is not computed.

See also
SYM/MRDIVIDE, SYM/LDIVIDE, SYM/RDIVIDE, SYM/QUOREM.
Required fields of B:

◆ mpower()

function B = SymExpression.mpower (   p)
inline

Symbolic matrix power. MPOWER(A,p) overloads symbolic A^p.

Example; A = [x y; alpha 2] A^2 returns [x^2+alpha*y x*y+2*y; alpha*x+2*alpha alpha*y+4].

Required fields of p:

◆ mrdivide()

function X = SymExpression.mrdivide (   B)
inline

/ Slash or symbolic right matrix divide. A/B is the matrix division of B into A, which is roughly the same as A*INV(B) , except it is computed in a different way. More precisely, A / B = (B \ A)'. See SYM/MLDIVIDE for details. Warning messages are produced if X does not exist or is not unique. Rectangular matrices A are allowed, but the equations must be consistent; a least squares solution is not computed.

See also
SYM/MLDIVIDE, SYM/RDIVIDE, SYM/LDIVIDE, SYM/QUOREM.
Required fields of B:

◆ mtimes()

function X = SymExpression.mtimes (   B)
inline

Symbolic matrix multiplication. MTIMES(A,B) overloads symbolic A * B.

Required fields of B:

◆ ne()

function y = SymExpression.ne (   B)
inline

NE Symbolic inequality test. NE(A,B) overloads symbolic A ~= B. The result is the opposite of A == B.

Required fields of B:

◆ plus()

function X = SymExpression.plus (   B)
inline

Symbolic plus operation.

Required fields of B:

◆ power()

function B = SymExpression.power (   p)
inline

Symbolic array power. POWER(A,p) overloads symbolic A.^p.

Examples
A = [x 10 y; alpha 2 5]; A .^ 2 returns [x^2 100 y^2; alpha^2 4 25]. A .^ x returns [x^x 10^x y^x; alpha^x 2^x 5^x]. A .^ A returns [x^x 1.0000e+10 y^y; alpha^alpha 4 3125]. A .^ [1 2 3; 4 5 6] returns [x 100 y^3; alpha^4 32 15625]. A .^ magic(3) is an error.
Required fields of p:

◆ privToCell()

function y = SymExpression.privToCell ( )
inline

◆ rdivide()

function X = SymExpression.rdivide (   B)
inline

Symbolic array right division. RDIVIDE(A,B) overloads symbolic A ./ B.

See also
SYM/LDIVIDE, SYM/MRDIVIDE, SYM/MLDIVIDE, SYM/QUOREM.
Required fields of B:

◆ size()

function varargout = SymExpression.size ( )
inline

The size of the symbolic expression tensor.

See also
NUMEL, LENGTH

◆ subsasgn()

function C = SymExpression.subsasgn (   Idx,
  R 
)
inline

Subscripted assignment for a sym array. C = SUBSASGN(L,Idx,R) is called for the syntax L(Idx)=R. Idx is a structure array with the fields: type – string containing () specifying the subscript type. Only parenthesis subscripting is allowed. subs – Cell array or string containing the actual subscripts.

See also
SYM.
Required fields of Idx:
Note
This method has the MATLAB method attribute Hidden set to true.
matlab documentation of method attributes.

◆ subsref()

function B = SymExpression.subsref (   Idx)
inline

Subscripted reference for a sym array. B = SUBSREF(A,S) is called for the syntax A(I). S is a structure array with the fields: type – string containing () specifying the subscript type. Only parenthesis subscripting is allowed. subs – Cell array or string containing the actual subscripts.

Required fields of Idx:
Note
This method has the MATLAB method attribute Hidden set to true.
matlab documentation of method attributes.

◆ symbol()

function x = SymExpression.symbol ( )
inline

Symbolic expression symbol string SYMBOL(F) returns the symbolc string of symbolic expression F as a sym object expression.

◆ times()

function X = SymExpression.times (   B)
inline

Symbolic array multiplication. TIMES(A,B) overloads symbolic A .* B.

Required fields of B:

◆ transpose()

function B = SymExpression.transpose ( )
inline

Symbolic matrix transpose. TRANSPOSE(A) overloads symbolic A.' .

Example
[a b; 1-i c].' returns [a 1-i; b c].
See also
SYM/CTRANSPOSE.

◆ uminus()

function B = SymExpression.uminus ( )
inline

------------— Arithmetic --------------— Symbolic negation.

◆ uplus()

function B = SymExpression.uplus ( )
inline

Unary plus.

Member Data Documentation

◆ f

SymExpression.f
protected

The body (or formula) of the symbolic expression.

◆ s

SymExpression.s
protected

The symbol that represents the symbolic expression.


The documentation for this class was generated from the following files:
  • /home/ayonga/.dropboxes/business/Dropbox/research/dzopt/frost/matlab/symbolic/@SymExpression/SymExpression.m
  • /home/ayonga/.dropboxes/business/Dropbox/research/dzopt/frost/matlab/symbolic/@SymExpression/load.m