当前位置:文档之家› MATLAB 内置符号运算函数

MATLAB 内置符号运算函数

MATLAB 内置符号运算函数
MATLAB 内置符号运算函数

目录

MuPAD Language Fundamentals (1)

Operators and Elementary Operations (1)

Special Values (2)

Data Types (2)

Equation Solving (6)

Formula Manipulation and Simplification (8)

Calculus (10)

Linear Algebra (12)

Polynomial Algebra (16)

Mathematical Constants and Functions (18)

Special Functions (20)

Numbers and Precision (22)

Supported Distributions (23)

Number Theory (26)

Graph Theory (29)

2-D and 3-D Plots (31)

Annotations and Appearance (31)

Programming Basics (32)

Data and File Management (32)

Advanced Software Development (33)

Domains (36)

Notebook Interface (36)

MuPAD (details)

MuPAD Language Fundamentals

Entering Commands

:=Assign variables

;Statement sequences

alias Defines an abbreviation or a macro

unalias Deletes an alias-definition

anames Identifiers that have values or properties

delete Delete the value of an identifier

freeIndets Free indeterminates of an expression

genident Create an unused identifier

help Display a help page

...Convert to a floating-point interval

id Identity map

indets Indeterminates of an expression

_index Indexed access

indexval Indexed access to arrays and tables without evaluation info Prints short information

last Access a previously computed object

reset Re-initialize a session

unit Physical units

val Value of an object

quit Reserved word

share Create a unique data representation Operators and Elementary Operations

Arithmetic Operations

_invert Reciprocal of an expression

_subtract Subtract expressions

Set Operations

append Add elements to a list

card Cardinality of a set

contains Test if an entry exists in a container

in Membership

intersect Intersection of sets and/or intervals

minus Difference of sets and/or intervals

union Union of sets and/or intervals

revert Revert polynomials, lists, character strings and tables, invert series

expansions

universe Set-theoretical universe

zip Combine lists

Expression Trees and Precedence

misc::genassop Generates an n-ary associative operator from a binary one Special Values

FAIL Indicate a failed computation

NIL Singleton element of the domain DOM_NIL

null Generate the void object of type DOM_NULL

TRUE Boolean constant TRUE

FALSE Boolean constant FALSE

UNKNOWN Boolean constant UNKNOWN

undefined Undefined value

solvelib::BasicSet Basic infinite sets

C_Complex numbers

R_Real numbers

Q_Rational numbers

Z_Integers

N_Positive integers

Data Types

Data Structures

Common Operations

.Concatenate objects

..Range operator

assign Perform assignments given as equations

assignElements Assign values to entries of an array, a list, or a table

length The "length" of a object (heuristic complexity)

match Pattern matching

nops Number of operands

op Operands of an object

piecewise Domain of conditionally defined objects

select Select operands

split Split an object

sysorder Compare objects according to the internal order table Create a table

numeric::indets Search for indeterminates

prog::exprtree Visualize an expression as tree

prog::find Find operands of objects

prog::sort Sort objects by an index function

Operations on Lists

listlib::insert Insert an element into a list

listlib::insertAt Insert an element into a list at a given position listlib::merge Merging two ordered lists

listlib::removeDuplicates Removes duplicate entries

listlib::removeDupSorted Remove duplicates of any element from ordered lists listlib::setDifference Remove elements from a list

listlib::singleMerge Merging of two ordered lists without duplicates listlib::sublist Search sublists

numeric::sort Sort a numerical list

poly2list Convert a polynomial to a list of terms

sort Sort a list

text2list Split a character string into a list of substrings Operations on Strings

stringlib::collapseWhitespace Collapse whitespace in strings

stringlib::contains Test for substring

stringlib::format Formatting a string

stringlib::formatf Convert a floating-point number to a string stringlib::formatTime Textual description of a time length

stringlib::lower Convert to lower-case

stringlib::maskMeta Mask regular expression special characters stringlib::order Sorting procedure for Sort

stringlib::pos Position of a substring

stringlib::random Create a random string

stringlib::readText Reading text file

stringlib::remove Delete substrings

stringlib::split Split a string

stringlib::subs Substitution in a string

stringlib::subsop Substitution in a string

stringlib::upper Convert to upper-case

stringlib::validIdent Validate identifier name

strmatch Match a pattern in a character string

substring Extract a substring from a string

Identification

Indeterminates, Expressions, Equations, Constants

Type::AlgebraicConstant Type representing algebraic constants

Type::Arithmetical Type representing arithmetical objects

Type::Boolean Type representing boolean expressions

Type::ConstantIdents Set of constant identifiers in MuPAD

Type::Constant Type representing constant objects

Type::Equation Type representing equations

Type::Function Type representing functions

Type::IndepOf Type representing objects that do not contain given identifiers Type::Indeterminate Type representing indeterminates

Type::Property Type representing any property

Type::Relation Type representing relations

Type::Unknown Type representing variables

Numbers

Type::NegInt Type and property representing negative integers

Type::NegRat Type and property representing negative rational numbers Type::Negative Type and property representing negative numbers Type::NonNegInt Type and property representing nonnegative integers Type::NonNegRat Type and property representing nonnegative rational numbers Type::NonNegative Type and property representing nonnegative numbers Type::PosInt Type and property representing positive integers

Type::PosRat Type and property representing positive rational numbers Type::Positive Type and property representing positive numbers

Type::NonZero Type and property representing "unequal to zero" Type::Zero Type and property representing zero

Type::Complex Type and property representing complex numbers Type::Imaginary Type and property representing imaginary numbers Type::Real Type and property representing real numbers

Type::Even Type and property representing even integers

Type::Integer Type and property representing integers

Type::Numeric Type representing numerical objects

Type::Odd Type and property representing odd integers

Type::Prime Type representing prime numbers

Type::Rational Type and property representing rational numbers

Type::Residue Property representing a residue class

Data Structures

Type::Interval Property representing intervals

Type::ListOf Type representing lists of objects with the same type

Type::ListProduct Type representing lists

Type::Intersection Type representing the intersection of several types

Type::PolyExpr Type representing polynomial expressions

Type::PolyOf Type representing polynomials

Type::Product Type representing sequences

Type::RatExpr Type representing rational expressions

Type::SequenceOf Type representing sequences

Type::Series Type representing truncated Puiseux, Laurent, and Taylor series

expansions

Type::SetOf Type representing sets

Type::Set Type representing set-theoretic expressions

Type::Singleton Type representing exactly one object

Type::TableOfEntry Type representing tables with specified entries

Type::TableOfIndex Type representing tables with specified indices

Type::TableOf Type representing tables

Type::Union Type representing several types as one type object

Type Checking

domtype Data type of an object

has Check if an object occurs in another object

hastype Test if an object of a specified type occurs in another object testtype Syntactical type checking

type Type of an object

Type::AnyType Type representing arbitrary MuPAD objects

Type::Predicate Type for testing object satisfying a given predicate

Conversion

coerce Type conversion

expr

expr2text Convert objects into character strings

int2text Convert an integer to a character string

interval Convert constant subexpressions to intervals

strprint Print into string

tbl2text Concatenate the strings in a table

text2expr Convert a character string to an expression

text2int Convert a character string to an integer

text2list Split a character string into a list of substrings

text2tbl Split a character string into a table of substrings

linalg::expr2Matrix Construct a matrix from equations

prog::exprlist Convert an expression into a nested list

Symbols and Special Characters

Symbol::accentPrime Adds a prime accent to an identifier

Symbol::accentAsterisk Adds an asterisk accent to an identifier

Symbol::accentTilde Adds a tilde accent to an identifier

Symbol::accentHat Adds a hat accent to an identifier

Symbol::accentRightArrow Adds a right arrow accent to an identifier

Symbol::accentDot Adds a dot accent to an identifier

Symbol::accentDoubleDot Adds a double dot accent to an identifier

Symbol::accentTripleDot Adds a triple dot accent to an identifier

Symbol::accentOverBar Adds an overbar to an identifier

Symbol::accentUnderBar Adds an underbar to an identifier

Symbol::new Functional access to symbols

Symbol::subScript Combines two expressions to a new subscripted identifier Symbol::subSuperScript Combines three expressions to a new combined sub- and

superscripted identifier

Symbol::superScript Combines two expressions to a new superscripted identifier Mathematics

Equation Solving

Symbolic Solvers

linsolve Solve a system of linear equations

poles Poles of expression or function

rec Domain of recurrence equations

RootOf Set of roots of a polynomial

solve Solve equations and inequalities

testeq Check the mathematical equivalence of expressions

solvelib::pdioe Solve polynomial Diophantine equations

Numeric Solvers

numeric::butcher Butcher parameters of Runge-Kutta schemes

numeric::cubicSpline Interpolation by cubic splines

numeric::cubicSpline2d Interpolation by 2-dimensional bi-cubic splines

numeric::fsolve Search for a numerical root of a system of equations numeric::leastSquares Least squares solution of linear equations

numeric::linsolve Solve a system of linear equations

numeric::matlinsolve Solve a linear matrix equation

numeric::odesolve Numerical solution of an ordinary differential equation numeric::odesolve2Numerical solution of an ordinary differential equation numeric::odesolveGeometric Numerical solution of an ordinary differential equation on a

homogeneous manifold

numeric::ode2vectorfield Convert an ode system to vectorfield notation

numeric::odeToVectorField Convert an ode system to vectorfield notation

numeric::solve Numerical solution of equations (the float attribute of solve) Ordinary Differential Equations

ode::exponentialSolutions Exponential solutions of a homogeneous linear ordinary differential

equation

ode::polynomialSolutions Polynomial solutions of a homogeneous linear ordinary differential

equation

ode::rationalSolutions Rational solutions of a homogeneous linear ordinary differential

equation

ode::series Series solutions of an ordinary differential equation

ode::solve Solving ordinary differential equations

ode Domain of ordinary differential equations

ode::companionSystem Companion matrix of a linear homogeneous ordinary differential

equation

ode::cyclicVector Transforms a linear differential system to an equivalent linear

differential system with a companion matrix.

ode::dAlembert D'Alembert reduction of a linear homogeneous ordinary differential

equation

ode::evalOde Applies an expression at a linear ordinary differential equation ode::exponents Exponents of a linear ordinary differential equation

ode::getOrder Order of an ordinary differential equation

ode::indicialEquation Indicial equation of a linear ordinary differential equation ode::isFuchsian Tests if a homogeneous linear ordinary differential equation is of

Fuchsian type

ode::isLODE Test for a linear ordinary differential equation

ode::mkODE Builds a linear homogeneous ordinary differential equation from a

list of coefficient functions

ode::normalize Normalized form of a linear ordinary differential equation ode::ratSys Rational solutions of a first order homogeneous linear differential

system

ode::scalarEquation Transforms a linear differential system to an equivalent scalar linear

differential equation

ode::symmetricPower Symmetric power of a homogeneous linear ordinary differential

equation

ode::unimodular Unimodular transformation of a linear ordinary differential

equation

ode::vectorize Coefficients of a homogeneous linear ODE

ode::wronskian Wronskian of functions or of a linear homogeneous ordinary

differential equation

Properties and Assumptions

assume Define a property

assumeAlso Define a property without removing prior assumptions assuming Evaluate under assumptions

assumingAlso Evaluate under additional assumptions

getprop Query properties of expressions

is Check a mathematical property of an expression

iszero Generic zero test

property::depends Dependence table with all properties of an expression property::hasprop Does an object have properties?

property::showprops What assumptions are made?

unassume Delete the properties of an identifier

Utilities for the Solver

solvelib::cartesianPower Cartesian power of a set

solvelib::cartesianProduct Cartesian product of sets

solvelib::conditionalSort Possible sortings of a list depending on parameters

solvelib::getElement Get one element of a set

solvelib::isEmpty Predicate expressing the emptyness of a set

solvelib::isFinite Test whether a set is finite

solvelib::preImage Preimage of a set under a mapping

solvelib::splitVectorSet Factor a set of vectors into a cartesian product

solvelib::Union Union of a system of sets

solvelib::VectorImageSet Domain of set of vectors that are images of sets under mappings Formula Manipulation and Simplification

Simplification

factorout Factor out a given expression

normal Normalize an expression

radsimp Simplify radicals in arithmetical expressions

Rule Defining equivalence rules for mathematical expressions

simplify Simplify an expression

Simplify Simplify an expression

simplifyFraction Normalize an expression

simplifyRadical Simplify radicals in arithmetical expressions

Formula Rearrangement and Rewriting

collect Collect terms with the same powers

combine Combine terms of the same algebraic structure

denom Denominator of a rational expression

expand Expand an expression

factor Factor a polynomial into irreducible polynomials

factorout Factor out a given expression

lhs Left hand side of equations, inequalities, relations, intervals, ranges

and tables

rhs Right hand side of equations, inequalities, relations, intervals,

ranges and tables

normal Normalize an expression

simplifyFraction Normalize an expression

numer Numerator of a rational expression

partfrac Compute a partial fraction decomposition

radsimp Simplify radicals in arithmetical expressions

simplifyRadical Simplify radicals in arithmetical expressions

rationalize Transform an expression into a rational expression

rectform Rectangular form of a complex expression

rewrite Rewrite an expression

Substitution

subs Substitute into an object

subset Relation "is a subset of"

subsex Extended substitution

subsop Replace operands

Evaluation

block Create an object protected against evaluation

blockIdents Create a transparent block with some identifiers protected against

evaluation

blockTransparent Create a transparent block protected against evaluation

unblock Replace blocks by their contents

context Evaluate an object in the enclosing context

eval Evaluate an object

evalassign Assignment with evaluation of the left hand side

evalAt Insert a value (evaluate at a point)

evalp Evaluate a polynomial at a point

freeze Create an inactive copy of a function

unfreeze Create an active copy of a frozen function

hold Delay evaluation

LEVEL Substitution depth of identifiers

level Evaluate an object with a specified substitution depth MAXDEPTH Prevent infinite recursion during procedure calls MAXEFFORT Maximum amount of work to spend on the computation MAXLEVEL Prevent infinite recursion during evaluation

Properties and Assumptions

assume Define a property

assumeAlso Define a property without removing prior assumptions assuming Evaluate under assumptions

assumingAlso Evaluate under additional assumptions

getprop Query properties of expressions

is Check a mathematical property of an expression

iszero Generic zero test

property::depends Dependence table with all properties of an expression property::hasprop Does an object have properties?

property::showprops What assumptions are made?

unassume Delete the properties of an identifier Calculus

Differentiation

D Differential operator for functions

diff Differentiate an expression or a polynomial

Integration

int Definite and indefinite integrals

int::addpattern Add patterns for integration

intlib::byparts Integration by parts

intlib::changevar Change of variable

intlib::intOverSet Integration over a set

intlib::printWarnings Enable or disable warnings

numeric::gldata Weights and abscissae of Gauss-Legendre quadrature numeric::gtdata Weights and abscissae of Gauss-Tschebyscheff quadrature numeric::int Numerical integration (the Float attribute of Int ) numeric::ncdata Weights and abscissae of Newton-Cotes quadrature numeric::quadrature Numerical integration ( Quadrature )

Series

Expansion

asympt Compute an asymptotic series expansion

mtaylor Compute a multivariate Taylor series expansion

O Domain of order terms (Landau symbols)

ORDER Default number of terms in series expansions

pade Pade approximation

series Compute a generalized series expansion

taylor Compute a Taylor series expansion

theta Theta series

Summation

sum Definite and indefinite summation

sum::addpattern Add patterns for definite and indefinite summation numeric::sum Numerical approximation of sums (the Float attribute of Sum ) Products

product Definite and indefinite products

numeric::product Numerical approximation of products

Limits

limit Compute a limit

Transforms

Fourier and Laplace Transforms

fourier Fourier transform

ifourier Inverse Fourier transform

ilaplace Inverse Laplace transform

laplace Laplace transform

Pref::fourierParameters Specify parameters for Fourier and inverse Fourier transforms transform::fourier Fourier transform

transform::invfourier Inverse Fourier transform

transform::laplace Laplace transform

transform::invlaplace Inverse Laplace transform

Z-Transform

iztrans Inverse Z transform

ztrans Z transform

transform::ztrans Z transform

transform::invztrans Inverse Z transform

Fast Fourier Transform

numeric::fft Fast Fourier Transform

numeric::invfft Inverse Fast Fourier Transform

New Patterns for Transforms

fourier::addpattern Add patterns for the Fourier transform

ifourier::addpattern Add patterns for the inverse Fourier transform ilaplace::addpattern Add patterns for the inverse Laplace transform iztrans::addpattern Add patterns for the inverse Z transform

laplace::addpattern Add patterns for the Laplace transform

ztrans::addpattern Add patterns for the Z transform transform::fourier::addpattern Add patterns for the Fourier transform transform::invfourier::addpattern Add patterns for the inverse Fourier transform transform::laplace::addpattern Add patterns for the Laplace transform transform::invlaplace::addpattern Add patterns for the inverse Laplace transform transform::ztrans::addpattern Add patterns for the Z transform transform::invztrans::addpattern Add patterns for the inverse Z transform Properties and Assumptions

assume Define a property

assumeAlso Define a property without removing prior assumptions assuming Evaluate under assumptions

assumingAlso Evaluate under additional assumptions

getprop Query properties of expressions

is Check a mathematical property of an expression iszero Generic zero test

property::depends Dependence table with all properties of an expression property::hasprop Does an object have properties?

property::showprops What assumptions are made?

unassume Delete the properties of an identifier Linear Algebra

Matrix and Vector Construction

array Create an array

hfarray Create an array of hardware floats

densematrix Create a matrix or a vector

doprint Print large matrices

matrix Create a matrix or a vector

linalg::hessenberg Hessenberg matrix

linalg::hessian Hessian matrix of a scalar function

linalg::hilbert Hilbert matrix

linalg::invhilbert Inverse of a Hilbert matrix

linalg::invpascal Inverse of a Pascal matrix

linalg::jacobian Jacobian matrix of a vector function

linalg::pascal Pascal matrix

linalg::randomMatrix Generate a random matrix

linalg::toeplitz Toeplitz matrix

linalg::vandermonde Vandermonde matrices and their inverses

linalg::invvandermonde Vandermonde matrices and their inverses

linalg::wiedemann Solving linear systems by Wiedemann's algorithm

Matrix Operations and Transformations

linalg::addCol Linear combination of matrix columns

linalg::addRow Linear combination of matrix rows

linalg::col Extract columns of a matrix

linalg::delCol Delete matrix columns

linalg::delRow Delete matrix rows

linalg::multCol Multiply columns with a scalar

linalg::multRow Multiply rows with a scalar

linalg::row Extract rows of a matrix

linalg::setCol Change a column of a matrix

linalg::setRow Change a row of a matrix

linalg::swapCol Swap two columns in a matrix

linalg::swapRow Swap two rows in a matrix

inverse Inverse of a matrix

transpose Transpose of a matrix

htranspose The Hermitean transpose of a matrix

linalg::pseudoInverse Moore-Penrose inverse of a matrix

numeric::inverse Inverse of a matrix

lllint Compute an LLL-reduced basis of a lattice

norm Compute the norm of a matrix, a vector, or a polynomial linalg::concatMatrix Join matrices horizontally

linalg::crossProduct Cross product of three-dimensional vectors

linalg::kroneckerProduct Kronecker product of matrices

linalg::normalize Normalize a vector

linalg::ogCoordTab Table of orthogonal coordinate transformations

linalg::orthog Orthogonalization of vectors

linalg::scalarProduct Scalar product of vectors

linalg::stackMatrix Join matrices vertically

linalg::submatrix Extract a submatrix or a subvector from a matrix or a vector,

respectively

linalg::substitute Replace a part of a matrix by another matrix

linalg::sylvester Sylvester matrix of two polynomials

numeric::expMatrix Exponential of a matrix

numeric::fMatrix Functional calculus for numerical square matrices

numeric::rotationMatrix Orthogonal matrix of the rotation about an axis

linalg::htranspose Hermitean transpose of a matrix

linalg::transpose Transpose of a matrix

Matrix Analysis

curl Curl of a vector field

det Determinant of a matrix

divergence Divergence of a vector field

gradient Vector gradient

hessian Hessian matrix of a scalar function

jacobian Jacobian matrix of a vector function

laplacian The Laplacian

norm Compute the norm of a matrix, a vector, or a polynomial potential The (scalar) potential of a gradient field vectorPotential Vector potential of a three-dimensional vector field numeric::det Determinant of a matrix

linalg::adjoint Adjoint of a matrix

linalg::angle Angle between two vectors

linalg::charmat Characteristic matrix

linalg::cond Condition number of a matrix

linalg::isHermitean Checks whether a matrix is Hermitean

linalg::isPosDef Test a matrix for positive definiteness

linalg::isUnitary Test whether a matrix is unitary

linalg::ncols Number of columns of a matrix

linalg::nonZeros Number of non-zero elements of a matrix

linalg::nrows Number of rows of a matrix

linalg::permanent Permanent of a matrix

linalg::sqrtMatrix Square root of a matrix

linalg::tr Trace of a matrix

linalg::vectorOf Type specifier for vectors

linalg::curl Curl of a vector field

linalg::det Determinant of a matrix

linalg::divergence Divergence of a vector field

linalg::grad Vector gradient

linalg::gradient Vector gradient

linalg::laplacian The Laplacian

linalg::potential The (scalar) potential of a gradient field

linalg::vectorPotential Vector potential of a three-dimensional vector field Vector Spaces and Subspaces

linalg::basis Basis for a vector space

linalg::gaussElim Gaussian elimination

linalg::gaussJordan Gauss-Jordan elimination

linalg::intBasis Basis for the intersection of vector spaces

linalg::matdim Dimension of a matrix

linalg::nrows Number of rows of a matrix

linalg::nullspace Basis for the null space of a matrix

linalg::rank Rank of a matrix

linalg::sumBasis Basis for the sum of vector spaces

linalg::vecdim Number of components of a vector

numeric::rank Numerical estimate of the rank of a matrix Eigenvalues and Eigenvectors

linalg::eigenvalues Eigenvalues of a matrix

linalg::eigenvectors Eigenvectors of a matrix

numeric::eigenvalues Numerical eigenvalues of a matrix

numeric::eigenvectors Numerical eigenvalues and eigenvectors of a matrix linalg::jordanForm Jordan normal form of a matrix

numeric::spectralRadius Spectral radius of a matrix

numeric::spectralradius Spectral radius of a matrix

Matrix Decomposition

linalg::factorCholesky The Cholesky decomposition of a matrix

linalg::factorLU LU-decomposition of a matrix

linalg::factorQR QR-decomposition of a matrix

linalg::frobeniusForm Frobenius form of a matrix

linalg::hermiteForm Hermite normal form of a matrix

linalg::inverseLU Computing the inverse of a matrix using LU-decomposition linalg::jordanForm Jordan normal form of a matrix

linalg::smithForm Smith canonical form of a matrix

numeric::factorCholesky Cholesky factorization of a matrix

numeric::factorLU LU factorization of a matrix

numeric::factorQR QR factorization of a matrix

numeric::singularvalues Numerical singular values of a matrix

numeric::singularvectors Numerical singular value decomposition of a matrix numeric::svd Numerical singular value decomposition of a matrix Linear Equations

det Determinant of a matrix

norm Compute the norm of a matrix, a vector, or a polynomial linalg::cond Condition number of a matrix

linalg::matlinsolve Solving systems of linear equations

linalg::matlinsolveLU Solving the linear system given by an LU decomposition linalg::rank Rank of a matrix

linalg::toeplitzSolve Solve a linear Toeplitz system

linalg::vandermondeSolve Solve a linear Vandermonde system

numeric::det Determinant of a matrix

numeric::inverse Inverse of a matrix

numeric::rank Numerical estimate of the rank of a matrix linalg::det Determinant of a matrix

Properties and Assumptions

assume Define a property

assumeAlso Define a property without removing prior assumptions assuming Evaluate under assumptions

assumingAlso Evaluate under additional assumptions

getprop Query properties of expressions

is Check a mathematical property of an expression iszero Generic zero test

property::depends Dependence table with all properties of an expression property::hasprop Does an object have properties?

property::showprops What assumptions are made?

unassume Delete the properties of an identifier Polynomial Algebra

Polynomial Creation

genpoly Create a polynomial using b-adic expansion laguerreL Laguerre polynomials and L function

orthpoly::chebyshev1The Chebyshev polynomials of the first kind orthpoly::chebyshev2The Chebyshev polynomials of the second kind orthpoly::curtz The Curtz polynomials

orthpoly::gegenbauer The Gegenbauer (ultraspherical) polynomials orthpoly::hermite The Hermite polynomials

orthpoly::jacobi The Jacobi polynomials

orthpoly::laguerre The (generalized) Laguerre polynomials orthpoly::legendre The Legendre polynomials

poly Create a polynomial

polylib::cyclotomic Cyclotomic polynomials

polylib::elemSym Elementary symmetric polynomials

polylib::Poly Domain of polynomials

polylib::randpoly Create a random polynomial

Polynomial Manipulation

divide Divide polynomials

interpolate Polynomial interpolation

irreducible Test irreducibility of a polynomial

pdivide Pseudo-division of polynomials

linalg::charpoly Characteristic polynomial of a matrix

linalg::companion Companion matrix of a univariate polynomial

linalg::minpoly Minimal polynomial of a matrix

polylib::decompose Functional decomposition of a polynomial

polylib::discrim Discriminant of a polynomial

polylib::divisors Divisors of a polynomial, polynomial expression, or Factored

element

polylib::Dpoly Differential operator for polynomials

polylib::makerat Convert expression into rational function over a suitable field polylib::minpoly Approximate minimal polynomial

polylib::primitiveElement Primitive element for tower of field extensions

polylib::primpart Primitive part of a polynomial

polylib::representByElemSym Represent symmetric by elementary symmetric polynomials polylib::splitfield Splitting field of a polynomial

polylib::sqrfree Square-free factorization of polynomials

polylib::subresultant Subresultants of two polynomials

polylib::support Support of a polynomial

Elements of Polynomials

coeff Coefficients of a polynomial

content Content of a polynomial

degree Degree of a polynomial

degreevec Exponents of the leading term of a polynomial

icontent Content of a polynomial with rational coefficients

lcoeff Leading coefficient of a polynomial

ldegree Lowest degree of the terms in a polynomial

lmonomial Leading monomial of a polynomial

lterm Leading term of a polynomial

mapcoeffs Apply a function to the coefficients of a polynomial

monomials Sorted list of monomials of a polynomial

multcoeffs Multiply the coefficients of a polynomial with a factor

nterms Number of terms of a polynomial

nthcoeff N-th non-zero coefficient of a polynomial

nthmonomial N-th monomial of a polynomial

nthterm N-th term of a polynomial

poly2list Convert a polynomial to a list of terms

polylib::coeffRing Coefficient ring of a polynomial

polylib::sortMonomials Sorting monomials with respect to a term ordering

tcoeff Trailing coefficient of a polynomial

Groebner Algebra

groebner::dimension Dimension of the affine variety generated by polynomials groebner::eliminate Eliminate variables

groebner::gbasis Computation of a reduced Gr?bner basis groebner::normalf Complete reduction modulo a polynomial ideal groebner::spoly The S-polynomial of two polynomials

groebner::stronglyIndependentSets Strongly independent set of variables

Polynomial Roots

numeric::polyrootbound Bound for the roots of a univariate polynomial

numeric::polyroots Numerical roots of a univariate polynomial

numeric::polysysroots Numerical roots of a system of polynomial equations numeric::realroot Numerical search for a real root of a real univariate function numeric::realroots Isolate intervals containing real roots of a univariate function polylib::realroots Isolate all real roots of a real univariate polynomial Properties and Assumptions

assume Define a property

assumeAlso Define a property without removing prior assumptions assuming Evaluate under assumptions

assumingAlso Evaluate under additional assumptions

getprop Query properties of expressions

is Check a mathematical property of an expression

iszero Generic zero test

property::depends Dependence table with all properties of an expression property::hasprop Does an object have properties?

property::showprops What assumptions are made?

unassume Delete the properties of an identifier Mathematical Constants and Functions

Constants

complexInfinity Complex infinity

infinity Real positive infinity

FAIL Indicate a failed computation

NIL Singleton element of the domain DOM_NIL

null Generate the void object of type DOM_NULL

TRUE Boolean constant TRUE

FALSE Boolean constant FALSE

UNKNOWN Boolean constant UNKNOWN

undefined Undefined value

C_Complex numbers

R_Real numbers

Q_Rational numbers

Z_Integers

N_Positive integers

Complex Numbers

abs Absolute value of a real or complex number arg Argument (polar angle) of a complex number Re Real part of an arithmetical expression

Im Imaginary part of an arithmetical expression sign Sign of a real or complex number

signIm Sign of the imaginary part of a complex number Exponents and Logarithms

exp Exponential function

ln Natural logarithm

log Logarithm to arbitrary base

log10Logarithm to base 10

log2Logarithm to base 2

^Raise an expression to a power

sqrt Square root function

surd N -th root

Trigonometric Functions

arcsin Inverse sine function

arccos Inverse cosine function

arctan Inverse tangent function

arccsc Inverse cosecant function

arcsec Inverse secant function

arccot Inverse cotangent function

sin Sine function

cos Cosine function

tan Tangent function

csc Cosecant function

sec Secant function

cot Cotangent function

Hyperbolic Functions

arcsinh Inverse of the hyperbolic sine function arccosh Inverse of the hyperbolic cosine function

实验四 MATLAB符号运算

实验四 MATLAB 符号运算 一、实验目的 掌握符号变量和符号表达式的创建,掌握MATLAB 的symbol 工具箱的一些基本应用。 二、实验内容 (1) 符号变量、表达式、方程及函数的表示。 (2) 符号微积分运算。 (3) 符号表达式的操作和转换。 (4) 符号微分方程求解。 三、实验步骤 1. 符号运算的引入 在数值运算中如果求x x x πsin lim 0→,则可以不断地让x 接近于0,以求得表达式接近什么数,但是终究不能令0=x ,因为在数值运算中0是不能作除数的。MATLAB 的符号运算能解决这类问题。输入如下命令: >>f=sym('sin(pi*x)/x') >>limit(f,'x',0) >> f=sym('sin(pi*x)/x') f = sin(pi*x)/x >> limit(f,'x',0) ans = Pi 2. 符号常量、符号变量、符号表达式的创建 1) 使用sym( )创建 输入以下命令,观察Workspace 中A 、B 、f 是什么类型的数据,占用多少字节的内存空间。 >> A=sym('1') >> B=sym('x') >> f=sym('2*x^2+3*y-1') >> clear >> f1=sym('1+2') >> f2=sym(1+2) >> f3=sym('2*x+3') >> f4=sym(2*x+3) >> x=1 >> f4=sym(2*x+3) > A=sym('1') A = 1

>> B=sym('x') B = x >> f=sym('2*x^2+3*y-1') f = 2*x^2+3*y-1 >> clear >> f1=sym('1+2') f1 = 1+2 >> f2=sym(1+2) f2 = 3 >> f3=sym('2*x+3') f3 = 2*x+3 >> f4=sym(2*x+3) ??? Undefined function or variable 'x'. >> x=1 x = >> f4=sym(2*x+3) f4 =

(完整版)MATLAB常用函数大全

一、MATLAB常用的基本数学函数 abs(x):纯量的绝对值或向量的长度 angle(z):复数z的相角(Phase angle) sqrt(x):开平方 real(z):复数z的实部 imag(z):复数z的虚部 conj(z):复数z的共轭复数 round(x):四舍五入至最近整数 fix(x):无论正负,舍去小数至最近整数 floor(x):地板函数,即舍去正小数至最近整数ceil(x):天花板函数,即加入正小数至最近整数rat(x):将实数x化为分数表示 rats(x):将实数x化为多项分数展开 sign(x):符号函数(Signum function)。 当x<0时,sign(x)=-1; 当x=0时,sign(x)=0; 当x>0时,sign(x)=1。 rem(x,y):求x除以y的馀数 gcd(x,y):整数x和y的最大公因数 lcm(x,y):整数x和y的最小公倍数 exp(x):自然指数 pow2(x):2的指数 log(x):以e为底的对数,即自然对数或 log2(x):以2为底的对数 log10(x):以10为底的对数 二、MATLAB常用的三角函数 sin(x):正弦函数 cos(x):余弦函数

tan(x):正切函数 asin(x):反正弦函数 acos(x):反馀弦函数 atan(x):反正切函数 atan2(x,y):四象限的反正切函数 sinh(x):超越正弦函数 cosh(x):超越馀弦函数 tanh(x):超越正切函数 asinh(x):反超越正弦函数 acosh(x):反超越馀弦函数 atanh(x):反超越正切函数 三、适用於向量的常用函数有: min(x): 向量x的元素的最小值 max(x): 向量x的元素的最大值 mean(x): 向量x的元素的平均值 median(x): 向量x的元素的中位数 std(x): 向量x的元素的标准差 diff(x): 向量x的相邻元素的差 sort(x): 对向量x的元素进行排序(Sorting)length(x): 向量x的元素个数 norm(x): 向量x的欧氏(Euclidean)长度sum(x): 向量x的元素总和 prod(x): 向量x的元素总乘积 cumsum(x): 向量x的累计元素总和cumprod(x): 向量x的累计元素总乘积 dot(x, y): 向量x和y的内积 cross(x, y): 向量x和y的外积 四、MATLAB的永久常数

matlab符号运算

MATLAB程序设计教程(9)——MATLAB符号计算 by:ysuncn(欢迎转载,请注明原创信息) 第9章MATLAB符号计算 9.1 符号对象 9.2 符号微积分 9.3 级数 9.4 符号方程求解 9.1 符号对象 9.1.1 建立符号对象 1.建立符号变量和符号常量 MATLAB提供了两个建立符号对象的函数:sym和syms,两个函数的用法不同。 (1) sym函数 sym函数用来建立单个符号量,一般调用格式为: 符号量名=sym('符号字符串') 该函数可以建立一个符号量,符号字符串可以是常量、变量、函数或表达式。 应用sym函数还可以定义符号常量,使用符号常量进行代数运算时和数值常量进行的运算不同。

下面的命令用于比较符号常量与数值常量在代数运算时的差别。 (2) syms函数 函数sym一次只能定义一个符号变量,使用不方便。MATLAB提供了另一个函数syms,一次可以定义多个符号变量。syms函数的一般调用格式为: syms 符号变量名1 符号变量名2 … 符号变量名n 用这种格式定义符号变量时不要在变量名上加字符串分界符(‘),变量间用空格而不要用逗号分隔。 2.建立符号表达式 含有符号对象的表达式称为符号表达式。建立符号表达式有以下3种方法: (1)利用单引号来生成符号表达式。 (2)用sym函数建立符号表达式。 (3) 使用已经定义的符号变量组成符号表达式。 9.1.2 符号表达式运算 1.符号表达式的四则运算 符号表达式的加、减、乘、除运算可分别由函数symadd、symsub、symmul和symdiv来实现,幂运算可以由sympow来实现。

(完整版)matlab函数大全(非常实用)

信源函数 randerr 产生比特误差样本 randint 产生均匀分布的随机整数矩阵 randsrc 根据给定的数字表产生随机矩阵 wgn 产生高斯白噪声 信号分析函数 biterr 计算比特误差数和比特误差率 eyediagram 绘制眼图 scatterplot 绘制分布图 symerr 计算符号误差数和符号误差率 信源编码 compand mu律/A律压缩/扩张 dpcmdeco DPCM(差分脉冲编码调制)解码dpcmenco DPCM编码 dpcmopt 优化DPCM参数 lloyds Lloyd法则优化量化器参数 quantiz 给出量化后的级和输出值 误差控制编码 bchpoly 给出二进制BCH码的性能参数和产生多项式convenc 产生卷积码 cyclgen 产生循环码的奇偶校验阵和生成矩阵cyclpoly 产生循环码的生成多项式 decode 分组码解码器 encode 分组码编码器 gen2par 将奇偶校验阵和生成矩阵互相转换gfweight 计算线性分组码的最小距离 hammgen 产生汉明码的奇偶校验阵和生成矩阵rsdecof 对Reed-Solomon编码的ASCII文件解码rsencof 用Reed-Solomon码对ASCII文件编码rspoly 给出Reed-Solomon码的生成多项式syndtable 产生伴随解码表 vitdec 用Viterbi法则解卷积码 (误差控制编码的低级函数) bchdeco BCH解码器 bchenco BCH编码器 rsdeco Reed-Solomon解码器 rsdecode 用指数形式进行Reed-Solomon解码 rsenco Reed-Solomon编码器 rsencode 用指数形式进行Reed-Solomon编码 调制与解调

Matlab中常见数学函数的使用

给自己看的----Matlab 的内部常数(转) 2008/06/19 14:01 [Ctrl C/V--学校 ] MATLAB 基本知识 Matlab 的内部常数 pi 圆周率 exp(1) 自然对数的底数e i 或j 虚数单位 Inf 或 inf 无穷大 Matlab 的常用内部数学函数

我们也可在matlab中调用maple的命令进行多项式的运算,调用格式如下: maple(’maple中多项式的运算命令’) 如何用matlab进行分式运算 发现matlab只有一条处理分式问题的命令,其使用格式如下: [n,d]=numden(f)把符号表达式f化简为有理形式,其中分子和分母的系数为整数且分子分母不含公约项,返回结果n为分子,d为分母。注意:f必须为符号表达式 不过我们可以调用maple的命令,调用方法如下: maple(’denom(f)’)提取分式f的分母 maple(’numer(f)’)提取分式f的分子 maple(’normal(f)’ ) 把分式f的分子与分母约分成最简形式 maple(’expand(f)’) 把分式f的分子展开,分母不变且被看成单项。 maple(’factor(f)’) 把分式f的分母和分子因式分解,并进行约分。 如何用Matlab进行因式分解 syms 表达式中包含的变量factor(表达式) 如何用Matlab展开 syms 表达式中包含的变量expand(表达式) 如何用Matlab进行化简 syms 表达式中包含的变量simplify(表达式) 如何用Matlab合并同类项 syms 表达式中包含的变量collect(表达式,指定的变量) 如何用Matlab进行数学式的转换 调用Maple中数学式的转换命令,调用格式如下: maple(‘Maple的数学式转换命令’) 即:maple(‘convert(表达式,form)’)将表达式转换成form的表示方式 maple(‘convert(表达式,form, x)’)指定变量为x,将依赖于变量x的函数转换成form的表示方式(此指令仅对form为exp与sincos的转换式有用) 如何用Matlab进行变量替换 syms 表达式和代换式中包含的所有变量subs(表达式,要替换的变量或式子,代换式) 如何用matlab进行复数运算 a+b*i 或 a +b*j表示复数a+bi 或a+bj real(z)求复数z的实部 imag(z)求复数z的虚部 abs(z)求复数z的模 angle(z)求复数z的辐角, conj(z)求复数z的共轭复数 exp(z)复数的指数函数,表示e^z 如何在matlab中表示集合 [a, b, c,…] 表示由a, b, c,…组成的集合(注意:元素之间也可用空格隔开) unique(A) 表示集合A的最小等效集合(每个元素只出现一次) 也可调用maple的命令,格式如下: maple('{a, b, c,…}')表示由a, b, c,…组成的集合 下列命令可以生成特殊的集合: maple(‘{seq(f(i),i=n..m)}’)生成集合{f(n), f(n+1), f(n+2), … , f(m)} 如何用Matlab求集合的交集、并集、差集和补集

matlab符号运算函数大全

m a t l a b符号运算函数大 全 The Standardization Office was revised on the afternoon of December 13, 2020

算术符号操作 命令 +、-、*、.*、\、.\、/、./、^、.^、’、.’ 功能符号矩阵的算术操作 用法如下: A+B、A-B 符号阵列的加法与减法。 若A与B为同型阵列时,A+B、A-B分别对对应分量进行加减;若A与B中至少有一个为标量,则把标量扩大为与另外一个同型的阵列,再按对应的分量进行加减。 A*B 符号矩阵乘法。 A*B为线性代数中定义的矩阵乘法。按乘法定义要求必须有矩阵 A的列数等于矩阵B的行数。即:若 A n*k* B k*m=(a ij)n*k.*(b ij)k*m= C n*m=(c ij)n*m,则,i=1,2,…,n; j=1,2,…,m。或者至少有一个为标量时,方可进行乘法操作,否则 将返回一出错信息。 A.*B 符号数组的乘法。 A.*B为按参量A与B对应的分量进行相乘。A与B必须为同型 阵列,或至少有一个为标量。即: A n*m.* B n*m=(a ij)n*m.*(b ij)n*m= C n*m=(c ij)n*m,则c ij= a ij* b ij, i=1,2,…,n;j=1,2,…,m。 A\B 矩阵的左除法。 X=A\B为符号线性方程组A*X=B的解。我们指出的是,A\B近 似地等于inv(A)*B。若X不存在或者不唯一,则产生一警告信 息。矩阵A可以是矩形矩阵(即非正方形矩阵),但此时要求方 程组必须是相容的。 A.\B 数组的左除法。 A.\B为按对应的分量进行相除。若A与B为同型阵列时, A n*m.\ B n*m=(a ij)n*m.\(b ij)n*m= C n*m=(c ij)n*m,则c ij= a ij\ b ij,i=1,2,…,n; j=1,2,…,m。若若A与B中至少有一个为标量,则把标量扩大为 与另外一个同型的阵列,再按对应的分量进行操作。 A/B 矩阵的右除法。 X=B/A为符号线性方程组X*A=B的解。我们指出的是,B/A粗 略地等于B*inv(A)。若X不存在或者不唯一,则产生一警告信 息。矩阵A可以是矩形矩阵(即非正方形矩阵),但此时要求方 程组必须是相容的。 A./B 数组的右除法。 A./B为按对应的分量进行相除。若A与B为同型阵列时, A n*m./ B n*m=(a ij)n*m./(b ij)n*m= C n*m=(c ij)n*m,则c ij= a ij/b ij,i=1,2,…,n; j=1,2,…,m。若A与B中至少有一个为标量,则把标量扩大为与 另外一个同型的阵列,再按对应的分量进行操作。 A^B 矩阵的方幂。

matlab 常用函数(1)

A axis() axis([xmin xmax ymin ymax]) sets the limits for the x- and y-axis of the current axes. axis([xmin xmax ymin ymax zmin zmax cmin cmax]) sets the x-, y-, and z-axis limits and the color scaling limits (see caxis) of the current axes. axis equal sets the aspect ratio so that the data units are the same in every direction. The aspect ratio of the x-, y-, and z-axis is adjusted automatically according to the range of data units in the x, y, and z directions C clf Clear current figure window G grid off/on The grid function turns the current axes' grid lines on and off. H hold on/off ●The hold function determines whether new graphics objects are added to the graph or replace objects in the graph. ●hold on retains the current plot and certain axes properties so that subsequent graphing commands add to the existing graph. ●hold off resets axes properties to their defaults before drawing new plots. hold off is the default

完整word版,MATLAB符号运算

符号运算 科学计算包括数值计算和符号计算两种计算,数值计算是近似计算;而符号计算则是绝对精确的计算。 符号变量的生成和使用 1、符号变量、符号表达式和符号方程的生成 (1)、使用sym函数定义符号变量和符号表达式 单个符号变量 sqrt(2) sym(sqrt(2)) %显示精确结果 a=sqrt(sym(2)) %显示精确结果 double(a) sym(2)/sym(3) %显示精确结果 2/5+1/3 sym(2/5+1/3) %显示精确结果 sym(2)/sym(5)+sym(1)/sym(3) %显示精确结果 sym函数定义符号表达式:单个变量定义法,整体定义法 单个变量定义法 a=sym('a') b=sym('b') c=sym('c') x=sym('x') f=a*x^2+b*x+c 整体定义法 f=sym('a*x^2+b*x+c') g=f^2+4*f-2 (2)、使用syms函数定义符号变量和符号表达式 一次可以创建任意多个符号变量syms var1 var2 var3… syms a b c x f=a*x^2+b*x+c g=f^2+4*f-2 (3)、符号方程的生成 函数:数字和变量组陈的代数式 方程:函数和等号组成的等式 用sym函数生成符号方程: equation1=sym('sin(x)+cos(x)=1') 2、符号变量的基本操作 (1)、findsym函数用于寻找符号变量 findsym(f):找出f表达式中的符号变量 findsym(s,n):找出表达式s中n个与x接近的变量 syms a alpha b x1 y findsym(alpha+a+b)

Matlab常见函数汇总

colorbar 显示彩条 getimage 由坐标轴得到图像数据 ice(DIPUM)交互彩色编辑 image 创建和显示图像对象 imagesc 缩放数据并显示为图像 immovie 由多帧图像制作电影 imshow 显示图像 imview 在Image Viewer中显示图像montage 将多个图像帧显示为矩阵蒙太奇movie 播放录制的电影帧 rgbcube 显示一个彩色RGB立方体subimage 在单个图形中显示多幅图像truesize 调整图像的显示尺寸 warp 将图像显示为纹理映射的表面 图像文件输入/输出 Dicominfo 从一条DICOM消息中读取元数据Dicomread 读一幅DICOM图像Dicomwrite 写一幅DICOM图像 Dicom-dict.txt 包含DICOM数据字典的文本文件Dicomuid 产生DICOM唯一的识别器Imfinfo 返回关于图像的文件的信息Imread 读图像文件

Imwrite 写图像文件 图像算术 Imabsdiff 计算两幅图像的绝对差 Imadd 两幅图像相加或把常数加到图像上Imcomplement 图像求补 Imdivide 两幅图像相除,或用常数除图像Imlincomb 计算图像的线性组合 Immultiply 两幅图像相乘或用常数乘图像Imsubtract 两幅图像相减,或从图像中减去常数几何变换 Checkerboard 创建棋盘格图像 Findbounds 求几何变换的输出范围 Fliptform 颠倒TFORM结构的输入/输出Imcrop 修剪图像 Imresize 调整图像大小 Imrotate 旋转图像 Imtransform 对图像应用几何变换 Intline 整数坐标线绘制算法Makersampler 创建重取样器结构 Maketform 创建几何变换结构(TFORM)Pixeldup(DIPUM)在两个方向上复制图像的像素Tformarray 对N-D数组应用几何变换

matlab符号运算符

Matlab符号运算符的使用 一、&&/||/&/| |:数组逻辑或 ||:先决逻辑或 &:数组逻辑与 &&:先决逻辑与 &&和||被称为&和|的short circuit形式。 先决逻辑符号含义: 先判断左边是否为真;若为真,则不再判断右边;若为假,才继续进行或运算 先判断左边是否为假;若为假,则不再判断右边;若为真,才继续进行与运算两种运算符号的区别: 先决逻辑运算的运算对象只能是标量 数组逻辑运算可为任何维数组,运算符两边维数要相同 举例分析: A&B :首先判断A的逻辑值,然后判断B的值,然后进行逻辑与的计算。 A&&B:首先判断A的逻辑值,如果A的值为假,就可以判断整个表达式的值为假, 就可以判断整个表达式的值为假,就不需要再判断B的值。这种用法非常有用, 如果A是一个计算量较小的函数,B是一个计算量较大的函数,那么首先判断A 对减少计算量是有好处的。 另外这也可以防止类似被0除的错误。 Matlab中的if和while语句中的逻辑与和逻辑或都是默认使用short-circuit形式。// 这可能就是有时候用&和| 会报错的原因。

二、系统结构体内的变量 一般都是小写。 matlab区分大小写。 三、== 表示逻辑相等,返回结果,相等为1,不等为0。 四、.*(times)点乘 times Array multiply 数组乘 Syntax c = a.*b c = times(a,b) Description c = a.*b multiplies arrays a an d b element-by-element and returns th e result in c. Inputs a and b must have the same size unless one is a scalar. 注释:a、b要同尺寸,或其中一个为标量。 c = times(a,b) is calle d for th e syntax a.*b when a or b is an object. Example a = [1 2 3]'; b = [5 6 7]'; c = a.*b; 五、矩阵或向量共轭转置“’”和转置“.’” 若矩阵由实数构成,二者作用一样;

最新Matlab中常见数学函数的使用

给自己看的----Matlab的内部常数(转) 2008/06/19 14:01[Ctrl C/V--学校 ] MATLAB基本知识 Matlab的内部常数 pi 圆周率 exp(1) 自然对数的底数e i 或j 虚数单位 Inf或inf 无穷大 Matlab的常用内部数学函数

如何用matlab进行多项式运算 (1)合并同类项 syms 表达式中包含的变量 collect(表达式,指定的变量) (2)因式分解 syms 表达式中包含的变量factor(表达式) (3)展开 syms 表达式中包含的变量 expand(表达式) 我们也可在matlab中调用maple的命令进行多项式的运算,调用格式如下: maple(’maple中多项式的运算命令’) 如何用matlab进行分式运算 发现matlab只有一条处理分式问题的命令,其使用格式如下: [n,d]=numden(f)把符号表达式f化简为有理形式,其中分子和分母的系数为整数且分子分母不含公约项,返回结果n为分子,d为分母。注意:f必须为符号表达式 不过我们可以调用maple的命令,调用方法如下: maple(’denom(f)’)提取分式f的分母 maple(’numer(f)’)提取分式f的分子 maple(’normal(f)’ ) 把分式f的分子与分母约分成最简形式 maple(’expand(f)’) 把分式f的分子展开,分母不变且被看成单项。 maple(’factor(f)’) 把分式f的分母和分子因式分解,并进行约分。 如何用Matlab进行因式分解 syms 表达式中包含的变量factor(表达式) 如何用Matlab展开 syms 表达式中包含的变量expand(表达式) 如何用Matlab进行化简 syms 表达式中包含的变量simplify(表达式) 如何用Matlab合并同类项 syms 表达式中包含的变量collect(表达式,指定的变量) 如何用Matlab进行数学式的转换 调用Maple中数学式的转换命令,调用格式如下: maple(‘Maple的数学式转换命令’) 即:maple(‘convert(表达式,form)’)将表达式转换成form的表示方式 maple(‘convert(表达式,form, x)’)指定变量为x,将依赖于变量x的函数转换成form的表示方式(此指令仅对form为exp与sincos的转换式有用) 如何用Matlab进行变量替换 syms 表达式和代换式中包含的所有变量subs(表达式,要替换的变量或式子,代换式) 如何用matlab进行复数运算 a+b*i 或 a +b*j表示复数a+bi 或a+bj real(z)求复数z的实部 imag(z)求复数z的虚部 abs(z)求复数z的模 angle(z)求复数z的辐角, conj(z)求复数z的共轭复数 exp(z)复数的指数函数,表示e^z 如何在matlab中表示集合 [a, b, c,…] 表示由a, b, c,…组成的集合(注意:元素之间也可用空格隔开) unique(A) 表示集合A的最小等效集合(每个元素只出现一次) 也可调用maple的命令,格式如下: maple('{a, b, c,…}')表示由a, b, c,…组成的集合 下列命令可以生成特殊的集合: maple(‘{seq(f(i),i=n..m)}’)生成集合{f(n), f(n+1), f(n+2), … , f(m)} 如何用Matlab求集合的交集、并集、差集和补集

MatLab常见函数和运算符号解读

MatLab常见函数和运算符号 基本运算 convhull :凸壳函数 cumprod :累计积 cumsum :累计和 cumtrapz :累计梯形数值积分 delaunay :Delaunay三角化 dsearch :求最近点(这是两个有趣的函数 factor :质数分解inpolygon :搜索多边形内的点 max :最大元素 mean :平均值 median :数组的中间值 min :最小值 perms :向量所有排列组成矩阵 polyarea :多边形的面积 primes :生成质数列表 prod :数组元素积 sort :元素按升序排列 sortrows :将行按升序排列

std :标准差 sum :元素和 trapz :梯形数值积分 tsearch :搜索Delaunay三角形var :方差 voronoi :Voronoi图 del2 :Laplacian离散 diff :差分和近似微分gradient:数值梯度 corrcoef :相关系数 cov :协方差矩阵 xcorr :互相关系数 xcov :互协方差矩阵 xcorr2 :二维互相关 conv :卷积和多项式相乘conv2 :二维卷积 deconv :反卷积 filter :滤波 filter2 :二维数字滤波

傅立叶变换 abs :绝对值和模 angle :相角 cplxpair :按复共扼把复数分类 fft :一维快速傅立叶变换 fft2 :二维快速傅立叶变换 fftshit :将快速傅立叶变换的DC分量移到谱中央ifft :以为逆快速傅立叶变换 ifft2 :二维逆快速傅立叶变换 ifftn :多维逆快速傅立叶变换 ifftshift :逆fft平移 nextpow2 :最相邻的2的幂 unwrap :修正相角 cross :向量叉积 intersect:集合交集 ismember :是否集合中元素 setdiff :集合差集 setxor :集合异或(不在交集中的元素 union :两个集合的并

matlab常用解方程及方程组函数

1. roots 求解多项式的根 r=roots(c) 注意: c 为一维向量,者返回指定多项式的所有根( 包括复根),poly 和roots 是互为反运算,还有就是roots 只能求解多项式的解 还有下面几个函数poly2sym、sym2poly 、eig >>syms x >>y=x A5+3*x A3+3; >>c=sym2poly(y);%求解多项式系数 >>r=roots(c); >>poly(r) 2. residue 求留数 [r, p, k] = residue(b,a) >>b = [ 5 3 -2 7] >>a = [-4 0 8 3] >>[r, p, k] = residue(b,a) 3. solve 符号解方程(组)——使用最多的 g = solve(eq1,eq2,...,eqn,var1,var2,...,varn) 注意:eqn 和varn 可以是符号表达式,也可以是字符串表达式,但是使用符号表达式时不能有“=号”,假如说varn 没有给出,使用findsym 函数找出默认的求解变量。返回的g 是个结构体,以varn 为字段。由于符号求解的局限性,好多情况下可能得到空矩阵,此时只能用数值解法 解方程A=solve('a*xA2 + b*x + c') 解方程组B=solve('a*uA2 + vA2', 'u - v = 1', 'aA2 - 5*a + 6') 4. fzero 数值求零点 [x,fval,exitflag,output]=fzero(fun,x0,options,p1,p2...) fun 是目标函数,可以是句柄(@)、inline 函数或M 文件名 x0 是初值,可以是标量也可以是长度为2 的向量,前者给定一个位置,后者是给定一个范围options 是优化参数,通过optimset 设置,optimget 获取,一般使用默认的就可以了,具体参照帮助 p1,p2...为需要传递的其它参数 假如说(x/1446)A2+p/504.1+(t/330.9)*(log(1-x/1446)+(1-1 /5.3)*x/1446)=0 的根,其中p,t 是已知

MATLAB实验——符号运算讲解

实验一符号运算 班级:电气4班姓名:叶元亮学号:B2012052409 一、实验目的 1、了解符号、数值、字符等数据类型的差别 2、了解符号运算的特点、优缺点 3、掌握符号变量的创建和运算,以及其运算的基本应用 4、掌握基本的符号绘图指令 二、实验内容 1、指出下面的 M1,M2,M3 分别是什么,并上机验证。 取a=1、b=2、c=3、d=4,M1=[a,b;c,d],M2='[a,b;c,d]',M3=sym('[a,b;c,d]'); >> a=1,b=2,c=3,d=4 a = 1 b = 2 c = 3 d = 4 >> M1=[a,b;c,d] M1 =

1 2 3 4 >> M2='[a,b;c,d]' M2 = [a,b;c,d] >> M3=sym('[a,b;c,d]') M3 = [ a, b] [ c, d] 结论:M1是矩阵,2是字符串,M3是字符变量。 2、下面2种取值情况下,计算b a b a- + 并赋给相应情况下的c1、c2,问c1、c2相等吗,为什么?上机验证。 (1) a1=1010; b1=10-10; (2)将a1、a2作为符号变量赋给a2、b2; >> a1=1e10; b1=1e-10; >> c1=(a1+b1-a1)/b1 c1 = >> a2=sym(a1); b2=sym(b1); >> c2=(a2+b2-a2)/b2 c2 = 1

结果:c1~=c2,因为c1=0,c2=1,a1、b1是具体的数值,a2、b2是符号变量。 3、符号表达式中自由变量的确定生成符号变量a 、b 、x 、X 、Y 、 k=3、z=a y w c sin +,表达式为 Y k bx azX f )(2++=。 (1)找出f 中的全部自由符号变量 (2)在f 中确定最优先的自由符号变量 (3)在f 中确定2个和3个自由变量时的执行情况 (4)试通过对各符号变量与x 的ASCII 值做绝对差值,分析自 由变量优秀顺序,能得出什么结论? >> syms a b x X Y k=sym('3'); z=sym('c*sqrt(w)+y*sin(a)'); f=a*z*X+(b*x^2+k)*Y; >> findsym(f) ans = X, Y, a, b, c, w, x, y >> findsym(f,1) ans = x >> findsym(f,2) ans = x,y

matlab内部函数大全

MATLAB函数大全 Matlab有没有求矩阵行数/列数/维数的函数? ndims(A)返回A的维数 size(A)返回A各个维的最大元素个数 length(A)返回max(size(A)) [m,n]=size(A)如果A是二维数组,返回行数和列数nnz(A)返回A中非0元素的个数 MATLAB的取整函数:fix(x), floor(x) :,ceil(x) , round(x) (1)fix(x) : 截尾取整. >> fix( [3.12 -3.12]) ans = 3 -3 (2)floor(x):不超过x 的最大整数.(高斯取整) >> floor( [3.12 -3.12]) ans = 3 -4 (3)ceil(x) : 大于x 的最小整数 >> ceil( [3.12 -3.12]) ans = 4 -3 (4)四舍五入取整 >> round(3.12 -3.12) ans = >> round([3.12 -3.12]) ans =

3 -3 >> 如何用matlab生成随机数函数 rand(1) rand(n):生成0到1之间的n阶随机数方阵rand(m,n):生成0到1之间的m×n的随机数矩阵(现成的函数) 另外: Matlab随机数生成函数 betarnd 贝塔分布的随机数生成器 binornd 二项分布的随机数生成器 chi2rnd 卡方分布的随机数生成器 exprnd 指数分布的随机数生成器 frnd f分布的随机数生成器 gamrnd 伽玛分布的随机数生成器 geornd 几何分布的随机数生成器 hygernd 超几何分布的随机数生成器 lognrnd 对数正态分布的随机数生成器 nbinrnd 负二项分布的随机数生成器 ncfrnd 非中心f分布的随机数生成器 nctrnd 非中心t分布的随机数生成器 ncx2rnd 非中心卡方分布的随机数生成器 normrnd 正态(高斯)分布的随机数生成器 poissrnd 泊松分布的随机数生成器 raylrnd 瑞利分布的随机数生成器 trnd 学生氏t分布的随机数生成器 unidrnd 离散均匀分布的随机数生成器 unifrnd 连续均匀分布的随机数生成器 weibrnd 威布尔分布的随机数生成器 一、MATLAB常用的基本数学函数 abs(x):纯量的绝对值或向量的长度 angle(z):复数z的相角(Phase angle) sqrt(x):开平方 real(z):复数z的实部 imag(z):复数z的虚部 conj(z):复数z的共轭复数 round(x):四舍五入至最近整数 fix(x):无论正负,舍去小数至最近整数 floor(x):地板函数,即舍去正小数至最近整数 ceil(x):天花板函数,即加入正小数至最近整数

MatLab常用函数大全

1、求组合数 C,则输入: 求k n nchoosek(n,k) 例:nchoosek(4,2) = 6. 2、求阶乘 求n!.则输入: Factorial(n). 例:factorial(5) = 120. 3、求全排列 perms(x). 例:求x = [1,2,3]; Perms(x),输出结果为: ans = 3 2 1 3 1 2 2 3 1 2 1 3 1 2 3 1 3 2 4、求指数 求a^b:Power(a,b) ; 例:求2^3 ; Ans = pow(2,3) ; 5、求行列式 求矩阵A的行列式:det(A); 例:A=[1 2;3 4] ; 则det(A) = -2 ; 6、求矩阵的转置 求矩阵A的转置矩阵:A’ 转置符号为单引号. 7、求向量的指数 求向量p=[1 2 3 4]'的三次方:p.^3 例: p=[1 2 3 4]' A=[p,p.^2,p.^3,p.^4] 结果为:

注意:在p 与符号”^”之间的”.”不可少. 8、求自然对数 求ln(x):Log(x) 例:log(2) = 0.6931 9、求矩阵的逆矩阵 求矩阵A 的逆矩阵:inv(A) 例:a= [1 2;3 4]; 则 10、多项式的乘法运算 函数conv(p1,p2)用于求多项式p1和p2的乘积。这里,p1、p2是两个多项式系数向量。 例2-2 求多项式43810x x +-和223x x -+的乘积。 命令如下: p1=[1,8,0,0,-10]; p2=[2,-1,3]; c=conv(p1,p2) 11、多项式除法 函数[q ,r]=deconv(p1,p2)用于多项式p1和p2作除法运算,其中q 返回多项式p1除以p2的商式,r 返回p1除以p2的余式。这里,q 和r 仍是多项式系数向量。 例2-3 求多项式43810x x +-除以多项式223x x -+的结果。 命令如下: p1=[1,8,0,0,-10]; p2=[2,-1,3]; [q,r]=deconv(p1,p2) 12、求一个向量的最大值 求一个向量x 的最大值的函数有两种调用格式,分别是:

MATLAB常用函数

1概述安装介绍(略)。 2 矩阵和数组 2.1 创建特殊矩阵函数 Compan 伴随矩阵Diag 对角矩阵Eye 单位矩阵Gallery 测试矩阵Hadamard hadamard矩阵Hilb hilb矩阵Invhilb invhilb矩阵 Magic魔方矩阵Ones 全一矩阵Rand均匀分布随机矩阵 Randn 正态分布随机矩阵Rosser经典对称特征测试矩阵 Wilkinson wilkinson特征值测试矩阵Zeros 全零矩阵 注:diag(A,n)以向量A为主对角线为基准偏移n个位置。 2.2 矩阵连接 水平c=[a,b]或者c=[a b] 垂直c=[a;b] 连接函数(1)Cat 指定方向;(2)Cat(1,a,b)水平;(3)Cat(2,a,b)垂直;(4)Horzcat 水平方向;(5)Vertcat 垂直方向(6)Repmat 对现有矩阵复制粘贴(7)Blkdiag 以对角阵方式重组。 2.3 改变矩阵形状 Reshape 制定行列重排;Rot90 逆时针90;Filplr 垂直方向为轴旋转180;Flipud 水平方向为轴旋转180;Flipdim 指定方向为轴翻转矩阵 2.4 向量生成函数 Linspace(a,b)首尾为a,b的100个数;Linspace(a,b,n) Logspace(a,b)以10为底;Logspace(a,b,n);Logspace(a,pi) 2.5 矩阵信息的获取 Isempty 判断为空;Isscalar 判断为标量;Isvector 判断向量;Issparse 判断稀疏矩阵;Isa 判断指定数据类型;Iscell 判断元胞数组类型;Iscellstr 元胞字符串数组类型;Isfloat 判断浮点数;Isinteger 判断整形类型;Islogical 判断逻辑类型Isnumeric 判断数值类型;Isreal 判断实数类型;Isstruct 判断结构体类型;Length 最长维长度;Ndims 维数;Numel 元素个数;Size 指定维长度 3 数据类型

第9章MATLAB符号计算_习题答案

第9章MATLAB符号计算 习题9 一、选择题 1 .设有a=sym(4)。则1/a+1/a 的值是( A . 0.5 B . 1/2 2 .函数factor(sym(15))的值是( A . '15' B. 15 3 .在命令行窗口输入下列命令: >> f=sym(1); >> eval(i nt(f,1,4)) 则命令执行后的输 出结果是 A . 3 4 . MATLAB A . tailor 5. MATLAB A . solve 二、填空题 1. 在进行符号运算之前首先要 建立符号对象,sym, syms 2. 对于“没有定义”的极限, 大的极限,MATLAB给出的结果为 3. 在命令行窗口输入下列命 令: >> syms n; >> s=symsu m(n ,1,10) 命令执行后s的 值是 ________________________ , 4. 在MATLAB 中,函数 )。B C . 1/4+1/4 D . 2/a )。D C . [ 1, 3, 5] D . [ 3, 5] ,所使用的函数或命令有__________ 和 ________________________________ 代表________ 。符号代数方程,求解变量 5. 在MATLAB符号计算中 三、应用题 1 .分解因式。 (1) x9-1 (3) 125X6+75X4+15X2+1)。A B . 4 C . 5 D . 1将函数展开为幕级数,所使用的函数是( )。D B . tayler C . diff 用于符号常微分方程求解的函数是( )。C B . solver C . dsolve D . taylor D . dsolver MATLAB给出的结果为 _________ ;对于极限值为无穷 _______ 。 NaN, Inf 55 solve(s,v)用于代数方程符号求解,其中s代表________ , v y的二阶导数表示为__________ 。D2y (2) X4+X3+2X2+X+1 / 、 2 2 2 (4) X +y +z +2(xy+yz+zx) (1):

Matlab常用工具箱及常用函数

Matlab常用工具箱 MATLAB包括拥有数百个内部函数的主包和三十几种工具包.工具包又可以分为功能性工具包和学科工具包.功能工具包用来扩充MATLAB的符号计算,可视化建模仿真,文字处理及实时控制等功能.学科工具包是专业性比较强的工具包,控制工具包,信号处理工具包,通信工具包等都属于此类. 开放性使MATLAB广受用户欢迎.除内部函数外,所有MATLAB主包文件和各种工具包都是可读可修改的文件,用户通过对源程序的修改或加入自己编写程序构造新的专用工具包. Matlab Main Toolbox——matlab主工具箱 Control System Toolbox——控制系统工具箱 Communication Toolbox——通讯工具箱 Financial Toolbox——财政金融工具箱 System Identification Toolbox——系统辨识工具箱 Fuzzy Logic Toolbox——模糊逻辑工具箱 Higher-Order Spectral Analysis Toolbox——高阶谱分析工具箱 Image Processing Toolbox——图象处理工具箱 LMI Control Toolbox——线性矩阵不等式工具箱 Model predictive Control Toolbox——模型预测控制工具箱 μ-Analysis and Synthesis Toolbox——μ分析工具箱 Neural Network Toolbox——神经网络工具箱 Optimization Toolbox——优化工具箱 Partial Differential Toolbox——偏微分方程工具箱 Robust Control Toolbox——鲁棒控制工具箱 Signal Processing Toolbox——信号处理工具箱 Spline Toolbox——样条工具箱 Statistics Toolbox——统计工具箱 Symbolic Math Toolbox——符号数学工具箱 Simulink Toolbox——动态仿真工具箱 Wavele Toolbox——小波工具箱 常用函数Matlab内部常数[3] eps:浮点相对精度 exp:自然对数的底数e i或j:基本虚数单位 inf或Inf:无限大, 例如1/0 nan或NaN:非数值(Not a number),例如0/0 pi:圆周率p(= 3.1415926...) realmax:系统所能表示的最大数值 realmin:系统所能表示的最小数值 nargin: 函数的输入引数个数 nargout: 函数的输出引数个数 lasterr:存放最新的错误信息 lastwarn:存放最新的警告信息 MATLAB常用基本数学函数 abs(x):纯量的绝对值或向量的长度 angle(z):复数z的相角(Phase angle)

相关主题
文本预览
相关文档 最新文档