Z-transform
collapse all in page
Syntax
ztrans(f)
ztrans(f,transVar)
ztrans(f,var,transVar)
Description
example
ztrans(f)
finds the Z-Transform of f
. By default, the independent variable is n
and the transformation variable is z
. If f
does not contain n
, ztrans
uses symvar
.
example
ztrans(f,transVar)
uses the transformation variable transVar
instead of z
.
example
ztrans(f,var,transVar)
uses the independent variable var
and transformation variable transVar
instead of n
and z
, respectively.
Examples
collapse all
Z-Transform of Symbolic Expression
Compute the Z-transform of sin(n)
. By default, the transform is in terms of z
.
syms nf = sin(n);ztrans(f)
ans =(z*sin(1))/(z^2 - 2*cos(1)*z + 1)
Specify Independent Variable and Transformation Variable
Compute the Z-transform of exp(m+n)
. By default, the independent variable is n
and the transformation variable is z
.
ans =(z*exp(m))/(z - exp(1))
Specify the transformation variable as y
. If you specify only one variable, that variable is the transformation variable. The independent variable is still n
.
syms yztrans(f,y)
ans =(y*exp(m))/(y - exp(1))
Specify both the independent and transformation variables as m
and y
in the second and third arguments, respectively.
ztrans(f,m,y)
ans =(y*exp(n))/(y - exp(1))
Z-Transforms Involving Heaviside Function and Binomial Coefficient
Compute the Z-transform of the Heaviside function and the binomial coefficient.
syms n zztrans(heaviside(n-3),n,z)
ans =(1/(z - 1) + 1/2)/z^3
ztrans(nchoosek(n,2))
ans =z/(z - 1)^3
Z-Transform of Array Inputs
Find the Z-transform of the matrix M
. Specify the independent and transformation variables for each matrix entry by using matrices of the same size. When the arguments are nonscalars, ztrans
acts on them element-wise.
syms a b c d w x y zM = [exp(x) 1; sin(y) i*z];vars = [w x; y z];transVars = [a b; c d];ztrans(M,vars,transVars)
ans =[ (a*exp(x))/(a - 1), b/(b - 1)][ (c*sin(1))/(c^2 - 2*cos(1)*c + 1), (d*1i)/(d - 1)^2]
If ztrans
is called with both scalar and nonscalar arguments, then it expands the scalars to match the nonscalars by using scalar expansion. Nonscalar arguments must be the same size.
syms w x y z a b c dztrans(x,vars,transVars)
ans =[ (a*x)/(a - 1), b/(b - 1)^2][ (c*x)/(c - 1), (d*x)/(d - 1)]
Z-Transform of Symbolic Function
Compute the Z-transform of symbolic functions. When the first argument contains symbolic functions, then the second argument must be a scalar.
syms f1(x) f2(x) a bf1(x) = exp(x);f2(x) = x;ztrans([f1 f2],x,[a b])
ans =[ a/(a - exp(1)), b/(b - 1)^2]
If Z-Transform Cannot Be Found
If ztrans
cannot transform the input then it returns an unevaluated call.
syms f(n)f(n) = 1/n;F = ztrans(f,n,z)
F =ztrans(1/n, n, z)
Return the original expression by using iztrans
.
iztrans(F,z,n)
ans =1/n
Input Arguments
collapse all
f
— Input
symbolic expression | symbolic function | symbolic vector | symbolic matrix
Input, specified as a symbolic expression, function, vector, or matrix.
var
— Independent variable
n
(default) | symbolic variable
Independent variable, specified as a symbolic variable. This variable is often called the "discrete time variable". If you do not specify the variable, then ztrans
uses n
. If f does not contain n
, then ztrans
uses the function symvar
.
transVar
— Transformation variable
z
(default) | symbolic variable | symbolic expression | symbolic vector | symbolic matrix
Transformation variable, specified as a symbolic variable, expression, vector, or matrix. This variable is often called the "complex frequency variable." By default, ztrans
uses z
. If z
is the independent variable of f, then ztrans
uses w
.
More About
collapse all
Z-Transform
The Z-transform F=F(z) of the expression f=f(n) with respect to the variable n
at the point z
is
Tips
If any argument is an array, then
ztrans
acts element-wise on all elements of the array.If the first argument contains a symbolic function, then the second argument must be a scalar.
To compute the inverse Z-transform, use
iztrans
.
Version History
Introduced before R2006a
See Also
fourier | ifourier | ilaplace | iztrans | kroneckerDelta | laplace
Topics
- Solve Difference Equations Using Z-Transform
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- Deutsch
- English
- Français
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本 (日本語)
- 한국 (한국어)
Contact your local office