0% found this document useful (0 votes)
2 views

MATLAB Programming Lecture 5

Uploaded by

Ahmed Lasheen
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

MATLAB Programming Lecture 5

Uploaded by

Ahmed Lasheen
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 31

for internal use only Automation

Dr./ Essam and


Nabil
Drives

Lecture No.“5”
SIMATIC HMI
MATLAB
The Human
Programming
Machine Interface
Introduction

MATLAB
MATLAB Basics

Vectors & Arrays

Math. Functions

Polynomials

MATLAB plotting

2-D & 3-D Graphics

Flow Control

System analysis
The Language of
Curve fitting Technical Computing
Symbolic math.

Signal processing
Prepared by:
Function m-file
Dr./ Essam Nabil
MATLAB Simulink

Final Test Faculty of Electronic Engineering Industrial Electronics and Automatic Control Engineering
for internal use only Automation
Dr./ Essam and
Nabil
Drives

Curve fitting
SIMATIC HMI
MATLAB You have some data and you want to find
The Human
Programming
Machine Interface the accurate relation that fits these data.
Introduction In many curve fitting applications, the
MATLAB Basics
objective is to estimate the coefficients of
Vectors & Arrays
a n-order polynomial. The polynomial is
Math. Functions
then used as a model for observed noisy
Polynomials
data. For example, if a quadratic
MATLAB plotting
polynomial is to be used, there are three
2-D & 3-D Graphics
coefficients (a, bthat
The polynomial and fits
c) to estimate:
best is defined as
Flow Control a x2 + b x + c =0the sum of the
the one that minimizes
System analysis
squared errors between itself and the
Curve fitting
noisy data.
Symbolic math.

Signal processing

Function m-file

MATLAB Simulink

Final Test Faculty of Electronic Engineering Industrial Electronics and Automatic Control Engineering
for internal use only Automation
Dr./ Essam and
Nabil
Drives

Curve fitting
SIMATIC HMI Measuring the concentration of a
MATLAB
The Human
Programming
Machine Interface
Experimentcompound in blood samples taken
Introduction
from several subjects at various
MATLAB Basics times after taking an
experimental medication.
Vectors & Arrays
time = [ 0.1 0.1 0.3 0.3 1.3 1.7 2.1
Math. Functions

Polynomials
2.6 3.9 3.9 5.1 5.6
MATLAB plotting
6.2 6.4 7.7 8.1 8.2 8.9 9.0
2-D & 3-D Graphics
9.5 9.6 10.2 10.3 10.8
Flow Control
11.2 11.2 11.2 11.7 12.1
System analysis 12.3 12.3 13.1 13.2 13.4
Curve fitting 13.7 14.0 14.3 15.4 16.1
Symbolic math. 16.1 16.4 16.4 16.7 16.7
Signal processing 17.5 17.6 18.1 18.5 19.3
Function m-file
19.7];
MATLAB Simulink
conc = [0.01 0.08 0.13 0.16 0.55
Final Test
0.90 1.11 1.62 1.79
Faculty of Electronic Engineering Industrial Electronics and Automatic Control Engineering
for internal use only Automation
Dr./ Essam and
Nabil
Drives

Curve fitting
SIMATIC HMI
MATLAB plot(time,conc,'o')
The Human
Programming
Machine Interface xlabel('Time')
Introduction ylabel('Blood Concentration')
MATLAB Basics

Vectors & Arrays

Math. Functions

Polynomials

MATLAB plotting

2-D & 3-D Graphics

Flow Control

System analysis

Curve fitting

Symbolic math.

Signal processing

Function m-file

MATLAB Simulink

Final Test Faculty of Electronic Engineering Industrial Electronics and Automatic Control Engineering
for internal use only Automation
Dr./ Essam and
Nabil
Drives

Polynomial Curve
>>p = polyfit(x,y,n) Fitting
% finds the
SIMATIC HMI
MATLAB
coefficients of an n –degree
The Human
Programming
Machine Interface polynomial p
Introduction that fits a set of data (x ,y)
MATLAB Basics Example:
Vectors & Arrays >>x = [1 2 3 4 5];
Math. Functions >>y = [5.5 43.1 128 290.7 498.4];
Polynomials >>p = polyfit(x,y,3)
MATLAB plotting >> pyi== polyval(p,xi) %returns the
2-D & 3-D Graphics
value(s)-0.1917 31.5821 -60.3262
yi of an n-degree
Flow Control
35.3400 polynomial p
System analysis
evaluated at value(s) xi
Example:
Curve fitting
>> yi = polyval(p,7.5)
Symbolic math.
yi =
Signal processing
1.2785e+003
Function m-file
Note: Each value of the vector yi represents
MATLAB Simulink
the corresponding
Final Test Faculty of Electronicsubstitution
Engineering with values of vector
Industrial Electronics and Automatic Control Engineering
for internal use only Automation
Dr./ Essam and
Nabil
Drives

Polynomial Curve Fitting


clear all , close all , clc
SIMATIC HMI
MATLAB
The Human
x=[0 0.1 0.2 0.3 0.4 0.5 0.6 0.7
Programming
Machine Interface 0.8 0.9 1];
Introduction
y=[ -0.447 1.478 3.28 6.16 7.08 7.84
MATLAB Basics
7.66 9.56 9.48 9.8 11.3];
Vectors & Arrays
n=2;
Math. Functions
p=polyfit(x,y,n)
Polynomials
xi=linspace(0,1,11);
MATLAB plotting
yi=polyval(p,xi);
2-D & 3-D Graphics plot(x,y, '-o' , xi,yi, '--' )
Flow Control xlabel( 'X' )
System analysis ylabel( 'F(x)' )
Curve fitting title( 'Curve Fitting' )
Symbolic math.

Signal processing

Function m-file

MATLAB Simulink

Final Test Faculty of Electronic Engineering Industrial Electronics and Automatic Control Engineering
for internal use only Automation
Dr./ Essam and
Nabil
Drives

Analyzing residuals
SIMATIC HMI
MATLAB Example:
The Human Residuals :represent the difference
Programming
Machine Interface clear all , close all , clc
between the real data and the estimated
Introduction x=[0 0.1 0.2 0.3 0.4 0.5 0.6 0.7
MATLAB Basics data0.9
0.8 that1];used to measure goodness of
Vectors & Arrays
y=[-2.1 -1.12 0.9 fitting.
1.44 2.1 2.4 2.77
Math. Functions
3.6 4.1 4.66 4.9];
Polynomials p1=polyfit(x,y,1) % polynomial of
MATLAB plotting degree 1
2-D & 3-D Graphics p2=polyfit(x,y,4) % polynomial of
Flow Control degree 4
System analysis

Curve fitting xi=linspace(0,1,11);


Symbolic math. yi1=polyval(p1,xi);
Signal processing yi2=polyval(p2,xi);
Function m-file

MATLAB Simulink res1 = y - yi1; % residual for


Final Test polynomial p1
Faculty of Electronic Engineering Industrial Electronics and Automatic Control Engineering
for internal use only Automation
Dr./ Essam and
Nabil
Drives

subplot(221) Analyzing residuals


plot(x,y,'o',xi,yi1),
SIMATIC HMI
MATLAB
The Human
Programming
grid on
Machine Interface
xlabel('X')
Introduction
ylabel('F(x)')
MATLAB Basics

Vectors & Arrays


subplot(222)
Math. Functions
plot(x,y,
'o',xi,yi2),grid on
Polynomials
xlabel('X')
MATLAB plotting
ylabel('F(x)')
2-D & 3-D Graphics
subplot(223)
Flow Control
plot(xi,res1,'+:'),g
System analysis
rid on
Curve fitting
xlabel('X')
Symbolic math.
ylabel('Residual')
Signal processing
subplot(224)
Function m-file plot(xi,res2,'+:'),g
MATLAB Simulink rid on
Final Test xlabel('X')
Faculty of Electronic Engineering Industrial Electronics and Automatic Control Engineering
for internal use only Automation
Dr./ Essam and
Nabil
Drives

Basic Fitting GUI


SIMATIC HMI
MATLAB
The Human
Programming
Machine Interface
Introduction
MATLAB Basics

Vectors & Arrays

Math. Functions

Polynomials

MATLAB plotting

2-D & 3-D Graphics

Flow Control

System analysis

Curve fitting

Symbolic math.

Signal processing

Function m-file

MATLAB Simulink

Final Test Faculty of Electronic Engineering Industrial Electronics and Automatic Control Engineering
for internal use only Automation
Dr./ Essam and
Nabil
Drives

Basic Fitting GUI


SIMATIC HMI
MATLAB
The Human
Programming
Steps for using the Basic Fitting GUI :
Machine Interface
Introduction 1. plot your data in a figure window, (only)
MATLAB Basics x and y data.
Vectors & Arrays 2. Open the Basic Fitting GUI from Tools >
Math. Functions Basic Fitting in the Figure window.
Polynomials

MATLAB plotting

2-D & 3-D Graphics

Flow Control

System analysis

Curve fitting

Symbolic math.

Signal processing

Function m-file

MATLAB Simulink

Final Test Faculty of Electronic Engineering Industrial Electronics and Automatic Control Engineering
for internal use only Automation
Dr./ Essam and
Nabil
Drives

Basic Fitting GUI


SIMATIC HMI
MATLAB
The Human
Programming
3. Click the buttons to show
Machine Interface
Numerical results panel.
Introduction
MATLAB Basics

Vectors & Arrays

Math. Functions

Polynomials

MATLAB plotting

2-D & 3-D Graphics

Flow Control

System analysis

Curve fitting

Symbolic math.

Signal processing

Function m-file

MATLAB Simulink

Final Test Faculty of Electronic Engineering Industrial Electronics and Automatic Control Engineering
for internal use only Automation
Dr./ Essam and
Nabil
Drives

Basic Fitting GUI


SIMATIC HMI
MATLAB
The Human
4. Selecting Plot residuals creates a subplot
Programming
Machine Interface of them as a bar graph.
Introduction
MATLAB Basics

Vectors & Arrays

Math. Functions

Polynomials

MATLAB plotting

2-D & 3-D Graphics

Flow Control

System analysis

Curve fitting

Symbolic math.

Signal processing

Function m-file

MATLAB Simulink

Final Test Faculty of Electronic Engineering Industrial Electronics and Automatic Control Engineering
for internal use only Automation
Dr./ Essam and
Nabil
Drives

Symbolic Math. Toolbox


SIMATIC HMI
MATLAB  Symbolic Math Toolbox™ allows you to perform
The Human
Programming
Machine Interface math. operations in the MATLAB
Introduction workspace analytically, without
MATLAB Basics
calculating numeric values.
Vectors & Arrays Example:
Math. Functions >>syms a b c x
Polynomials >>f
You=can a*x^2 + b*x + c;
use symbolic objects to perform a
MATLAB plotting
wide variety of analytical computations:
2-D & 3-D Graphics
 Addition, subtraction, multiplication,
Flow Control
division
System analysis  Differentiation, definite and indefinite
Curve fitting integration, limits
Symbolic math.  Solving algebraic and differential
Signal processing
equations
Function m-file  Summation, special math. functions
MATLAB Simulink  Integral transforms e.g. Fourier
Final Test transform,
Faculty Laplace transform,
of Electronic Engineering Industrial Electronics andand
Automatic Z-
Control Engineering
for internal use only Automation
Dr./ Essam and
Nabil
Drives

Symbolic Math. Toolbox


SIMATIC HMI
Conversion between symbolic expression and polyn
MATLAB
The Human
Programming
Machine Interface
Introduction
MATLAB Basics f(x)= x2+x+2
Vectors & Arrays

Math. Functions

Polynomials

MATLAB plotting
Symbolic
Polynomial
2-D & 3-D Graphics
expression
P=[1 1 2]
Flow Control
f=x^2+x+2
System analysis
Example: Example:
Curve fitting >>syms x >>syms x
Symbolic math.
>>p=[1 1 >>f = x^2 + x
Signal processing
2]; + 2;
Function m-file >>f=poly2sym >>p=sym2poly
MATLAB Simulink (p) (f )
Final Test Faculty off=
Electronic Engineering Industrial Electronicsp=
and Automatic Control Engineering
for internal use only Automation
Dr./ Essam and
Nabil
Drives

Symbolic Math. Toolbox


SIMATIC HMI
MATLAB
The Human
Programming
Operations on symbolic expression:
Machine Interface
Introduction >>syms x f g
MATLAB Basics >>f= (2*x^2) + (3*x) – 5;
Vectors & Arrays >>g= x^2 - x+7;
Math. Functions >>h1=symsum(f,g) %Symbolic
Polynomials addition
MATLAB plotting >>h1=symsub(f,g) %Symbolic
2-D & 3-D Graphics subtraction
Flow Control >>h1=symmul(f,g)
Also we have: %Symbolic
System analysis
multiplication
Curve fitting
>>h1=symdiv(f,g) %Symbolic
Symbolic math.
division
Signal processing

Function m-file

MATLAB Simulink

Final Test Faculty of Electronic Engineering Industrial Electronics and Automatic Control Engineering
for internal use only Automation
Dr./ Essam and
Nabil
Drives

Symbolic Math. Toolbox


SIMATIC HMI
MATLAB
The Human Example:
Programming
Machine Interface
>>syms k
Introduction
>>f=1/(k^2);
MATLAB Basics
>>s1=symsum(f, k, 1,
Vectors & Arrays
inf )
Math. Functions
Symbolic substitution in symbolic expression:
Polynomials

MATLAB plotting >>R = subs(S, old, new) %replaces


2-D & 3-D Graphics old with new in the
Flow Control symbolic
Example:
System analysis expression S.
>>syms x y f
Curve fitting
>>f= (2*x^2) + (3*x) – 5;
Symbolic math.
>> g = subs(f, x, y)
Signal processing
g=
Function m-file
2*y^2 + 3*y - 5
MATLAB Simulink

Final Test Faculty of Electronic Engineering Industrial Electronics and Automatic Control Engineering
for internal use only Automation
Dr./ Essam and
Nabil
Drives

Symbolic Math. Toolbox


SIMATIC HMI
MATLAB
The Human
Programming
Limits:
Machine Interface
Introduction
MATLAB Basics

Vectors & Arrays

Math. Functions

Polynomials

MATLAB plotting

2-D & 3-D Graphics

Flow Control

System analysis Example:


Curve fitting
>>syms h x
Symbolic math. >>f=(cos(h+x)-cos(x))/h;
Signal processing >>limit(f, h, 0)
Function m-file
ans =
MATLAB Simulink
-sin(x)
Final Test Faculty of Electronic Engineering Industrial Electronics and Automatic Control Engineering
for internal use only Automation
Dr./ Essam and
Nabil
Drives

Symbolic Math. Toolbox


SIMATIC HMI
MATLAB
The Human
Programming
Differentiation:
Machine Interface
Introduction
MATLAB Basics

Vectors & Arrays

Math. Functions

Polynomials

MATLAB plotting

2-D & 3-D Graphics


Example:
>>syms x
Flow Control
>>f=exp(x)*cos(x);
System analysis
>>diff(f)
Curve fitting
ans =
Symbolic math.
exp(x)*cos(x) -
Signal processing
exp(x)*sin(x)
Function m-file
>>diff(f,2)
MATLAB Simulink
ans =
Final Test
-2*exp(x)*sin(x)
Faculty of Electronic Engineering Industrial Electronics and Automatic Control Engineering
for internal use only Automation
Dr./ Essam and
Nabil
Drives

Symbolic Math. Toolbox


SIMATIC HMI
MATLAB
The Human
Programming
Integration :
Machine Interface
Introduction
MATLAB Basics

Vectors & Arrays

Math. Functions

Polynomials

MATLAB plotting

2-D & 3-D Graphics

Flow Control

System analysis

Curve fitting

Symbolic math.

Signal processing

Function m-file

MATLAB Simulink

Final Test Faculty of Electronic Engineering Industrial Electronics and Automatic Control Engineering
for internal use only Automation
Dr./ Essam and
Nabil
Drives

Plotting Symbolic expressions


SIMATIC HMI
MATLAB
The Human
Programming
2-D Graphics:
Machine Interface
Introduction >>ezplot(f) %plots the
MATLAB Basics expression f = f(x) over the
Vectors & Arrays default domain
Math. Functions –2π < x < 2π.
Polynomials >>ezplot(f,[xmin xmax]) %plots the
MATLAB plotting expression f = f(x)
2-D & 3-D Graphics over the
Flow Control specified domain.
System analysis
>>ezplot(f,[xmin, xmax, ymin, ymax])
Curve fitting
%plots f(x,y) = 0 over
Example: xmin < x < xmax
Symbolic math.
>>syms
and ymin < yy < t ymax.
Signal processing
>>f=-16*t^2+64*t+96;
>> ezplot(x,y) %plots the
Function m-file
>>ezplot(f ) defined planar
parametrically
MATLAB Simulink
curve x = x(t) and y
Final Test Faculty of Electronic Engineering Industrial Electronics and Automatic Control Engineering
= y(t) over the default
for internal use only Automation
Dr./ Essam and
Nabil
Drives

Plotting Symbolic expressions


SIMATIC HMI
MATLAB
The Human
Programming
Also for polar plots we have:
Machine Interface
Introduction >>ezpolar(f) %plots the polar
MATLAB Basics

Vectors & Arrays


curve r = f(θ) over the
Math. Functions
default domain
Polynomials
0 < θ < 2π.
>>ezpolar(f, [a, b]) %plots f for a < θ <
MATLAB plotting
b.
2-D & 3-D Graphics
Example:
Flow Control
>>syms t
System analysis
>>ezpolar(1 +
Curve fitting
cos(t))
Symbolic math.

Signal processing

Function m-file

MATLAB Simulink

Final Test Faculty of Electronic Engineering Industrial Electronics and Automatic Control Engineering
for internal use only Automation
Dr./ Essam and
Nabil
Drives

Plotting Symbolic expressions


SIMATIC HMI
MATLAB
The Human
Programming
3-D Graphics:
Machine Interface
Introduction
>>ezplot3(x,y,z) %plots the spatial
MATLAB Basics curve x = x(t), y = y(t),
Vectors & Arrays and z = z(t) over
Math. Functions the default domain
Polynomials 0 < t < 2π.
MATLAB plotting >>ezplot3(x,y,z,[tmin, tmax]) %plots the
2-D & 3-D Graphics
curve x = x(t), y=y(t)
Flow Control
Example: , and z
=>>syms
z(t) over the
x ydomain
z t;
System analysis
>>x=sin(t); tmin <
Curve fitting
t >>y=cos(t);
< tmax.
Symbolic math.

Signal processing
>>z=t;
>>ezplot3(x,y,z,[0, 6*pi])
Function m-file

MATLAB Simulink

Final Test Faculty of Electronic Engineering Industrial Electronics and Automatic Control Engineering
for internal use only Automation
Dr./ Essam and
Nabil
Drives

Plotting Symbolic expressions


SIMATIC HMI
MATLAB
The Human
Programming
Similarly for surface plotting:
Machine Interface
Introduction
>>ezcontour(f) %plots the contour
MATLAB Basics
lines
Vectors & Arrays >>ezcontourf(f) %plots the color
Math. Functions filled contour
Polynomials >>ezmesh(f) %plots 3-D mesh
MATLAB plotting
>>ezmeshc(f) %a mesh/contour
2-D & 3-D Graphics
graph of the expression
Flow Control >>ezsurf(f) %3-D colored surface
System analysis plotter
Curve fitting
>>ezsurf(f) %Combined surface
Symbolic math.
and contour plotter
Signal processing Solve the equation:
Function m-file exp(x)=tan(x)
MATLAB Simulink

Final Test Faculty of Electronic Engineering Industrial Electronics and Automatic Control Engineering
for internal use only Automation
Dr./ Essam and
Nabil
Drives

Solving algebraic and differential equations


SIMATIC HMI
MATLAB
The Human
Programming
Solving algebraic equations:
Machine Interface
Introduction >> solve(eq) %solves the
MATLAB Basics equation eq = 0 for its default
Vectors & Arrays variable (as
Math. Functions determined by syms var).
Polynomials

MATLAB plotting >>solve(eq, var) %solves the equation


2-D & 3-D Graphics eq = 0 for the
Flow Control variable var.
System analysis

Curve fitting
>> solve(eq1, eq2, ..., eqn) %solves the
Symbolic math. system of equations
Signal processing

Function m-file
eq1,eq2,...,eqn in the n variables
MATLAB Simulink

Final Test
determined by syms vars.
Industrial Electronics and Automatic Control Engineering
Faculty of Electronic Engineering
for internal use only Automation
Dr./ Essam and
Nabil
Drives

Solving algebraic and differential equations


SIMATIC HMI
MATLAB Example1:
The Human
Programming
Machine Interface
Introduction
>> syms x
MATLAB Basics >> x=solve('exp(x)=tan(x)')
Vectors & Arrays x=
Math. Functions -
Polynomials 226.19467105846511316931032359
MATLAB plotting
612
2-D & 3-D Graphics

Flow Control Example2:


System analysis

Curve fitting
clear all ,clc
Symbolic math.
syms n p q d
Signal processing e1='d^2+(n+p)/2=q';
Function m-file e2='p=n+d+q-10';
MATLAB Simulink e3='q+d=p+n/4';
Final Test e4='q+p=n+8*d-1';
Faculty of Electronic Engineering Industrial Electronics and Automatic Control Engineering
for internal use only Automation
Dr./ Essam and
Nabil
Drives

Solving algebraic and differential equations


SIMATIC HMI
MATLAB
The Human
Programming
Solving differential equations:
Machine Interface
Introduction >>dsolve('eq1','eq2',...,'cond1','cond2',...,'v'
MATLAB Basics )
Vectors & Arrays %symbolically solves the
Math. Functions ordinary differential
Polynomials equations eq1, eq2,...
MATLAB plotting using v as the independent
2-D & 3-D Graphics variable. Here
Flow Control cond1,cond2,... specify boundary
System analysis or initial conditions or
Curve fitting
both.
Symbolic math. Notes:
Signal processing 1. The default independent variable is t.
Function m-file 2. The letter D denotes differentiation
MATLAB Simulink with respect to the independent
Final Test Facultyvariable.
of Electronic Engineering Industrial Electronics and Automatic Control Engineering
for internal use only Automation
Dr./ Essam and
Nabil
Drives

Solving algebraic and differential equations


SIMATIC HMI
MATLAB Example1:
The Human
Programming
Machine Interface
Introduction
MATLAB Basics >> y=dsolve('Dy=1+y^2', 'y(0)=1')
Vectors & Arrays y=
Math. Functions tan(pi/4 + t)
Polynomials Example2:
MATLAB plotting

2-D & 3-D Graphics


>> y=dsolve('D2y=cos(2*t)-y', ' Dy(0)=0' , '
Flow Control
y(0)=1')
System analysis
y = (5*cos(t))/3 + sin(t)*(sin(3*t)/6 +
Curve fitting sin(t)/2) - …
Symbolic math. >>ezplot(y)
Signal processing

Function m-file

MATLAB Simulink

Final Test Faculty of Electronic Engineering Industrial Electronics and Automatic Control Engineering
for internal use only Automation
Dr./ Essam and
Nabil
Drives

Integral Transforms
SIMATIC HMI
MATLAB
The Human
Programming
Machine Interface
t-domain
Laplace transform: s-domain
Introduction
MATLAB Basics

Vectors & Arrays

Math. Functions >> F = laplace(f) %Finds


Polynomials Laplace transform
>> f = ilaplace(F) %Finds inverse
MATLAB plotting
Example1: Example2:
Laplace transform
2-D & 3-D Graphics >>syms t a >>syms a s
Flow Control x >>F = 1/(s-a)^2;
System analysis >>f = t^4; >>f=ilaplace(F)
Curve fitting
>>T=laplace(f ) f=
Symbolic math.
T= t*exp(a*t)
24/s^5 >>G = 1/s^2;
Signal processing
>>g= exp(-a*t); >>g=ilaplace(G)
Function m-file
>>G=laplace(g,x) g=
MATLAB Simulink G= t
Final Test 1/(a
Faculty of Electronic + x)
Engineering Industrial Electronics and Automatic Control Engineering
for internal use only Automation
Dr./ Essam and
Nabil
Drives

Integral Transforms
SIMATIC HMI
MATLAB
The Human
Programming
Machine Interface
t-domain
Fourier transform: ω -domain
Introduction
MATLAB Basics

Vectors & Arrays

Math. Functions >> F = fourier(f) %Finds Fourier


Polynomials transform
>> f = ifourier(F) %Finds inverse
MATLAB plotting Example1:
2-D & 3-D Graphics
Fourier
>>symstransform
x t
Flow Control >>f = exp(-x^2); Example2:
System analysis
>>F=fourier(f) >>syms a w
F= >>F =
Curve fitting
w/(w^2+a^2);
Symbolic math.
pi^(1/2)/exp(w^2/4) >>f=ifourier (F)
Signal processing
>>g= sin(t); f=
Function m-file >>G=fourier(g) cos(a*t)
MATLAB Simulink G=
Final Test -pi*(dirac(w
Faculty - 1) -
of Electronic Engineering Industrial Electronics and Automatic Control Engineering
for internal use only Automation
Dr./ Essam and
Nabil
Drives

Integral Transforms
SIMATIC HMI
MATLAB
Z- transform: F(z)
The Human
Programming
Machine Interface f(n)
Introduction
MATLAB Basics

Vectors & Arrays

Math. Functions

Polynomials
>> F = ztrans (f) %Finds Z-
MATLAB plotting
transform
2-D & 3-D Graphics
>> f = iztrans (F) %Finds
Flow Control
Example1:
inverse Z-transform Example2:
System analysis >>syms n >>syms z
Curve fitting >>f = n^4; >>f = 2*z/(z-
Symbolic math. >>F=ztrans(f) 2)^2;
Signal processing F= >>F=iztrans(f)
Function m-file
(z^4 + 11*z^3 + F=
11*z^2 + z)/(z - 1)^5 2^n +
MATLAB Simulink
2^n*(n - 1)
Final Test Faculty of Electronic Engineering Industrial Electronics and Automatic Control Engineering
for internal use only Automation
Dr./ Essam and
Nabil
Drives

End of Lecture No. “5”


SIMATIC HMI
MATLAB
The Human
Programming
Machine Interface
Introduction
MATLAB Basics

Vectors & Arrays

Math. Functions

Polynomials

MATLAB plotting

2-D & 3-D Graphics

Flow Control

System analysis

Curve fitting

Symbolic math.

Signal processing

Function m-file

MATLAB Simulink

Final Test Faculty of Electronic Engineering Industrial Electronics and Automatic Control Engineering

You might also like