Вы находитесь на странице: 1из 174

alphorm.

com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Fondamentaux Matlab 2013a

Prsentation de la formation

Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

Plan
Prsentation du formateur
Informations gnrales
Fondamentaux
Donnes
Graphiques
Analyses
Scripting
Conclusion
Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Prsentation du formateur
Vincent ISOZ
vincent.isoz@scientific-evolution.com
Consultant scientifique
Mission conseil, migration et formation
Bsc. Physique
Mes rfrences :
Mon profil Alphorm : http://www.alphorm.com/auteur/vincent-isoz

Fondamentaux MATLAB 2013a

alphorm.com

Remarques
Objectifs (pourquoi cette formation?)
Prrequis (matriel et connaissances)
Audience (public cible)
Rfrences bibliographiques + Liens Internet
Hypothses

IV1

Validation des acquis (certifications)


Support post formation
Avertissements
Et aprs?
Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

Diapositive 4
IV1

On se limite au bases de matlab: donc pas d'usage de Toolbox, ce n'est pas un


cours de maths, ni d'ingnierie (ceci est rserv aux cours avancs). C'est juste un
cours permettant d'avoir une base solide pour la suite. videmment rien de nouveau
n'est prsent ici, on trouve dj tout sur Internet ou sur l'aide en ligne du logiciel
ISOZ Vincent; 10/04/2014

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Rfrences bibliographiques

Fondamentaux MATLAB 2013a

alphorm.com

Liens
www.google.com
www.youtube.com
www.scribd.com
www.mathworks.com/products/
www.mathworks.ch/ch/help/matlab/release-notes.html
www.mathworks.com/matlabcentral/fileexchange/
www.mathworks.ch/discovery/
www.mathworks.ch/discovery/gallery.html
www.mathworks.com/matlabcentral/newsreader/
Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Are you read?

alphorm.com

Fondamentaux MATLAB 2013a

Informations gnrales
Domaines d'application
de Matlab et alternatives

Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Applications
1.

Enseignement scolaire (car le logiciel couvre de large sujets)

2.

Simulations

3.

Traitement du signal

4.

Traitement d'images (et vidos)

5.

Prototypage rapide (SimuLink)

6.

Finance

7.

Dveloppement d'applications converties en C/C++

8.

Calcul massivement parallle

9.

alphorm.com

Fondamentaux MATLAB 2013a

Toolbox
1.

Acquisition du noyau de base


(Matlab Home)

Signal processing Toolbox


Optimization Toolbox

2.

Financial Toolbox

3.

MuPad Toolbox

4.

PDE Toolbox

5.

SimuLink Toolbox

6.

Image Acquisition (video) Toolbox

7.

Matlab Coder Toolbox

8.

Neural Network Toolbox

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

Database Toolbox
. www.mathworks.ch/products/

alphorm.com

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Alternatives gratuites

Octave

Matlab est l'ingnierie ce que Microsoft


Office System est la bureautique
Fondamentaux MATLAB 2013a

alphorm.com

En gnral
Pour chaque Toolbox de Matlab on trouve sur le march des logiciels
spcialiss et souvent plus adapts ses besoins (si on cherche bien)
mais qui ne couvrent cependant parfois pas un panel aussi large de
fonctionnalits que Matlab (qui est trs souvent sous-utilis).
Exemples :
MuPAD: Maple
PDE toolbox: COMSOL Multiphysics
Finance toolbox: Gauss Software
Instrument control toolbox: NI LabView
SimuLink: EcosimPro
Mcanique lagrangienne: Mathcad
.
Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Informations gnrales
Dcouverte et personnalisation de
l'interface

Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

Plan
Dmarrer en mode minimum (matlab nodesktop)
Prsentation des diffrents panneaux/volets
Choix/Enregistrements de layouts
Personnalisation de la barre d'accs rapide
Minimiser les rubans
Personnalisation des rubans??
Cration de raccourcis
Crer sa propre interface??
Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Ce quon a couvert
La personnalisation de notre environnement dans les limites

d'utilisabilit actuelles du logiciel

alphorm.com

Fondamentaux MATLAB 2013a

Informations gnrales

Commandes systmes

Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Plan
Lancer/Quitter Matlab depuis le shell: !matlab/exit
Afficher la version: version
Afficher les licences: license
Copie dans le presse papier: clipboard
Obtenir l'OS: getenv('OS')
Obtenir la langue de l'environnement: get(0, 'Language')
Obtenir la mmoire disponible: memory
Performance ordinateur: bench
Date du jour: date
Fondamentaux MATLAB 2013a

alphorm.com

Plan
Date et heure du jour: datestr(now)
Obtenir les variables dans la mmoire: whos
Effacer les variables: clear all
Revenir en haut de fentre de commande: home
Effacer le contenu de la fentre de commande: clc
Vider lhistorique des commandes:

com.mathworks.mlservices.MLCommandHistoryServices.removeAll
Montrer le dossier de travail en cours: pwd
Changer le fichier de dmarrage startup.m
Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Ce quon a couvert
Lidentification de paramtres systmes pour matriser son

environnement de travail
Lidentification de paramtres systmes pour dcider de poursuivre un

script propritaire ou non

alphorm.com

Fondamentaux MATLAB 2013a

Informations gnrales

Utilisation des aides


Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

10

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Plan
Ouvrir l'aide: helpwin
Aide sur une commande: help nom_commande
Recherche d'un outil: lookfor nom_outil
Voir le code source d'une commande native avec: edit nom_commande

Fondamentaux MATLAB 2013a

alphorm.com

Ce quon a couvert
Comment devenir autodidacte avec Matlab
Trouver de l'aide mme en absence de connexion Internet
Accder laide de fonctions natives ou cres en interne
Editer certaines commandes systme pour les dsosser

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

11

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Les fondamentaux
Grer les commandes

Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

Fondamentaux MATLAB 2013a

alphorm.com

Plan
Utiliser le diary: diary()/diary off
Commenter ses scripts: % bla bla bla
crire des commandes sur plusieurs lignes (finir la ligne avec )
Sauvegarder/Charger lespace de travail en cours: save/load
Crer des fichiers scripts *.m et usages y relatifs
Us et coutumes de l'utilisation des commentaires dans les fichiers *.m

(cartouche, versioning, etc.)

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

12

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Ce quon a couvert
Utilisation des commentaires pour viter doublier qui a fait quoi et

pourquoi cela a t fait ainsi (en respectant les traditions et les normes)

alphorm.com

Fondamentaux MATLAB 2013a

Les fondamentaux
Oprations arithmtiques
lmentaires
Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

13

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Plan
Addition, Soustraction, Multiplication , Division: +, -, *, /
Auto-incrmentation: plus(x,1)
Auto-dcrmentation: minus(x,1)
Puissance/Racine: (x)^() ou sqrt(x)
Valeur absolue: abs(x)
Modulo: mod(x,y)
Reste de la division: rem(x,y)

Fondamentaux MATLAB 2013a

alphorm.com

Ce quon a couvert
Oprations arithmtiques lmentaires telles que vues la petite cole

sur des scalaires

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

14

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Les fondamentaux
Oprateurs de comparaisons

Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

Plan
quivalence: A==B
Strictement plus grand: A>B
Strictement plus petit: A<B
Plus grand ou gal: A>=B
Plus petit ou gal: A<=B
Diffrent de: A~=B

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

15

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Ce quon a couvert
Comment comparer des lments que cela soit des nombres (rels ou

complexes) ou des chanes de caractres

alphorm.com

Fondamentaux MATLAB 2013a

Les fondamentaux
Manipulation de variables
scalaires relles

Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

16

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Plan
Plus grand nombre entier positif : intmax
Plus petit nombre entier ngative: intmin
Plus grand nombre rel positif virgule flottante: realmax
Plus petite nombre rel ngative virgule flottant: realmin
Faire des oprations arithmtiques avec des rels
Choisir le niveau de prcision: format short, format long, format short e,

format long e,

Fondamentaux MATLAB 2013a

alphorm.com

Ce quon a couvert
Les manipulations classiques par rapport aux nombres rels

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

17

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Les fondamentaux
Manipulation de nombres
complexes
Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

Fondamentaux MATLAB 2013a

alphorm.com

Plan
crire un nombre complexe en utilisant i ou j
Crer un nombre complexe: complex
Obtention du conjugu complexe: conj
Calculer le module d'un nombre complexe: abs
Angle d'Euler du nombre complexe: angle
Partie imaginaire d'un nombre complexe: imag
Partie relle d'un nombre complexe: real
Dterminer si une variable est complexe ou non: isreal
Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

18

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Ce quon a couvert
Les manipulations classiques relatives aux nombres complexes

alphorm.com

Fondamentaux MATLAB 2013a

Les fondamentaux
Arrondis de scalaires
(rels ou complexes)
Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

19

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Plan
Arrondir l'entier suprieur: ceil
Arrondir l'entier infrieur: floor
Arrondir l'entier le plus proche: round
Arrondir un multiple quelconque sans toolbox

Fondamentaux MATLAB 2013a

alphorm.com

Ce quon a couvert
Les types darrondis les plus courants

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

20

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Les fondamentaux
Oprations ensemblistes

Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

Fondamentaux MATLAB 2013a

alphorm.com

Plan
Retourner une liste d'unicit d'un vecteur: unique
Union de deux ensembles (vecteurs): union
Intersection de deux ensembles (vecteurs): intersect
Diffrence exclusive de deux ensembles (vecteurs): setdiff
Contrle de l'appartenance (vecteurs): ismember
Nettoyer des ensembles (vecteurs) contenant des valeurs vide: isnan
Diffrence symtrique de deux ensembles (vecteurs): setxor

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

21

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Ce quon a couvert
Des oprations ensemblistes trs utiles dans certains domaines du Data

Mining et plus gnralement dans le domaine de la statistique et de la


finance

alphorm.com

Fondamentaux MATLAB 2013a

Les fondamentaux
Dclaration et manipulation
de variables vectorielles

Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

22

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Plan
Dfinir un vecteur arbitraire: [.]
Dfinir un vecteur avec une squence de nombres: linspace
Dimension d'un vecteur: length, size
Dfinir un vecteur avec des caractres: {.}
Extraire des lments d'un vecteur
Sommer/Soustraire des vecteurs: +, Multiplication/Division composante par composante: ./ , .*
Puissance composante par composante: power, .^
Calculer la norme euclidienne d'un vecteur: norm
Fondamentaux MATLAB 2013a

alphorm.com

Plan
Transpose d'un vecteur: transp
Produit cumul des composantes (probabilits): cumprod
Somme cumule des composantes: cumsum
Diffrences par composantes successives: diff
Rang des valeurs d'un vecteur: tiedrank
Calculer le produit scalaire de deux vecteurs: dot
Calculer le produit vectoriel de deux vecteurs: cross
Gradient numrique d'un vecteur: grad
Laplacien numrique dun vecteur: del2
Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

23

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Ce quon a couvert
Nous avons couvert maintenant un des piliers majeurs de Matlab

(Matrix Laboratory) puisque pour rappel un vecteur est un cas


particulier d'une matrice et que Matlab est optimis pour le calcul
matriciel
Malheureusement de nombreuses oprations triviales ncessitent

lachat de Toolbox ou dveloppement de scripts alors que R intgre


cela gratuitement
Nous verrons la divergence et la rotationnel lorsque nous traiterons des

graphiques

alphorm.com

Fondamentaux MATLAB 2013a

Les fondamentaux
Dclaration et manipulation
de variables matricielles

Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

24

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Plan
Dfinir une matrice arbitraire
Oprations arithmtiques sur matrices +,-,*,/
Crer rapidement une matrice identit: eye
Dimensions d'une matrice: size(m)
Accder une composante donne d'une matrice
Changer la valeur de certaines composantes d'une matrice
Transposition d'une matrice: trans(m)
Extraire la diagonale d'une matrice: diag(m)
Obtenir la trace d'une matrice: trace(m)
Fondamentaux MATLAB 2013a

alphorm.com

Plan
Inversion d'une matrice: inv(m)
Rang d'une matrice: rank(m)
Polynme caractristique d'une matrice: charpoly
Hessienne d'une matrice: hessian(m)
Exponentation d'une matrice: expm(m)
Matrice jacobienne: jacobian
Valeurs propres d'une matrice: eig
Dcomposition en valeurs singulires d'une matrice: svd
Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

25

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Ce quon a couvert
Nous avons couvert maintenant un des piliers majeurs de Matlab

(Matrix Laboratory) puisque la grande majorit du logiciel est bas sur


des algorithmes optimiss pour les manipulations de matrices.
Nous verrons les oprateurs de divergence et de rotationnel qui

sappliquent sur des matrices lors de graphs pour des raisons


pdagogiques

alphorm.com

Fondamentaux MATLAB 2013a

Les fondamentaux
Travailler avec des tableaux
structurs

Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

26

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Plan
Pourquoi tudier les tableaux structurs?

E1

Crer un tableau structur: struct


Obtenir les noms des lments du tableau structur: fieldnames
Obtenir les valeurs des lments: getfields
Mettre jour des lments ou crer des lments dans un tableau

structur existant
Ordonner les lments d'un tableau pour faciliter la consultation:

orderfields
Supprimer temporairement ou dfinitivement des lments d'un

tableau structur: rmfield


Fondamentaux MATLAB 2013a

alphorm.com

Ce quon a couvert
Inspir du principe de R, les tableaux structurs seront probablement de

plus en plus utiliss l'avenir pour retourner de multiples rsultats de


calculs dans une structure unique.

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

27

Diapositive 53
E1

De plus en plus de fonction auront comme dans R des rsultat renvoys sous cette
forme
http://www.mathworks.ch/ch/help/matlab/matlab_prog/create-a-structure-array.html

http://www.mathworks.ch/ch/help/matlab/ref/struct.html
Excelsia; 03/06/2014

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Les fondamentaux
Rappels de quelques
fonctions mathmatiques
Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

Fondamentaux MATLAB 2013a

alphorm.com

Plan
Plus grand commun diviseur: gcd
Plus petit commun multiple: lcm
Manipulation de nombres premiers: primes, isprime, factor
Valeur absolue et signum: abs, sign
Triangle de Pascal (sous forme de matrice): pascal
Calcul de la factorielle: factorial
Combinatoire: nchoosek
Permutations: perms
Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

28

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Plan
Fonctions de trigonomtrie du cercle: sin, cos, tan, asin, acos, atan
Fonctions de trigonomtrie hyperbolique: sinh, cosh, tanh, asinh, acosh,

atanh
Fonctions logarithmes: exp, log, log10
Coordonnes cartsiennes en coord. polaires: cart2pol/pol2cart
Coordonnes cartsiennes en coord. sphriques: cart2sph/sph2cart
Fonction de Bessel J: besselj
Fonction d'erreur de Gauss: erf

E2

Intgrale elliptique de Jacobi ou complte: ellipj


Fondamentaux MATLAB 2013a

alphorm.com

Ce quon a couvert
Des fonctions scolaires majeures mais aussi utiles dans les domaines

suivants:
Thorie des nombres (cryptographie RSA)
Thorie combinatoire (utile dans certains cas d'application de statistiques
avances)
Analyse fonctionnelle avec les fonctions logarithmes et exponentielle
Physique en gnral (incluant astronomie, cosmologie, gnie marin, gnie
civil) avec les fonctions trigonomtrique et hyperboliques
Physique nuclaire , thermodynamique et optique ondulatoire avec les
fonctions de BesselJ, erreur de Gauss et elliptiques

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

29

Diapositive 57
E2

Cage oiseau des scanners rsonnance magntique nuclaire


Excelsia; 03/06/2014

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Les fondamentaux
Rappels de quelques
fonctions statistiques
Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

Plan
Valeurs extrmes d'un vecteur (in extenso l'tendue): max/min
Moyenne arithmtique d'un vecteur: mean
Mdiane d'un vecteur: median
Valeur modale d'un vecteur: mode
cart-type biais ou non biais: std
Variance biaise ou non biaise: var
Coefficient de corrlation ou matrice des corrlations: corrcoef
Covariance ou matrice des covariances: cov
Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

30

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Ce quon a couvert
Quelques fonctions d'estimateurs ponctuels lmentaires intgrs par

dfaut dans Matlab (pour + il faut avoir le Toolbox de statistiques)


Pour le mme prix (et moins) comparer Minitab, R, Octave, Scilab

les fonctions sont ridicules (pour tre poli). Par ailleurs mme le
Toolbox de statistiques laisse dsirer par rapport R

alphorm.com

Fondamentaux MATLAB 2013a

Les fondamentaux
Gnrer des variables
alatoires
Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

31

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Plan
Gnrer une variable alatoire uniforme continue: rand
Mettre le gnrateur comme l'ouverture de Matlab: rng('default')
Rutiliser l'tat du gnrateur: s=rng, rng(s)
Gnrer une variable alatoire Normale: randn
Gnrer une variable alatoire discrte: randi

Fondamentaux MATLAB 2013a

alphorm.com

Ce quon a couvert
Les seules fonctions gnratrices de variables alatoires sans toolbox
Comment reproduire une exprience alatoire l'identique
La possibilit avec un peu d'effort de gnrer presque n'importe quelle

autre variable alatoire continue ou discrte sans toolbox

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

32

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Les fondamentaux
Utiliser et crer
des constantes
Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

Plan
Constante pi: pi
Nombre d'Euler: exp(1)
Reprsentation de l'infini: Inf
Tradition pour crer ses propres constantes

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

33

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Ce quon a couvert
Le peu de constantes disponibles par dfaut dans ce logiciel

d'ingnierie
Comment choisir le niveau de prcision de ces constantes (rappel):

format short, format long


Comment crer ses propres constantes (us et coutumes)

alphorm.com

Fondamentaux MATLAB 2013a

Les fondamentaux
Manipulations de chanes
de caractres
Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

34

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Plan
Crer une variable de texte
Afficher le texte associ une variable sans afficher la variable: disp
Extraire une sous-chane
Nettoyer les chanes vides parasites: strtrim
Convertir une chane en minuscules: lower
Convertir une chane en majuscules: upper
Concatner des chanes de caractres: strcat
Remplacer/Supprimer une sous-chane dans une chane: strrep
Dterminer si une chane se trouve dans une chane: strfind
Fondamentaux MATLAB 2013a

alphorm.com

Plan
Trouver une sous-chane dans une chane: strmatch
Comparer deux chanes (sensitif ou non la casse): strcmp/strcmpi
Dissocier une chane sur la base d'un sparateur: strsplit
Convertir des chanes en des nombres: str2num

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

35

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Ce quon a couvert
Les commandes de manipulations de chanes de caractres (seulement

celles que jai vu tre utilises dans la pratique!)


Une mise en bouche aussi pour l'apprentissage ultrieurement du

langage de script
Certaines commandes de traitement de caractres se trouvent que dans

des Toolbox

alphorm.com

Fondamentaux MATLAB 2013a

Les fondamentaux

Manipulations de dates

Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

36

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Plan
Crer une variable de type date
Obtenir la date et l'heure actuelle sous forme de vecteur: clock
Obtenir simplement la date du jour: date, now
Recomposer un vecteur en une date et inversement: datestr/datenum
Dcomposer une date en composante de vecteurs: datevec
Obtenir des infos sur une date: weekday, day, month, year
Gnrer un calendrier: calendar
Obtenir le nombre de jours restants entre la date du jour et la fin du

mois: eoday
Fondamentaux MATLAB 2013a

alphorm.com

Plan
Ajouter une quantit donne une date: addtodate
Utilisation de tic et toc pour calculer le temps d'excution

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

37

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Cas pratiques
Millisecondes fractionnaires (ou entires) entre deux dates/temps
Secondes fractionnaires (ou entires) entre deux dates/temps
Minutes fractionnaires (ou entires) entre deux dates/temps
Heure fractionnaires (ou entires) entre deux dates/temps
Jours fractionnaires calendaires (ou entiers) entre deux dates
??? Mois fractionnaires (ou entiers) entre deux dates ???
??? Annes fractionnaires (ou entires) entre deux dates ???

Fondamentaux MATLAB 2013a

alphorm.com

Ce quon a couvert
Les fonctions de dates majeures disponibles dans Matlab sans toolbox
Le constat qu'il manque beaucoup de fonctions triviales qui devraient

tre natives (en comparaison R ou mme Excel) comme weeknum,


yearfrac, monthfrac, openworkdays, hour, minute, etc.

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

38

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Les fondamentaux

Interactions utilisateur

Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

Fondamentaux MATLAB 2013a

alphorm.com

Plan
Pourquoi interagir avec l'utilisateur
Afficher un message l'utilisateur: msgbox
Demander une information l'utilisateur: input
Crer une bote de dialogue de saisie: inputdlg
Demander une couleur l'utilisateur: uisetcolor
Demander l'utilisateur o stocker les variables: uisave
Demander l'utilisateur o se trouvent les variables stockes: uiopen
Demander l'utilisateur un emplacement de stockage (particulirement

utile pour les graphs plus tard): uigetdir


Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

39

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Plan
Afficher une barre d'attente: waitbar (et test performance avec tic/toc)
Afficher un choix l'utilisateur: questdlg
Crer un "menu" choix pour l'utilisateur: menu
Crer une liste choix pour l'utilisateur: listdlg

Fondamentaux MATLAB 2013a

alphorm.com

Ce quon a couvert
Les commandes d'interactions (seulement les plus utilises dans la

pratique en dehors du dveloppement dinterfaces!)


Une mise en bouche pour l'apprentissage ultrieur du langage de script

MATLAB et des GUI

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

40

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Les fondamentaux
Fusionner des tableaux
ou matrices
Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

Fondamentaux MATLAB 2013a

Plan
Intrt des tables (relativement nouveau pour contrecarrer R)
Cration d'une table: table
Cration d'une table avec tiquettes de colonnes

IV2

Convertir une matrice en tableau: array2table


Dimension d'un tableau: height/width
Fusionner des tableaux d'tiquettes identique: join
Faire une jointure interne de deux tableaux: innerjoin
Rsum d'un tableau: summary
Appliquer une fonction un vecteur d'un tableau: varfun
Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

IV3

alphorm.com

41

Diapositive 82
IV2

table([5;12;23;2;15;6],...
{'cheerios';'pizza';'salmon';'oreos';'lobster';'pizza'},...
'VariableNames',{'Age','FavoriteFood'},...
'RowNames',{'Amy','Bobby','Holly','Harry','Marty','Sally'})
http://www.mathworks.ch/ch/help/matlab/matlab_prog/access-data-in-a-table.html
ISOZ Vincent; 01/04/2014

IV3

http://www.mathworks.ch/ch/help/matlab/ref/varfun.html
ISOZ Vincent; 01/04/2014

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Plan
Appliquer une fonction des lignes: rowfun

Fondamentaux MATLAB 2013a

IV4

alphorm.com

Ce quon a couvert
Nous avons couvert une structure qui va prendre de plus en plus

d'importance dans les annes venir pour le statisticiens habitus R


et dont l'employeur utilise Matlab

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

42

Diapositive 83
IV4

http://www.mathworks.ch/ch/help/matlab/ref/rowfun.html
ISOZ Vincent; 01/04/2014

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Les donnes
Enregistrer et ouvrir des fichiers Matlab
(rappels)

Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

Plan
Sauver/Charger l'espace de travail *.mat: save/load
Dfragmenter lespace de travail: pack
Sauver/Charger un fichier script Matlab *.m: edit/run

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

43

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Ce quon a couvert
Comment grer (sauvegarder/ouvrir) les fichiers classiques de Matlab

*.mat ou *.m

alphorm.com

Fondamentaux MATLAB 2013a

Les donnes
Grer les dossiers

Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

44

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Plan
Authentifier le dossier de travail par dfaut en cours: pwd
Changer le dossier d'enregistrement par dfaut en modifiant le

raccourci de l'icne Matlab (MS Windows)


Choisir la cible de navigation du panneau de dossier: cd
Lister les dossiers de scripts avec path
Utiliser addpath pour charger de multiples dossiers de scripts
Utiliser rmpath pour enlever des dossiers de script ajouts

antrieurement
Appeler le gestionnaire de dossiers de dossier avec pathtool

Fondamentaux MATLAB 2013a

alphorm.com

Plan
Utiliser savepath pour enregistrer l'tat des dossier pour un session

ultrieure
Remettre zro les dossiers de scripts avec restoredefaultpath
Grer les toolbox actifs en modifiant les dossiers de scripts actifs

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

45

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Ce quon a couvert
Comment grer les dossiers de travail et de scripts pour grer ses

fichiers de manire plus efficace

alphorm.com

Fondamentaux MATLAB 2013a

Les donnes
Grer les dossiers et
fichiers
Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

46

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Plan
Ouvrir un dossier quelconque dans l'explorateur windows: winopen
Lister les dossiers et fichiers dun dossier: ls
Lister uniquement les fichiers de type Matlab d'un dossier: what
Vrifier si un fichier existe: exist
Chercher la localisation d'un fichier ou d'une fonction: which
Supprimer un fichier (et dangers y relatifs): delete
Activer la suppression dans la corbeille: recycle('on')
Crer un dossier: mkdir
Supprimer un dossier (avec tout son contenu): rmdir(foldername,'s')
alphorm.com

Fondamentaux MATLAB 2013a

Plan
Dplacer (et ventuellement en mme temps renommer) un fichier ou

un dossier d'un dossier un autre: movefile


Ouvrir n'importe quel fichier autre que Matlab dans son application

associe: open

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

47

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Ce quon a couvert
Comment naviguer dans les dossiers, grer leur contenu, crer des

dossiers et ouvrir des fichiers quelconques (trs utile pour la gestion du


reporting automatis!)

alphorm.com

Fondamentaux MATLAB 2013a

Les donnes
Exporter/Importer
des fichiers de donnes
*.csv/*.txt
Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

48

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Plan
Importer des donnes d'un fichier *.csv (ou *.txt): csvread, importdata,

fopen/textscan
Importer des donnes textes du web: urlread
Fusionner des donnes numriques importes: vertcat
Exporter des matrices: csvwrite

Fondamentaux MATLAB 2013a

alphorm.com

Ce quon a couvert
Comment importer/exporter des donnes de fichiers textes classiques

avec du script pur


Comment fusionner des donnes importes
Informer de labsence de fonctions natives pour importer/exporter

certains fichiers courants Minitab, SPSS, SAS, etc. (en comparaison au


package foreign de R) et pour lexport de structures et cellules
composes de mlanges de donnes.
Limport de fichiers XML se fera dans le chapitre de scripting car

ncessite dcrire un dizaine de lignes de scripts.

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

49

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Les donnes
Exporter/Importer
des fichiers de donnes
*.xls/*.xlsx
Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

Plan
Importer/Exporter un fichier de donnes numriques *.xlsx: xlsread
Exporter des donnes au format xls/xlsx: xlswrite

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

50

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Ce quon a couvert
Comment importer/exporter des donnes de fichiers Microsoft Office

Excel bien structures

alphorm.com

Fondamentaux MATLAB 2013a

Les donnes
Importer des donnes
avec lassistant
Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

51

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Plan
Importer des donnes avec lassistant Matlab sous diffrentes structures
Importer des donnes avec lassistant Matlab en gnrant le script

automatiquement
Importer des donnes avec lassistant Matlab en gnrant une fonction

de script

Fondamentaux MATLAB 2013a

alphorm.com

Ce quon a couvert
Dcouverte de lassistant dimport de MATLAB avec ses diffrentes

options

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

52

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Les donnes
Remarques

Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

Plan
Limport de fichiers XML se fera lors de ltude du langage de script
Sans toolbox aucun moyen simple ma connaissance avec du script pur

daccder des SGBDR comme mySQL, Oracle, SQL Server, Microsoft


Office Access, etc.
Il existe des fichiers compils en C/C++ dvelopps par des amateurs

(MATLAB Central) qui permettent dinterfacer quelques rares SGBDR


mais aucune garantie quant leur maintenance sur le long terme!

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

53

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Les graphiques
Data sets de dmos pour
les graphiques et autres
Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

Fondamentaux MATLAB 2013a

alphorm.com

Plan
La commande logo , spy, peaks ()
Jeux de donnes pour graphiques ou analyses statistiques
Comprendre ce qui est exportable dans

MS Excel et ce qui ne l'est pas

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

54

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Ce quon a couvert
Quelques dmos de MATLAB
Le dossier de jeu de donnes de MATLAB
Ce qui exportable et ce qui ne l'est pas dans des tableurs

alphorm.com

Fondamentaux MATLAB 2013a

Les graphiques
Assistant graphique

Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

55

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Plan
Rappels sur la structure de donnes de plots 2D/3D
Prsentation gnrale de lassistant graphique

Fondamentaux MATLAB 2013a

alphorm.com

Ce quon a couvert
Gnration dun graphique partir de lassistant
Personnalisation du graphique avec lassistant
Ajout dlments sur le graphique
Transcription des modifications en tant que script

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

56

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Les graphiques
Contrler la fentre
graphique
Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

Plan
Gestion des fentres

de graphiques modales

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

57

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Plan
Contrler la couleur de la grille

Fondamentaux MATLAB 2013a

alphorm.com

Ce quon a couvert
Comment masquer les barres d'outils des fentres de graphiques
Comment changer le titre des fentre et masquer la numrotation
Comment contrler la position des fentres et leur taille
Comment mettre une couleur de fond la fentre

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

58

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Les graphiques
Plot points/lignes de
fonctions de R R2
Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

Plot simple

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

59

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Pige des proportions des axes avec Matlab

Fondamentaux MATLAB 2013a

alphorm.com

Choix des types de traits et points

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

60

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Superposition de plots 2D et ajout de lignes de rfrences et lgendes

Fondamentaux MATLAB 2013a

alphorm.com

Graph avec barres d'erreurs

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

61

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Graph semi-log en X

Fondamentaux MATLAB 2013a

alphorm.com

Graph semi-log en Y

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

62

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Graph log-log

Fondamentaux MATLAB 2013a

alphorm.com

Ce quon a couvert
Graphiques points ou lignes 2D les plus classiques comme base de

travail triviale (sans Toolbox)


Pour des centaines d'exemples en plus:

http://www.mathworks.com/matlabcentral/fileexchange/index?page=3
&term=chart&utf8=%E2%9C%93
ou simplement l'aide de Matlab (dans chaque Toolbox!).

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

63

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Les graphiques
Cration de compositions
graphiques
Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

Plan
Subplots avec titres

multiples

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

64

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Ce quon a couvert
Le principe (majeur!) de la construction de compositions de graphiques

multiples!
La cration de fentre graphiques modale multiples avec la commande

figure et la manire de toutes les fermes avec close all

alphorm.com

Fondamentaux MATLAB 2013a

Les graphiques
Utiliser des lettres grecques
dans les titres et labels

Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

65

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Utilisation de la syntaxe LaTex

Fondamentaux MATLAB 2013a

alphorm.com

Ce quon a couvert
L'utilisation de lettres grecques dans titres, labels et lgendes (ou

ailleurs) en utilisant linterprteur LaTex

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

66

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Les graphiques
Grer les dates en
abscisses
Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

Grer les dates en abscisses

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

67

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Ce quon a couvert
Le principe de contrle des dates pour laxe des abscisses dans les

graphiques simples ou combins

alphorm.com

Fondamentaux MATLAB 2013a

Les graphiques
Crer des graphiques
double axes
Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

68

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Graphiques doubles axes verticaux/horizontaux

Fondamentaux MATLAB 2013a

alphorm.com

Ce quon a couvert
Les graphiques points/lignes avec doubles axes verticaux
Les graphiques points/lignes avec quadruples axes (double v/double

h)

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

69

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Les graphiques
Diagrammes barres 2D
(verticaux/horizontaux)
divers
Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

Diagrammes barres 2D groups/cumuls/mixes

E3

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

70

Diapositive 140
E3

Matlab n'a pour rappel a priori pas d'histogramme normalis. C'est l'utilisateur de
normaliser en divisant par le total.
Excelsia; 16/06/2014

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Histogrammes

Fondamentaux MATLAB 2013a

alphorm.com

Ce quon a couvert
Le gnration de diagrammes barres verticaux et horizontaux

classiques avec quelques complications trs courants


Constat que la gnration de diagrammes barres dans MATLAB

comporte relativement peu d'options par dfaut (la normalisation nest


pas une option automatique par exemple). En comparaison, Microsoft
Office Excel, R, Origin et de nombreux autres font a priori beaucoup
mieux.

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

71

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Les graphiques
Diagrammes barres 3D
verticaux divers
Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

Histogramme 3D et activation de la barre d'outils "Camra"

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

72

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Ce quon a couvert
La gnration de diagrammes barres 3D verticaux (le bar3h( ) tant

trs trs rare).

alphorm.com

Fondamentaux MATLAB 2013a

Fondamentaux Matlab 2013a

Les graphiques

Reprsenter des proportions


avec des secteurs

Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

73

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Diagramme secteurs 2D

Fondamentaux MATLAB 2013a

alphorm.com

Diagramme secteurs 3D

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

74

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Ce quon a couvert
La gnration de diagramme secteurs dans Matlab comporte trop peu

d'options par dfaut sans l'apport de toolbox. En comparaison,


Microsoft Office Excel, R, Origin et de nombreux autres font beaucoup
mieux/beaucoup plus vite.
La ncessite dans certains cas d'utiliser une toolbox externe

http://www.mathworks.com/matlabcentral/fileexchange/27786-3d-piecharts-with-a-touch-of-style

alphorm.com

Fondamentaux MATLAB 2013a

Les graphiques
Utiliser les diagrammes
aires
Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

75

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Graph aires

Fondamentaux MATLAB 2013a

alphorm.com

Ce quon a couvert
La gnration de diagrammes aires dans Matlab comporte trop peu

d'options par dfaut sans l'apport de toolbox. En comparaison,


Microsoft Office Excel, R, Origin et de nombreux autres font beaucoup
mieux/beaucoup plus vite.
Utiliser la technique habituelle des diagrammes aire pour faire des

intervalles de confiance

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

76

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Les graphiques
Crer un histogramme
angulaire
Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

Histogramme angulaire

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

77

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Ce quon a couvert
Les histogrammes angulaires pour les observations

(comptages/frquences) dans un plan

alphorm.com

Fondamentaux MATLAB 2013a

Les graphiques
Crer un diagramme
compas (phaseurs)
Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

78

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Diagramme compas

Fondamentaux MATLAB 2013a

alphorm.com

Ce quon a couvert
Le diagramme compas pour reprsenter des phaseurs mais qui peut

tre dtourn de son objectif premier

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

79

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Les graphiques
Analyse de Pareto

Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

Analyse de Pareto

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

80

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Ce quon a couvert
Une analyse de Pareto sur des valeurs numriques avec une

reprsentation simple

alphorm.com

Fondamentaux MATLAB 2013a

Les graphiques
Diagrammes matriciels

Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

81

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Diagrammes matriciels

Fondamentaux MATLAB 2013a

alphorm.com

Ce quon a couvert
La cration dun diagramme (graphique) matriciel avec histogramme en

diagonale
Les options sont a priori trs limites par rapport R

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

82

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Les graphiques
Crer des heatmap de
corrlation
Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

Heatmap de corrlation

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

83

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Ce quon a couvert
Une heatmap simple avec personnalisation de la barre de couleurs

alphorm.com

Fondamentaux MATLAB 2013a

Les graphiques
Crer un graphe avec effet
de loupe
Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

84

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Graphe avec loupe

Fondamentaux MATLAB 2013a

alphorm.com

Ce quon a couvert
La cration dune zone de zoom dans un graphe plan

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

85

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Les graphiques
Tracer des courbes
paramtriques 3D
Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

Courbes 3D paramtriques statiques ou animes

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

86

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Ce quon a couvert
Cas scolaires des courbes paramtriques 3D

Fondamentaux MATLAB 2013a

alphorm.com

Les graphiques
Tracer des surfaces
paramtriques 3D
Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

87

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Surfaces 3D paramtriques

Fondamentaux MATLAB 2013a

alphorm.com

Ce quon a couvert
Cas scolaires de surfaces paramtriques 3D. Fonctionnalit utile pour

dfinir des volumes canoniques dans lesquels se droulent des


expriences

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

88

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Les graphiques
Plot de surfaces analytiques
3D avec diverses options visuelles

Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

Plan
Pige des axes avec

Matlab
Choix d'afficher

la grille de fond ou
non
Choix de la limite

de traage
Choix de la

perspective
Choix du zoom

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

89

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Graph 3D avec grille et jeu de couleurs

Fondamentaux MATLAB 2013a

alphorm.com

Graph 3D en surface avec ou sans transparence

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

90

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Graph 3D avec grille triangulaire ou rectangulaire

Fondamentaux MATLAB 2013a

alphorm.com

Ce quon a couvert
viter le pige de la proportion des axes
Choisir d'afficher le quadrillage ou non
Contrler les bases de la perspectives (zoom, angle, limites de plot)
Choisir le type de dgrad de couleurs/colormap (heat, jet, etc.)
Mettre de la transparence
Et de nombreuses autres options

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

91

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Les graphiques
Afficher les
isoclines/quipotentielles en 2D
ou 3D
Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

Projeter les isoclines sur un plan

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

92

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Graph 3D courbures de niveau (isoclines)

Fondamentaux MATLAB 2013a

alphorm.com

Graph 2D des isoclines projets dans le plan

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

93

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Graph 2D du gradient des isoclines

Fondamentaux MATLAB 2013a

alphorm.com

Graph 3D avec isoclines,contrle de la perspective et de la lumire

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

94

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Ce quon a couvert
Cas les plus courants de reprsentation des isoclines/quipotentielles

(sans gradients, sans lignes de champs)

alphorm.com

Fondamentaux MATLAB 2013a

Les graphiques
Afficher les vecteurs normaux,
quipotentielles et lignes de champs

Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

95

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Vecteurs normaux, gradients et quipotentielles (isoclines) avec lignes de champs

Fondamentaux MATLAB 2013a

alphorm.com

Ce quon a couvert
Comment afficher les vecteurs normaux une surface
Comment afficher les gradients vectoriels sur un plan Z
Comment afficher les quipotentielles (isoclines) avec les lignes de

champs sur un plan Z

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

96

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Les graphiques
Plot de surfaces provenant de
mesures

Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

Surfaces de mesures

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

97

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Ce quon a couvert
Deux mthodes diffrentes pour transformer des vecteurs de mesures

en surfaces visualisables

Fondamentaux MATLAB 2013a

alphorm.com

Les graphiques
Mappage d'images

Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

98

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Mappage d'images sur plot 2D

Fondamentaux MATLAB 2013a

alphorm.com

Mappage d'images sur plot 3D

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

99

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Ce quon a couvert
Comment utiliser une image en fond dun plot 2D (utile en

gostatistique quand on a pas la toolbox adquate)


Comment mapper une image sur une surface plonge dans une espace

3D (utile pour les publications/magazines posters de vulgarisation


scientifique)

alphorm.com

Fondamentaux MATLAB 2013a

Les graphiques
Sphre avec texture

Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

100

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Plot d'une sphre avec texture

Fondamentaux MATLAB 2013a

alphorm.com

Ce quon a couvert
Un cas classique pour des simulations de mcanique cleste,

d'ingnierie arospatiale ou mtorologiques

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

101

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Les graphiques
Reprsentation dun
paralllpipde
Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

Plot dun paralllpipde

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

102

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Ce quon a couvert
Deux techniques diffrentes pour tracer un paralllpipde (sonde) qui

pourra ensuite tre entoure de champs divers dtudes

alphorm.com

Fondamentaux MATLAB 2013a

Les graphiques
Animation d'un graphique
2D ou 3D avec export
Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

103

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Animations 3D avec export *.gif ou *.avi

IV5

Fondamentaux MATLAB 2013a

alphorm.com

Ce quon a couvert
Principe d'animation des graphiques 2D ou 3D avec exports dans

diffrents formats communs

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

104

Diapositive 207
IV5

Attention c'est anim!


ISOZ Vincent; 03/05/2014

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Les graphiques
Analyse dquations de
champs
Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

Analyse dquations de champs

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

105

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Ce quon a couvert
Un cas classique dcole dans MATLAB danalyse et de reprsentation

de champ vectoriel et dquipotentielles partir dune fonction explicite

alphorm.com

Fondamentaux MATLAB 2013a

Les graphiques
Analyse d'instantans de
champs de vecteurs
Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

106

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Analyse d'instantans de champs de vecteurs

Fondamentaux MATLAB 2013a

alphorm.com

Ce quon a couvert
Comment dcortiquer un jeu de donnes reprsentant un champ

vectoriel tape par tape


Diffrentes reprsentations classiques et intuitives des champs

vectoriels
Une analyse critique du pige du niveau de dtails de certaines

reprsentations

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

107

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Les graphiques
Rgression MCO univarie
(sans Toolbox!)
Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

Rgression avec assistant

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

108

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Rgression OLS sans toolbox avec polyfit

Fondamentaux MATLAB 2013a

alphorm.com

Ce quon a couvert
Comment faire une rgression linaire OLS univarie sans Toolbox
Remarque: Aller sur le File Exchange de Matlab pour sans toolbox et

sans rinventer la roue obtenir les statistiques classique de la rgression


linaire, rgression orthogonale (Deming), la rgression non
paramtrique, les rgressions gnralises, la rgression quantile,
l'interpolation de Lagrange, LOESS,

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

109

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Les graphiques
Interpolation par spline
(sans Toolbox!)
Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

Interpolation par splines 2D/3D

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

110

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Ce quon a couvert
Comment faire une interpolation 2d ou 3D par splines sans utiliser la

"Spline toolbox" de Matlab


Remarque: Aller sur le File Exchange de Matlab pour sans toolbox et

sans rinventer la roue obtenir de nombreux autres modles de splines

alphorm.com

Fondamentaux MATLAB 2013a

Les graphiques
Exporter en tant quimage

Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

111

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Ce quon a couvert
Comment enregistrer une image du graphique sur le disque
Comment copier une image du graphique dans le presse-papier

alphorm.com

Fondamentaux MATLAB 2013a

Analyse
Introduction

Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

112

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Informations
Dcouverte des fonctions intgres dans le moteur de base (sans toolbox) relatifs l'analyse

mathmatique
Pas de fonctions intgres pour l'optimisation linaire ou non linaire sans la Optimization

Toolbox

Pas de fonctions intgres pour le calcul des limites sans la Symbolic Toolbox
Pas de fonctions intgres pour le calcul des sries de Taylor sans la Symbolic Toolbox
Pas de fonctions intgres pour le calcul des sries de Fourier sans la Symbolic Toolbox
Pas de fonctions intgres pour la rsolution d'ODL sans la Symbolic toolbox
Pas transforme de Laplace ou transforme en Z sans la Symbolic toolbox

alphorm.com

Fondamentaux MATLAB 2013a

Analyse
valuer la valeur d'un
polynme univari
Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

113

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Plan
Dcouverte de la fonction polyval

Fondamentaux MATLAB 2013a

alphorm.com

Ce quon a couvert
Une fonction triviale

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

114

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Analyse
Recherche de zros de
polynmes univaris
Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

roots et fzero
Dcouverte de la fonction roots en combinaison avec des techniques de

reprsentation graphique des racines


Dcouverte de la fonction fzero

pour les zros de fonctions non


linaires (non polynomiales)

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

115

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Ce quon a couvert
Deux fonctions triviale particulirement utiles en physique et dans

certains modles en finance

alphorm.com

Fondamentaux MATLAB 2013a

Analyse
Recherche de minima/maxima
local de fonctions uni et
bivaries
Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

116

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

fmbind
Dcouverte de la fonction fminbnd en combinaison avec des techniques

de reprsentations graphiques pour chercher les minima

Fondamentaux MATLAB 2013a

alphorm.com

find
Utilisation des fonctions fminsearch ou find pour rechercher un

optimum dans une fonction symbolique ou une fonction matricielle et


reprsentation sous forme graphique

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

117

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Ce quon a couvert
Deux fonctions de recherche d'optimum locaux de fonction univaries

ou bivaries
Il n'y a pas de fonctions sans toolbox permettant de trouver un

optimum global

alphorm.com

Fondamentaux MATLAB 2013a

Analyse
Convolution et
Dconvolution (discrtes)
Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

118

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Plan
Contrle du bon fonctionnement en conformit avec la thorie de la

fonction conv et deconv


Application de la conv la somme des variables alatoires

indpendantes et remarque vis--vis de la simulation de Monte-Carlo

Fondamentaux MATLAB 2013a

alphorm.com

Ce quon a couvert
Les bases de la convolution qui sera particulirement utile finalement

aux ingnieurs actifs dans le traitement du signal ou de l'image

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

119

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Analyse
Intgration pseudo-symbolique
de polynmes ou numrique
gnrale
Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

Fondamentaux MATLAB 2013a

alphorm.com

Plan
Intgration de polynmes univaris avec la fonction polyint
Intgration de fonctions explicites univaries avec la fonction integral
Intgration numrique avec la mthode du trapze avec la fonction

trapez et cumtrapz
Intgration de fonctions explicites bivaries avec la fonction integral2

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

120

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Ce quon a couvert
Les cas d'intgrations mathmatiques scolaires les plus classiques
Constat de l'absence d'intgration symbolique gnrale sans la

Symbolic Toolbox

alphorm.com

Fondamentaux MATLAB 2013a

Analyse
Drivation pseudo-symbolique de
polynmes ou numrique
gnrale
Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

121

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Plan
Drivation de polynmes univaris avec la fonction polyder
Drivation numrique avec la fonction diff

Fondamentaux MATLAB 2013a

alphorm.com

Ce quon a couvert
Les cas des drivations mathmatiques scolaires les plus classiques
Le problme des arrondis dues aux prcisions des nombres
Constat de l'absence de drivation symbolique gnrale sans la

Symbolic Toolbox

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

122

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Analyse
Rsolution numrique d'quations
diffrentielles ordinaires

Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

Plan
Rsolution numrique d'quations diffrentielles d'ordre un ou deux

avec la fonction ode45 et plots classiques associs (cas particulier de


lODE non linaire pendule non forc et non amorti)

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

123

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Ce quon a couvert
Les cas de rsolution d'une quation diffrentielle non-linaire d'ordre 2

scolaire typique en passant par une transformation en un systme de


deux EDO d'ordre 1

alphorm.com

Fondamentaux MATLAB 2013a

Analyse
Rsolution numrique
de systmes d'quations
diffrentielles ordinaires
Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

124

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Plan
Rsolution numrique de systmes d'quations diffrentielles ordinaires

avec la fonction ode45 et plots classiques associs (cas particulier du


systme ODE non linaire coupl de Lotka-Volterra)

dN
= N NP
dt
dP
= NP N
dt

Fondamentaux MATLAB 2013a

alphorm.com

Ce quon a couvert
Nous venons de constater que puisque l'algorithme ode45 a besoin

obligatoirement en entre d'EDO du premier ordre que finalement que


l'on travaille sur une unique EDO ou sur un systme d'EDO, le principe
est en grossirement toujours le mme

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

125

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Analyse
Rsolution numrique d'quations
diffrentielles partielles
paraboliques 1D
Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

Plan
Rsolution numrique d'quations diffrentielles partielles avec la

fonction pdepe et plots classiques associs (cas particulier de l'quation


de la chaleur)

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

126

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Problme de dpart

Doit tre transform sous la forme gnrale:

Fondamentaux MATLAB 2013a

alphorm.com

tape 1: PDEX

Quon crit explicitement en:

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

127

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

tape 2: PDEXIC

Fondamentaux MATLAB 2013a

alphorm.com

tape 3: PDEXBC
Forme gnrale des BC:

Borne gauche:

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

Borne droite:

alphorm.com

128

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Ce quon a couvert
La fonction pdex pour dfinir l'quation diffrentielle
La fonction pdexic pour dfinir les conditions initiales (ic: initial

conditions)
La fonction pdexbc pour dfinir les conditions aux bords (bc: boundary

conditions)
Le mix des trois fonctions prcdentes dans la fonction pdepe pour

rsoudre le problme

alphorm.com

Fondamentaux MATLAB 2013a

Analyse
Transforme de Fourier
discrte
Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

129

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Plan
Dcouverte de la fonction de transforme de fourier discrte fft pour

dtecter les frquences et amplitudes des harmoniques masques sous


jacentes et sa transforme inverse ifft

Fondamentaux MATLAB 2013a

alphorm.com

Ce quon a couvert
Une fonctionnalit majeure dans le traitement acoustique ou de tout

signal en gnral
Une fonction galement parfois utilise en finance pour dtecter des

harmoniques

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

130

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Traitement d'images
Remarques pralables
(communes) sur les
images, vidos et sons
Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

Informations
Restriction aux fonctions natives (pas d'usage de la Signal

Processing Toolbox ou de la Image Processing Toolbox)


Sources fichiers en post-traitement et non en temps rel

(pas d'usage de l'Acquisition Toolbox)


Garder en tte qu'une vido n'est qu'une succession

d'images (accessoirement avec du son)


Que les principes de bases tudis car ce ne sont "que" des

maths en fin de compte et un peu de logique et de bon


sens
Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

131

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Traitement d'images
Obtenir des informations
sur les images
Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

Plan
imfinfo : obtenir les mtadonnes sur les images
size : pour obtenir directement la taille d'une image

imread : pour stocker une image dans une variable

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

132

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Ce quon a couvert
Quelques fonctions disponibles sans la Image Processing Toolbox pour

obtenir des informations (parfois importantes) sur les images

alphorm.com

Fondamentaux MATLAB 2013a

Traitement d'images
Traiter les couches des
images et enregistrer le
rsultat
Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

133

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Plan
image: afficher une image proprement dans une figure
Travailler sur les pixels des couches RVB
Convertir en niveaux de gris

imwrite: enregistrer l'image

Fondamentaux MATLAB 2013a

alphorm.com

Ce quon a couvert
Comprendre la structure matricielle d'une image RGB
Quelques fonctions disponibles sans la Image Processing Toolbox pour

effectuer quelques traitements triviaux sur les images

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

134

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Traitement d'images
Traiter les pixels dune
image et enregistrer le
rsultat
Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

Plan
Utiliser notre comprhension de la structure d'une image
RGB pour filtrer une image sur sa luminosit (utile en
Astronomie, Astrophysique, Mdecine nuclaire)

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

135

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Ce quon a couvert
Un autre cas classique des traitements d'images en travaillant cette fois
non pas sur une couche alpha sur son ensemble mais pixel par pixel.
Permet de faire du filtrage mais aussi avec les connaissances adquates
en mathmatiques de la reconnaissances de formes (mais privilgier
quand mme la Toolbox ad hoc pour ne pas recrer la roue)

alphorm.com

Fondamentaux MATLAB 2013a

Traitement d'images
Dessiner sur une image et
enregistrer le rsultat
Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

136

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Plan
Utile lors de traitements vidos ou d'images pour mettre
en vidences des zones reconnues par l'algorithme pour
mise en vidence (souvent associ du comptage
automatique ensuite)

Fondamentaux MATLAB 2013a

alphorm.com

Ce quon a couvert
Une mthode pour mettre en vidence visuellement une zone d'intrt
sur une image (ou vido).
La tradition fait qu'on utilise souvent des rectangles mais on peut jouer
aussi avec la fonction scatter pour dessiner des petites croix ou autre

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

137

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Traitement d'images
Comparer des images

Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

Plan
Comparaison d'une image une image talon: trs utile
pour l'analyse automatise de dfauts de production

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

138

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Ce quon a couvert
Une mthode pour mettre en vidence visuellement une diffrence
(nouvel objet, impuret, dfaut) entre une image quelconque et son
image talon correspondante

alphorm.com

Fondamentaux MATLAB 2013a

Traitement d'images
Superposer des images

Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

139

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Plan
Superposition d'images en transparence (particulirement
utile en astronomie et astrophysique)

Fondamentaux MATLAB 2013a

alphorm.com

Ce quon a couvert
Une technique simple pour superposer deux images avec fonds noir de
faon ventuellement automatise dans le cadre d'installation
astronomiques autonomes.

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

140

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Traitement de vidos
Obtenir des informations
sur les vidos
Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

Plan
Extraire les mtadonnes d'une vido l'aide de la fonction mmfileinfo

(sans la Vision System Toolbox)

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

141

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Ce quon a couvert
La manire d'extraire des informations simples sur un fichier vido

alphorm.com

Fondamentaux MATLAB 2013a

Traitement de vidos
Jouer une vido et en
extraire des images
Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

142

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Plan
Extraire des images d'une vido avec la fonction read
Jouer une vido (sans la Vision System Toolbox)

Fondamentaux MATLAB 2013a

alphorm.com

Ce quon a couvert
Extraire une image d'une vido (pour faire le post-traitement que l'on

veut dessus par la suite)


Contourner l'absence de lecteur vidos dans MATLAB sans toolbox

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

143

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Traitement de vidos
Exporter toutes les images
d'une vido
Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

Plan
Extraire toutes les images d'une vido pour post-traitement automatis

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

144

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Ce quon a couvert
Un sujet extrmement important pour l'analyse et le traitement

automatis en post-production reste plus qu' recompiler le tout en


une vido

alphorm.com

Fondamentaux MATLAB 2013a

Traitement de vidos
Compiler des images dans
une vido
Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

145

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Plan
Compiler des images dans une vido unique l'aide des fonctions

Videowriter et writevideo

Fondamentaux MATLAB 2013a

alphorm.com

Ce quon a couvert
Aprs avoir fait un post-traitement d'images exportes d'une vido

comment recomposer cette dernire (sans le son bien videmment)

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

146

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Traitement de sons
Obtenir des informations
sur les sons
Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

Plan
Extraire les mtadonnes d'un son l'aide de la fonction audioinfo (sans

la Signal Processing Toolbox)

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

147

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Ce quon a couvert
La manire d'extraire des informations simples sur un fichier audio

alphorm.com

Fondamentaux MATLAB 2013a

Traitement de sons
Contrler la lecture d'un
son
Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

148

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Plan
Play: Fonction pour jouer un son
Pause: Fonction pour faire une pause dans la lecture
Resume: Pour reprendre la lecture
Stop: Pour arrter la lecture dfinitivement

Fondamentaux MATLAB 2013a

alphorm.com

Ce quon a couvert
Le contrle de lecture d'un son
Ncessite absolument la cration d'un GUI

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

149

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Traitement de sons
Afficher le spectre d'un
son
Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

Plan
Comprendre la structure d'un
fichier son pour en reprsenter le
spectre d'amplitude mono ou
double canal

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

150

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Ce quon a couvert
Un grand classique pour tous ceux qui ont dj travaill avec un fichier
d'ditions sonore

alphorm.com

Fondamentaux MATLAB 2013a

Traitement de sons
Transforme de Fourier
discrte d'un son
Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

151

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Plan
Retour sur ce qui a t vu dans le chapitre d'analyse mais appliqu un
son

Fondamentaux MATLAB 2013a

alphorm.com

Ce quon a couvert
Une transformation importante pour analyser les aigus et les basses d'un
son et pouvoir faire par la suite quelques transformations mathmatiques
ad hoc

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

152

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Traitement de sons
Gnrer (crer) ou
compiler des sons
Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

Plan
Gnrer des sons artificiels
Squences des sons
Jouer des sons en parallle

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

153

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Ce quon a couvert
Un exemple de gnration (cration) et in extenso de transformation
simple de sons qui peut mener avec de l'imagination et de la matrise
mathmatique : du filtrage, de la compression dynamique, de l'ajout
d'cho, etc.

alphorm.com

Fondamentaux MATLAB 2013a

Scripts
Introduction concernant
le scripting
Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

154

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Plan
Expliquer l'importance du scripting
Petites informations concernant le scripting dans Matlab ces dernires annes
Problmes du langage de script Matlab

IV6

Bonnes pratiques (effacer les variables existantes, nettoyer la fentre de

commande, fermer toutes les fentres)


Transformer en prcompil (*.p)
Compilation en C++/.Net ou JAVA avec la Compiler toolbox pour applications

industrielles (~7'000$)
Les *.exe ncessitent malheureusement le MATLAB Compiler Runtime (MCR)

(566MB!!! mais gratuit)

Fondamentaux MATLAB 2013a

alphorm.com

Ce quon a couvert
Quelques informations pour la culture gnrale MATLAB
Pour aller un peu plus en profondeur:

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

155

Diapositive 309
IV6

pas de typage
language procdural (non orient objet)
pas de distinction entre procdure et fonctions
compilation x32/x64

ISOZ Vincent; 02/10/2014

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Scripts
Prfrences de l'diteur de
script
Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

Fondamentaux MATLAB 2013a

alphorm.com

Plan
Dsactiver l'ouverture automatique des derniers fichiers *.m
Dsactiver la limite de page
Dsactiver la tabulation automatique

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

156

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Ce quon a couvert
Les prfrences de l'diteur de script les plus demandes par les
praticiens de MATLAB

alphorm.com

Fondamentaux MATLAB 2013a

Scripts
crire des commentaires
et utiliser l'autocompltion
Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

157

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Plan
Rappels sur les traditions de la tabulation
Crer des lignes de commentaires
Commenter plusieurs lignes
Crer des blocs d'xecution
Utiliser l'autocompltion
Utiliser l'accs aux sous-fonctions

Fondamentaux MATLAB 2013a

alphorm.com

Ce quon a couvert
Une mthode de travail (de base) pour avoir un script bien structur
Une mthode de travail pour pouvoir comprendre ce script plus tard
Des mthodes de confort d'criture et de consultation

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

158

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Scripts
Dfinir le texte d'aide

Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

Plan
Associer simplement une petite aide pour les petits scripts qui s'affichera
l'appel de la commande help nom_du_script

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

159

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Ce quon a couvert
Les fondamentaux de la cration d'une aide avec une fonction
Il est possible videmment d'aller beaucoup plus loin en crant des

fichiers d'aide Matlab

alphorm.com

Fondamentaux MATLAB 2013a

Scripts
Syntaxe des fonctions

Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

160

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Plan
Rappel sur le nommage des fichiers pour pouvoir utiliser les fonctions
Fonctions n paramtres obligatoires en entre et m paramtres en sortie
Grer les arguments optionnels
Utilisation de fonctions locales ou imbriques
Fonctions rcursives

Fondamentaux MATLAB 2013a

alphorm.com

Ce quon a couvert
Quelques gnralits ultra-classiques concernant l'criture de fonctions

spcifiques au langage de script MATLAB


Une bonne pratique pour crire des scripts plus facilement

maintenables (diviser pour mieux rgner)

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

161

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Scripts
Porte des variables

Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

Plan
Variables locales vs globales
Variables persistantes

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

162

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Ce quon a couvert
Des mthodes d'utilisation et de dclaration des variables qui peuvent
tre trs utiles dans certaines situations

alphorm.com

Fondamentaux MATLAB 2013a

Scripts
Gestion des erreurs

Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

163

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Plan
Grer les erreurs et exceptions de faon (relativement) gnrale avec try

catch

Fondamentaux MATLAB 2013a

alphorm.com

Ce quon a couvert
Une technique (relativement) gnrale de gestion des erreurs trs
courante dans le domaine de la programmation informatique

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

164

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Scripts
Utilisation des structures
conditionnelles
Site : http://www.alphorm.com
Blog : http://www.alphorm.com/blog
Forum : http://www.alphorm.com/forum
Fondamentaux MATLAB 2013a

Vincent ISOZ
Formateur et Consultant indpendant
Ingnierie statistique et financire

alphorm.com

Plan
Introduction auxif elseif else end
Introduction aux switch case otherwise end
Rappels sur les relations d'ordres ==, ~=, <, >, >=,<= associes aux
conditions
Rappels sur les oprateurs logiques boolens AND &, et OR associs aux
conditions&

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

165

alphorm.com-support de la
formation Les fondamentaux de
Matlab 2013A

14/06/2014

Ce quon a couvert
La premire structure majeure commune tous les langages de script et
de programmation de la plante

Fondamentaux MATLAB 2013a

TOUTE UTILISATION EN DEHORS


D'ALPHORM EST INTERDITE

alphorm.com

166

Вам также может понравиться