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

MATLAB Programming Lecture 3

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)
15 views

MATLAB Programming Lecture 3

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/ 36

for internal use only Automation

Dr./ Essam and


Nabil
Drives

Lecture No.“3”
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

2-D Graphics
bar(Y) :draws one bar for each element
SIMATIC HMI
MATLAB
The Human
2.
in Bar
Y. Graphs
Programming
Machine Interface
bar(X,Y) :draws a bar for each element in
Introduction
MATLAB Basics
Y at locations
Vectors & Arrays specified in X
Math. Functions bar(X,Y,width) :draws a bar for each
Polynomials element in Y at
MATLAB plotting locations specified in X
2-D & 3-D Graphics with relative
Flow Control bar width and controls
System analysis the separation of
Curve fitting bars. The default width
Symbolic math.
is 0.8, If width is
Signal processing
1, the bars within a
Function m-file
group touch one
MATLAB Simulink
another. The value of
Final Test
width must be a
Faculty of Electronic Engineering Industrial Electronics and Automatic Control Engineering
for internal use only Automation
Dr./ Essam and
Nabil
Drives

2-D Graphics
SIMATIC HMI
MATLAB
The Human
Programming
Machine Interface
Introduction x=-
MATLAB Basics 2.9:0.2:2.9;
Vectors & Arrays
y=exp(-
Math. Functions
x.*x);
Polynomials
bar(x,y)
MATLAB plotting

2-D & 3-D Graphics

Flow Control

System analysis

Curve fitting
x=-
Symbolic math.
2.9:0.2:2.9;
Signal processing y=exp(-x.*x);
Function m-file barh(x,y,0.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

2-D Graphics
SIMATIC HMI
MATLAB
The Human
Programming
Machine Interface
Introduction
stem(Y) :plots the data sequence Y
MATLAB Basics as stems.
Vectors & Arrays stem(X,Y) :plots X versus the columns
Math. Functions of Y.
Polynomials stem(X,Y,'fill') :specifies whether to color
MATLAB plotting the circle at
2-D & 3-D Graphics the end of the stem.
Flow Control

System analysis t=0:0.25:10


Curve fitting ;
Symbolic math.
y=sin(t);
Signal processing
stem(t,y,'fil
Function m-file
l')
MATLAB Simulink

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

2-D Graphics
SIMATIC HMI
MATLAB
The Human
Programming
Machine Interface
Introduction hist(Y) : produces a histogram plot that
MATLAB Basics distributes the
Vectors & Arrays bins along the x-axis between the
Math. Functions
minimum and
Polynomials
maximum values of Y.
MATLAB plotting
hist(Y,x) :returns the distribution of Y
2-D & 3-D Graphics
among length(x)
Flow Control

System analysis clear,clc


Curve fitting x=-2.9:0.2:2.9;
Symbolic math. y=randn(5000,4);
Signal processing hist(y,x)
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

2-D Graphics
SIMATIC HMI
MATLAB
The Human
3. Area Graphs
Programming
Machine Interface
Introduction
area(Y) :plots the vector Y and fills the
MATLAB Basics
area beneath
Vectors & Arrays

Math. Functions
each curve.
Polynomials
area(X,Y) :For vectors X and Y, area(X,Y) is
MATLAB plotting
the same as
2-D & 3-D Graphics
plot(X,Y) except that the area
Flow Control
between 0 and Y
System analysis
is filled.
Curve fitting
t=0:0.01:2*
Symbolic math. pi;
Signal processing y=sin(t);
Function m-file area(t,y)
MATLAB Simulink

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

2-D Graphics
SIMATIC HMI
MATLAB
The Human
Programming
Machine Interface
Introduction fill(X,Y,’ColorSpec’) :fills two-dimensional
MATLAB Basics plot of X
Vectors & Arrays
and Y with the
Math. Functions
color specified by
Polynomials
’ColorSpec’.
MATLAB plotting

2-D & 3-D Graphics

Flow Control
x=[-3 0
System analysis
3];
Curve fitting

Symbolic math.
y=[0 3
Signal processing
0];
Function m-file
fill(x,y,'r')
MATLAB Simulink

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

2-D Graphics
SIMATIC HMI
MATLAB
The Human
Programming clear all, close
Machine Interface
all, clc
Introduction
x=[0 0 1 1]; clear all, close all,
MATLAB Basics
y1=[0 0.5 0.5 clc
Vectors & Arrays

Math. Functions 0]; x1=[0 0 1 1];


Polynomials y2=[0.5 1 1 x2=[0 0 0.3];
MATLAB plotting 0.5]; y1=[0 0.5 0.5
2-D & 3-D Graphics y3=[1 1.5 1.5 0];
1]; y2=[0.5 1 1
Flow Control

fill(x,y1,'k'), hold 0.5];


System analysis clear all, close
on y3=[1 1.5 1.5
Curve fitting all, clc
fill(x,y2,'w'), 1];
Symbolic math. t=linspace(- hold
on y4=[0 1.5
Signal processing pi,pi);
fill(x,y3,'r') 0.75]
Function m-file x=cos(t);
fill(x1,y1,'g'), hold
MATLAB Simulink y=sin(t);
on
Final Test fill(x,y,'r')
Faculty of Electronic Engineering Industrial Electronics and Automatic Control Engineering
for internal use only Automation
Dr./ Essam and
Nabil
Drives

2-D Graphics
SIMATIC HMI
MATLAB
The Human
 Design of traffic stop sign:
Programming
Machine Interface t=(1:2:15)*pi/8;
Introduction x=sin(t);
MATLAB Basics y=cos(t);
Vectors & Arrays fill(x,y,'r')
Math. Functions axis off
Polynomials text(-0.55,0,'STOP',…
MATLAB plotting 'Color',[1 1
2-D & 3-D Graphics
1],'Fontsize',70)
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

2-D Graphics
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

2-D Graphics
SIMATIC HMI
MATLAB
The Human
Programming
Machine Interface
Introduction pie(X) :draws a pie chart using the data
MATLAB Basics in X. Each
Vectors & Arrays
element in X is represented as a
Math. Functions
slice in the pie
Polynomials
chart.
MATLAB plotting a=[0.5 1.6 1.2 0.8
2-D & 3-D Graphics 2.1];
Flow Control pie(a)
System analysis pause
Curve fitting pie(a,a==.8)
Symbolic math. pause
Signal processing
pie(a,a==max(a))
Function m-file
pause
MATLAB Simulink
pie(a,a==min(a))
Final Test Faculty of Electronic Engineering Industrial Electronics and Automatic Control Engineering
for internal use only Automation
Dr./ Essam and
Nabil
Drives
pie(X,explode) :offsets a slice from the pie.
explode is a 2-D Graphics
SIMATIC HMI
MATLAB
vector or matrix of zeros
The Human
Programming
Machine Interface and nonzeros
Introduction that correspond to X. A
MATLAB Basics
nonzero value
Vectors & Arrays
offsets the corresponding
Math. Functions
slice from the
Polynomials
center of the pie chart,
MATLAB plotting
explode must be
2-D & 3-D Graphics
the same size as X.
Flow Control

System analysis
a=[0.5 1.6 1.2 0.8
Curve fitting
2.1];
Symbolic math.
explode=[0 1 0 0
Signal processing 0]
Function m-file pie(a,explode)
MATLAB Simulink

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

2-D Graphics
SIMATIC HMI
MATLAB
The Human
4. Radial Graphs
Programming
Machine Interface
Introduction
MATLAB Basics polar(theta,rho) :creates a polar
Vectors & Arrays
coordinate plot of the
Math. Functions
angle theta versus the
Polynomials
radius rho.
MATLAB plotting

2-D & 3-D Graphics


clear all,close
Flow Control
all,clc
System analysis
t = 0:0.01:2*pi;
Curve fitting

Symbolic math.
y=sin(2*t).*cos(2*t
Signal processing
);
Function m-file polar(t,y,'r*:')
MATLAB Simulink

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

2-D Graphics
Application: Radiation pattern of
SIMATIC HMI
MATLAB
The Human
Programming
antenna
Machine Interface
This example represent the radiation of
Introduction
MATLAB Basics
bidirectional antenna that called by” figure of
Vectors & Arrays eight” described by:
Math. Functions E=cos((ᴨ/2)*cos(Ө))
Polynomials

MATLAB plotting

2-D & 3-D Graphics


clear all,close all,clc
Flow Control
theta=linspace(0,2*pi,
System analysis
200);
Curve fitting
E=cos((pi/
Symbolic math. 2)*cos(theta));
Signal processing polar(theta,abs(E))
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

2-D Graphics
SIMATIC HMI
MATLAB
The Human
5. Direction Graphs
Programming
Machine Interface
comet(y) :displays an animated comet
Introduction
graph of the
MATLAB Basics

Vectors & Arrays


vector y.
Math. Functions comet(x,y) :displays an animated comet
Polynomials graph of vector
MATLAB plotting y versus vector x.
2-D & 3-D Graphics comet(x,y,p) : displays an animated
Flow Control comet graph
System analysis and specifies a comet
Curve fitting body of length
Symbolic math. p*length(y). p defaults to
t=-
Signal processing 0.1.
Function m-file
10*pi:0.01:10*pi;
MATLAB Simulink
y = sin(t);
Final Test comet(t,y)
Faculty of Electronic Engineering Industrial Electronics and Automatic Control Engineering
for internal use only Automation
Dr./ Essam and
Nabil
Drives

2-D Graphics
SIMATIC HMI
MATLAB
The Human
subplot
Creating ( m,n,p)
custom plots: : divides the current figure
Programming
Machine Interface into rectangular
Introduction panes as a matrix of
MATLAB Basics subfigures (mxn) that are
Vectors & Arrays numbered rowwise as p.
Math. Functions Each pane contains
Polynomials
an axes object.
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

2-D Graphics
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

2-D Graphics
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

2-D Graphics
SIMATIC HMI
MATLAB
The Human
Programming
t =linspace(-
Machine Interface
10,10,100);
Introduction
y1=sin(t);
MATLAB Basics
y2= sinc(t);
Vectors & Arrays
y3 = square(t);
Math. Functions y4 = sawtooth(t);
Polynomials subplot(221)
MATLAB plotting plot(t,y1),grid on
2-D & 3-D Graphics
title('sin wave')
subplot(222)
Flow Control
plot(t,y2),grid on
System analysis
title('sinc wave')
Curve fitting subplot(223)
Symbolic math. plot(t,y3),grid on
Signal processing title('square wave')
Function m-file subplot(224)
MATLAB Simulink
plot(t,y4),grid on
Final Test
title('sawtooth wave')
Faculty of Electronic Engineering Industrial Electronics and Automatic Control Engineering
for internal use only Automation
Dr./ Essam and
Nabil
Drives

2-D Graphics
subplot('Position',[left bottom width
SIMATIC HMI
height]) :creates an
MATLAB
The Human
Programming
axes at the position
Machine Interface
specified by a four-element
Introduction
vector. left, bottom, width,
MATLAB Basics
and height are in
Vectors & Arrays
normalized coordinates in
Math. Functions the range from 0 to 1
Polynomials
t =linspace(-10,10,100);
y1=sin(t);
MATLAB plotting
y2= sinc(t);
2-D & 3-D Graphics

Flow Control subplot('position',[0.15 0.45 0.7


0.45])
System analysis
plot(t,y1,'linewidth',2),grid on
Curve fitting title('sin wave')
Symbolic math.

Signal processing subplot('position',[0.15 0.1 0.7


0.25])
Function m-file
plot(t,y2,'linewidth',2),grid on
MATLAB Simulink title('sinc wave')
Final Test Faculty of Electronic Engineering Industrial Electronics and Automatic Control Engineering
for internal use only Automation
Dr./ Essam and
Nabil
Drives

3-D Graphics
SIMATIC HMI
MATLAB
The Human
1. Line Graphs:
Programming
Machine Interface
Introduction
MATLAB Basics

Vectors & Arrays plot3(X,Y,Z) : displays a three-


Math. Functions dimensional plot of a set
Polynomials of data points of the
MATLAB plotting vectors X , Y ,Z.
2-D & 3-D Graphics
z=linspace(0,10*pi);
Flow Control
x=sin(z);
System analysis
y=cos(z);
Curve fitting
plot3(x,y,z)
Symbolic math. grid on
Signal processing box on
Function m-file axis square
MATLAB Simulink

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

3-D Graphics
mesh(X,Y,Z) :draws a wireframe mesh
SIMATIC HMI
MATLAB
The Human
2. Mesh & surface Graphs:
with color
Programming
Machine Interface
determined by Z so color
Introduction
MATLAB Basics
is proportional
Vectors & Arrays to surface height. If X and
Math. Functions Y are vectors,
Polynomials length(X) = n and
MATLAB plotting length(Y) = m, where
2-D & 3-D Graphics [m,n] = size(Z).
Flow Control

System analysis
[X,Y,Z] =
Curve fitting
peaks(30);
Symbolic math. mesh(X,Y,Z)
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

3-D Graphics
SIMATIC HMI
MATLAB
The Human meshc(X,Y,Z) :draws a wireframe mesh
Programming
Machine Interface
with a contour
Introduction
MATLAB Basics
plot beneath the mesh.
Vectors & Arrays

Math. Functions

Polynomials

MATLAB plotting

2-D & 3-D Graphics [X,Y,Z] =


Flow Control peaks(30);
System analysis meshc(X,Y,Z)
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

3-D Graphics
SIMATIC HMI
MATLAB
meshz(X,Y,Z) :draws a curtain plot
The Human
Programming
Machine Interface (i.e., a reference
Introduction plane) around the
MATLAB Basics
mesh.
Vectors & Arrays

Math. Functions

Polynomials

MATLAB plotting

2-D & 3-D Graphics [X,Y,Z] =


Flow Control peaks(30);
System analysis meshz(X,Y,Z)
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

3-D Graphics
SIMATIC HMI
MATLAB
surf(X,Y,Z) :creates a shaded surface
The Human
Programming
Machine Interface using Z for the
Introduction color data as well as
MATLAB Basics
surface height.
Vectors & Arrays

Math. Functions

Polynomials

MATLAB plotting

2-D & 3-D Graphics [X,Y,Z] =


Flow Control peaks(30);
System analysis surf(X,Y,Z)
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

3-D Graphics
SIMATIC HMI
MATLAB
The Human
Programming
surfc(X,Y,Z) :draws a contour plot
Machine Interface
Introduction
beneath the shaded
MATLAB Basics surface.
Vectors & Arrays

Math. Functions

Polynomials

MATLAB plotting

2-D & 3-D Graphics [X,Y,Z] =


Flow Control peaks(30);
System analysis surfc(X,Y,Z)
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

surfl(X,Y,Z) 3-D:create
Graphics
three-dimensional
SIMATIC HMI
MATLAB
shaded
The Human
Programming
Machine Interface surfaces using the
Introduction default direction for
MATLAB Basics the light source and the
Vectors & Arrays
default lighting
Math. Functions
coefficients for the
Polynomials
shading model.
MATLAB plotting

2-D & 3-D Graphics [X,Y,Z] =


Flow Control peaks(30);
System analysis surfl(X,Y,Z)
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

3-D Graphics
SIMATIC HMI
MATLAB
The Human
Programming
Machine Interface
surfnorm(X,Y,Z) :plot a surface and its
Introduction
surface normals.
MATLAB Basics

Vectors & Arrays

Math. Functions

Polynomials

MATLAB plotting

2-D & 3-D Graphics [X,Y,Z] =


Flow Control peaks(30);
System analysis surfnorm(X,Y,Z)
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

2-D Graphics
SIMATIC HMI
MATLAB
Application
The Human
Programming
Machine Interface :
Introduction
xi=-3:3;
MATLAB Basics

Vectors & Arrays


yi=1:5;
Math. Functions
[X,Y]=meshgrid(xi,yi);
Polynomials
Z=(X+Y).^2;
MATLAB plotting plot3(X,Y,Z)
2-D & 3-D Graphics pause
Flow Control mesh(X,Y,Z)
System analysis pause
Curve fitting surf(X,Y,Z)
Symbolic math. pause
Signal processing surfl(X,Y,Z)
Function m-file pause
MATLAB Simulink surfnorm(X,Y,Z)
Final Test Faculty of Electronic Engineering Industrial Electronics and Automatic Control Engineering
for internal use only Automation
Dr./ Essam and
Nabil
Drives

3-D Graphics
[X,Y,Z] = sphere(n) :returns the
SIMATIC HMI
MATLAB
The Human
3.coordinates
Area Graphs: of a sphere
Programming
Machine Interface
in three matrices
Introduction
that are (n+1)-by
MATLAB Basics

Vectors & Arrays


(n+1) in size. You
Math. Functions draw the sphere
Polynomials with surf(X,Y,Z) or
[x,y,z]=sphere(1
mesh(X,Y,Z).
MATLAB plotting

2-D & 3-D Graphics


2)
Flow Control
subplot(121)
System analysis
mesh(x,y,z)
Curve fitting
hidden off
Symbolic math. axis off
Signal processing subplot(122)
Function m-file mesh(x,y,z)
MATLAB Simulink hidden on
Final Test axis off Engineering
Faculty of Electronic Industrial Electronics and Automatic Control Engineering
pie3(X) :draws a three-dimensional
for internal use only Automation pie
Dr./ Essam and
Nabil
Drives

chart using the3-D Graphics


data in X. Each element in X is
SIMATIC HMI
MATLAB
The Human
Programming
represented as a
Machine Interface
slice in the pie chart.
Introduction
MATLAB Basics
pie3(X,explode) :specifies whether to
Vectors & Arrays offset a slice from
Math. Functions the center of the pie
Polynomials chart. X(i,j) is offset
MATLAB plotting from the center of the
2-D & 3-D Graphics pie chart if
Flow Control explode(i,j) is nonzero.
System analysis explode
x = [1must
3 0.5be 2.5 2];
Curve fitting explode = [0 1 0 0 the same size as X.
Symbolic math.
0];
Signal processing
pie3(x,explode)
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

3-D Graphics
SIMATIC HMI
MATLAB
The Human
4. comet3(z)
Animated 3-d :displays
plots: a 3-D comet graph
Programming
Machine Interface of the vector z.
Introduction
comet3(x,y,z) :displays a comet graph of
MATLAB Basics

Vectors & Arrays


the curve
Math. Functions
through the points
Polynomials
[x(i),y(i),z(i)].
MATLAB plotting

2-D & 3-D Graphics

Flow Control
z=-
System analysis
10*pi:0.01:10*pi;
Curve fitting
x=cos(2*z);
Symbolic math. y=sin(2*z);
Signal processing comet3(x,y,z)
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
stem3(Z) :plots the data sequence Z
as stems that 3-D Graphics
extend from the x-y plane.
MATLAB 5. 3-d data sequence plots:
SIMATIC HMI
The Human
Programming
Machine Interface x and y are
Introduction generated automatically.
MATLAB Basics stem3(X,Y,Z) :plots the data sequence Z
Vectors & Arrays
at values
Math. Functions
specified by X and Y. X, Y,
Polynomials
and Z must all
MATLAB plotting
be vectors or matrices of
2-D & 3-D Graphics
the same size.
Flow Control
stem3(X,Y,Z,'fill') :specifies whether to
System analysis
color the interior
Curve fitting

Symbolic math. z=rand(5); of the circle at the


Signal processing
end of the stem.
stem3(z,'ro','fille
Function m-file d')
MATLAB Simulink

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

colormap
colormap(map) :sets the colormap to the
SIMATIC HMI
MATLAB
The Human
matrix map.
Programming
Machine Interface Colormap must have
Introduction
values in [0,1].
MATLAB Basics

Vectors & Arrays

Math. Functions

Polynomials

MATLAB plotting

2-D & 3-D Graphics

Flow Control

System analysis

Curve fitting

Symbolic math.
[X,Y,Z] =
Signal processing
peaks(30);
Function m-file
mesh(X,Y,Z)
MATLAB Simulink
colormap([0.5 0.5
Final Test
0.5])
Faculty of Electronic Engineering Industrial Electronics and Automatic Control Engineering
for internal use only Automation
Dr./ Essam and
Nabil
Drives

colormap
colormap( type ) :sets the current
SIMATIC HMI
MATLAB
The Human colormap to the built-in
Programming
Machine Interface
colormaps as the
Introduction
MATLAB Basics
following:
Vectors & Arrays

Math. Functions

Polynomials

MATLAB plotting

2-D & 3-D Graphics

Flow Control

System analysis

Curve fitting

Symbolic math.

Signal processing [X,Y,Z] = peaks(30);


Function m-file mesh(X,Y,Z)
MATLAB Simulink colormap(hot)
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. “3”


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