Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to realize symbolic Operation in matlab

Shulou Source: shulou.com Published: 2022-06-01 06:30:57 10月02日 Update

This article mainly shows you "matlab how to achieve symbolic operations", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "how to achieve symbolic operations in matlab" this article.

Matlab symbolic operation

1. Establishment of symbolic objects: sym and syms

Symbolic variable = sym (A)

Syms symbol variable 1 symbol variable 2. Symbolic variable n

Syms a b c

The operators and basic functions used in Matlab symbolic operations are exactly the same as those in numerical computation in shape, name and use.

Find symbolic variables in symbolic expressions

Findsym (expr)% lists all symbolic variables in the symbolic expression expr in alphabetical order findsym (expr, N)% lists the N symbolic variables closest to x in expr in order to replace the specified symbolic variable subs in the symbolic expression with the given data.

Replace the character variable x in the character function f with a

A can be a number / numeric variable / expression or a character variable / expression. If x is an array or matrix of multiple character variables, then a should have an array or matrix of the same shape as x.

Factorization

Syms x _ (f) = x ^ 6 + 1 _ x _ factor (f)

Function expansion

Syms x * * f = (x * * 1) ^ 6 * (f)

Merge similar items

Collect (f): merge by specified variable v collect (f): merge by default variable

Function simplification

[How,y] = simple (f): y is the shortest form of f, and the method recorded in How is the method used in the simplification process.

Calculation limit

Imit: calculate limit (f): the limit limit when the default variable tends to a (f): the limit limit when calculating axiom 0 (f): calculate the right limit limit (f): calculate the left pole.

Calculation derivative

G=diff (f): find the derivative of the symbolic expression f with respect to v g=diff (f): find the derivative of the symbolic expression f with respect to the default variable g=diff (f, with respect to v): find the nth derivative of f with respect to v

Calculate integral

Int (f): calculate definite integral int (f): calculate definite integral about default variable int (f): calculate indefinite integral int (f): calculate indefinite integral with respect to default variable

Symbolic summation

Symsum (frecom v.pje b)

Solving algebraic equations solve (f): find the solution of the equation with respect to the specified independent variable, f can be an equation expressed by a string, a symbolic expression or a symbolic equation; solve can also solve the system of equations (including nonlinear); when the analytical solution is not obtained, the numerical solution is given.

Solution of differential equation

Y=dsolve ('eq1','eq2',...,' cond1','cond2',...,'v')

Where y is the solution of the output, eq1, eq2,. . . Is a differential equation

Cond1 、 cond2 、... It is the initial condition, v is the independent variable.

These are all the contents of the article "how to implement symbolic Operations in matlab". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Symbols variables expressions operations equations functions characters integrals derivatives limits content numerical values articles same differential equations indefinite integrals shapes differentials arrays matrices Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux vpn Docker MariaDB Huawei