Académique Documents
Professionnel Documents
Culture Documents
”Cours bloc”
Freddy MUDRY et Michel ETIQUE
Freddy.Mudry@eivd.ch, Michel.Etique@eivd.ch
in s t i t u t d '
Automatisation
in d u s t r i e l l e Introduction au logiciel MATLAB”Cours bloc” – p.1/20
Organisation du "cours bloc"
– mathématiques
– laboratoire de physique
– systèmes analogiques (filtres, Bode, réponses
temporelle, etc)
– théorie des circuits
– traitement de signal
– régulation automatique
– etc
in s t i t u t d '
Automatisation
in d u s t r i e l l e Introduction au logiciel MATLAB”Cours bloc” – p.3/20
Introduction
in s t i t u t d '
Automatisation
in d u s t r i e l l e Introduction au logiciel MATLAB”Cours bloc” – p.4/20
Introduction
– opérations/manipulations
vectorielles/matricielles (inv, eig, diag)
in s t i t u t d '
Automatisation
in d u s t r i e l l e Introduction au logiciel MATLAB”Cours bloc” – p.5/20
Introduction
– opérations/manipulations
vectorielles/matricielles (inv, eig, diag)
– résolution (numérique) d’équations
différentielles (ode23 et ode45)
in s t i t u t d '
Automatisation
in d u s t r i e l l e Introduction au logiciel MATLAB”Cours bloc” – p.5/20
Introduction
– opérations/manipulations
vectorielles/matricielles (inv, eig, diag)
– résolution (numérique) d’équations
différentielles (ode23 et ode45)
– création/manipulation de polynômes
(polyval, conv)
in s t i t u t d '
Automatisation
in d u s t r i e l l e Introduction au logiciel MATLAB”Cours bloc” – p.5/20
Introduction
– opérations/manipulations
vectorielles/matricielles (inv, eig, diag)
– résolution (numérique) d’équations
différentielles (ode23 et ode45)
– création/manipulation de polynômes
(polyval, conv)
– traitement de données expérimentales (min,
mean, sort, std)
in s t i t u t d '
Automatisation
in d u s t r i e l l e Introduction au logiciel MATLAB”Cours bloc” – p.5/20
Introduction
– opérations/manipulations
vectorielles/matricielles (inv, eig, diag)
– résolution (numérique) d’équations
différentielles (ode23 et ode45)
– création/manipulation de polynômes
(polyval, conv)
– traitement de données expérimentales (min,
mean, sort, std)
– interface graphique (plot, mesh, surf)
in s t i t u t d '
Automatisation
in d u s t r i e l l e Introduction au logiciel MATLAB”Cours bloc” – p.5/20
Le Workspace MATLAB
in s t i t u t d '
Automatisation
in d u s t r i e l l e Introduction au logiciel MATLAB”Cours bloc” – p.6/20
L’aide en ligne
help nom_de_commande
in s t i t u t d '
Automatisation
in d u s t r i e l l e Introduction au logiciel MATLAB”Cours bloc” – p.7/20
La fonction plot et l’opérateur .
sin (ϑ)
sinc (ϑ) =
ϑ
t h e t a =linspace (−4∗ pi ,4∗ pi , 1 0 0 ) ;
s i n c = sin ( t h e t a ) . / t h e t a ;
f i g u r e ( 1 ) , plot ( t h e t a , s i n c )
0.8
0.6
0.4
0.2
in s t i t u t d '
−0.2
Automatisation −0.4
in d u s t r i e l l e
−15 −10 −5 0 5 10 15
Introduction au logiciel MATLAB”Cours bloc” – p.8/20
Services Internet
http://www.mathworks.com
ftp.mathworks.com
http://www.scientific.de
http://www.sysquake.com
http://www-rocq.inria.fr/scilab/
in s t i t u t d '
Automatisation
in d u s t r i e l l e Introduction au logiciel MATLAB”Cours bloc” – p.9/20
Boîtes à outils
in s t i t u t d '
Automatisation
in d u s t r i e l l e Introduction au logiciel MATLAB”Cours bloc” – p.10/20
Boîtes à outils
in s t i t u t d '
Automatisation
in d u s t r i e l l e Introduction au logiciel MATLAB”Cours bloc” – p.11/20
Utilisateurs
in s t i t u t d '
Automatisation
in d u s t r i e l l e Introduction au logiciel MATLAB”Cours bloc” – p.12/20
Utilisateurs
in s t i t u t d '
Automatisation
in d u s t r i e l l e Introduction au logiciel MATLAB”Cours bloc” – p.12/20
Utilisateurs
in s t i t u t d '
Automatisation
in d u s t r i e l l e Introduction au logiciel MATLAB”Cours bloc” – p.12/20
uicontrol et uimenu
in s t i t u t d '
Automatisation
in d u s t r i e l l e Introduction au logiciel MATLAB”Cours bloc” – p.13/20
Création d’axes et de sliders
%D e f i n i t i o n du systeme G( jw )
T = 0.1;
numG = 1 ;
denG = [ T , 1 ] ; %[T , 1 ]
%Reponse f r e q u e n t i e l l e
[ A, phi , omega ] = bode ( numG, denG ) ;
%Systeme d ’ axes pour reponse f r e q u e n t i e l l e
figure (1)
axe1 = axes ( ’ U n i t s ’ , ’ Normalized ’ , . . .
’ Position ’ , [ 0 . 1 , 0 . 3 , 0 . 8 , 0 . 5 ] ) ;
pl1 = semilogx ( omega,20∗ log10 ( A ) ) ;
%S l i d e r pour m o d i f i c a t i o n p o s i t i o n de T
s l 1 = u i c o n t r o l ( ’ U n i t s ’ , ’ Normalized ’ , ’ S t y l e ’ , ’ S l i d e r ’ , . . .
’ Position ’ , [ 0 . 1 , 0 . 1 , 0 . 8 , 0 . 0 5 ] , . . .
’ Min ’ , 0 . 0 0 1 , ’ Max’ , 1 , ’ Value ’ , 0 . 1 , . . .
in s t i t u t d '
Automatisation ’ CallBack ’ , ’ slider_change_01 ’ ) ;
in d u s t r i e l l e Introduction au logiciel MATLAB”Cours bloc” – p.14/20
Fonction CallBack
slider_change_01.m
%Lecture de l a v a l e u r courante du s l i d e r et mise a j o u r de G( jw )
denG = [ get ( s l 1 , ’ Value ’ ) , 1 ] ; %[T , 1 ]
%C a l c u l des reponses
[ A ] = bode ( numG, denG, omega ) ;
%Mise a j o u r du graphique
set ( pl1 , ’ Ydata ’ , l i n 2 d b ( A) )
in s t i t u t d '
Automatisation
in d u s t r i e l l e Introduction au logiciel MATLAB”Cours bloc” – p.15/20
MATLAB est serveur OLE
p o s i t i o n à
u l t r a s o n s
R a
L a
P C - P E N T I U M - W I N D O W S N T 4 . 0 u a
( t )
i a
. . .
e . g . A l g o r i t h m e s ,
M A T L A B
s t r a t é g i e d e c o m m a n d e ,
S I M U L I N K
s i g n a u x & p a r a m è t r e s
C a r t e
in s t i t u t d ' W I N
O
D
L
O
E
W S
u
I n t e
t i l i s a
r f a
t e
c
u
e
r
R é g u l a t e u r
d
N
r i v
T
e r
d ' a c q u i s i t i o n
Automatisation
in d u s t r i e l l e Introduction au logiciel MATLAB”Cours bloc” – p.16/20
f _ 0 1 _ 0 1 . e p s
MATLAB est serveur OLE
in s t i t u t d '
Automatisation
in d u s t r i e l l e Introduction au logiciel MATLAB”Cours bloc” – p.17/20
MATLAB est serveur OLE
in s t i t u t d '
Automatisation
in d u s t r i e l l e Introduction au logiciel MATLAB”Cours bloc” – p.18/20
MATLAB est serveur OLE
Ouverture de MATLAB
BufferSize = . . .
T = mxCreateDoubleMatrix ( B u f f e r S i z e , 2 , mxREAL) ;
mxSetName( T , " u_acq " ) ;
B u f f e r = mxGetPr ( T ) ;
engPutArray ( hMatlab , T ) ;
mxDestroyArray ( T ) ;
i n s t}i t u t d '
Automatisation
in d u s t r i e l l e Introduction au logiciel MATLAB”Cours bloc” – p.20/20