<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">  <!--Converted with LaTeX2HTML 2K.1beta (1.50) original version by:  Nikos Drakos, CBLU, University of Leeds * revised and updated by:  Marcus Hennecke, Ross Moore, Herb Swan * with significant contributions from:   Jens Lippmann, Marek Rouchal, Martin Wilck and others --> <HTML> <HEAD> <TITLE>Matrices matrix ...</TITLE> <META NAME="description" CONTENT="Matrices matrix ..."> <META NAME="resource-type" CONTENT="document"> <META NAME="distribution" CONTENT="global">  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> <META NAME="Generator" CONTENT="LaTeX2HTML v2K.1beta"> <META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">  <LINK REL="STYLESHEET" HREF="matlab.css">  <LINK REL="previous" HREF="node10.html"> <LINK REL="up" HREF="node5.html"> <LINK REL="next" HREF="node12.html"> </HEAD>  <BODY > <!--Navigation Panel--> <A NAME="tex2html207"   HREF="node12.html"> <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next"  SRC="file:/usr/lib/latex2html/icons/next.png"></A>  <A NAME="tex2html203"   HREF="node5.html"> <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up"  SRC="file:/usr/lib/latex2html/icons/up.png"></A>  <A NAME="tex2html199"   HREF="node10.html"> <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous"  SRC="file:/usr/lib/latex2html/icons/prev.png"></A>  <A NAME="tex2html205"   HREF="node1.html"> <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents"  SRC="file:/usr/lib/latex2html/icons/contents.png"></A>   <BR> <B> Next:</B> <A NAME="tex2html208"   HREF="node12.html">Programmation</A> <B> Up:</B> <A NAME="tex2html204"   HREF="node5.html">Prise en main de</A> <B> Previous:</B> <A NAME="tex2html200"   HREF="node10.html">Vecteurs vectors...</A>  &nbsp <B>  <A NAME="tex2html206"   HREF="node1.html">Contents</A></B>  <BR> <BR> <!--End of Navigation Panel-->  <H2><A NAME="SECTION00056000000000000000"></A><A NAME="tableaux"></A> <BR> Matrices <I>matrix</I> ... </H2>  <P> Les matrices suivent la m&#234;me syntaxe que les vecteurs. Les composantes des lignes sont s&#233;par&#233;es par des virgules et chaque ligne est s&#233;par&#233;e de l'autre par un point virgule.  <P> <PRE> &gt;&gt; &gt;&gt; A=[a+1 2 3      0 0 atan(1)      5 9 -1]     %definition d'une matrice 3 x 3  A =     2.0000    2.0000    3.0000          0         0    0.7854     5.0000    9.0000   -1.0000 &gt;&gt;v=1:5;W=v'*v           % multiplication de matrices W =      1     2     3     4     5      2     4     6     8    10      3     6     9    12    15      4     8    12    16    20      5    10    15    20    25 &gt;&gt;W(1,:)                 %extraction de  la premiere ligne  ans  =    1.    2.    3.    4.    5.  &gt;&gt;A=eye(3,3)     % Matrice identite A =      1     0     0      0     1     0      0     0     1 &gt;&gt;B=toeplitz([2,1,0,0])   % Matrice de Toeplitz B =      2     1     0     0      1     2     1     0      0     1     2     1      0     0     1     2 </PRE> Le tableau <A HREF="node11.html#tab_matrice">1.6</A> r&#233;sume les principales fonctions affectant ou effectuant des op&#233;rations sur des matrices. Noter que les fonctions scalaires courantes, (sin, exp, etc...) peuvent aussi s'appliquer &#224; des matrices, composante par composante, comme dans l'exemple suivant <BR><PRE> &gt;&gt;u=[0:1:4] u =      0     1     2     3     4 &gt;&gt;v=sin(u)  v =          0    0.8415    0.9093    0.1411   -0.7568 </PRE>  <P> La fonction <IMG  WIDTH="86" HEIGHT="31" ALIGN="MIDDLE" BORDER="0"  SRC="img12.png"  ALT="$find(C(A))$"> renvoie les indices dans le tableau <IMG  WIDTH="16" HEIGHT="14" ALIGN="BOTTOM" BORDER="0"  SRC="img7.png"  ALT="$A$"> des composantes v&#233;rifiant la condition <IMG  WIDTH="41" HEIGHT="31" ALIGN="MIDDLE" BORDER="0"  SRC="img13.png"  ALT="$C(A)$">. Par exemple <PRE> &gt;&gt;A=rand(1,5)    % cree un vecteur ligne contenant 5 nombres repartis                                 % aleatoirement entre 0 et 1 &gt;&gt;find(A&gt;0.5)    % renvoie les indices des composantes de A &gt;0.5 &gt;&gt;find(A)         % renvoie les indices des composantes de A differentes de 0 &gt;&gt;find(A==0.2)    % renvoie les indices des composantes de A egales a 0.2 </PRE> <BR><P></P> <DIV ALIGN="CENTER"><A NAME="1642"></A> <TABLE> <CAPTION><STRONG>Table 1:</STRONG> principales op&#233;rations sur les matrices.</CAPTION> <TR><TD><A NAME="tab_matrice"></A><TABLE CELLPADDING=3 BORDER="1"> <TR><TD ALIGN="LEFT">Fonction</TD> <TD ALIGN="LEFT">Description</TD> </TR> <TR><TD ALIGN="LEFT">ones(i,j)</TD> <TD ALIGN="LEFT">cr&#233;e un tableau de i lignes j colonnes contenant des 1</TD> </TR> <TR><TD ALIGN="LEFT">zeros(i,j)</TD> <TD ALIGN="LEFT">cr&#233;e un tableau de i lignes j colonnes contenant des 0</TD> </TR> <TR><TD ALIGN="LEFT">eye(i,j)</TD> <TD ALIGN="LEFT">cr&#233;e un tableau de i lignes j colonnes avec des 1 sur la diagonale principale et 0 ailleurs</TD> </TR> <TR><TD ALIGN="LEFT">toeplitz(u)</TD> <TD ALIGN="LEFT">cr&#233;e une matrice de Toeplitz sym&#233;trique dont la premi&#232;re ligne est le vecteur u</TD> </TR> <TR><TD ALIGN="LEFT">diag(u)</TD> <TD ALIGN="LEFT">cr&#233;e une matrice carr&#233;e avec le vecteur u sur la diagonale et 0 ailleurs</TD> </TR> <TR><TD ALIGN="LEFT">diag(U)</TD> <TD ALIGN="LEFT">extrait la diagonale de la matrice U</TD> </TR> <TR><TD ALIGN="LEFT">triu(A)</TD> <TD ALIGN="LEFT">renvoie la partie sup&#233;rieure de A</TD> </TR> <TR><TD ALIGN="LEFT">tril(A)</TD> <TD ALIGN="LEFT">renvoie la partie inf&#233;rieure de A</TD> </TR> <TR><TD ALIGN="LEFT">linspace(a,b,n)</TD> <TD ALIGN="LEFT">cr&#233;e un vecteur de n composantes uniform&#233;ment r&#233;parties de a &#224; b</TD> </TR> <TR><TD ALIGN="LEFT">A<IMG  WIDTH="12" HEIGHT="31" ALIGN="MIDDLE" BORDER="0"  SRC="img14.png"  ALT="$\backslash$">b</TD> <TD ALIGN="LEFT">r&#233;solution  du syst&#232;me lin&#233;aire <TT>Ax+b=0</TT></TD> </TR> <TR><TD ALIGN="LEFT">cond(A)</TD> <TD ALIGN="LEFT">conditionnement d'une matrice (norme euclidienne)</TD> </TR> <TR><TD ALIGN="LEFT">det(A)</TD> <TD ALIGN="LEFT">d&#233;terminant d'une matrice</TD> </TR> <TR><TD ALIGN="LEFT">rank(A)</TD> <TD ALIGN="LEFT">rang d'une matrice</TD> </TR> <TR><TD ALIGN="LEFT">inv(A)</TD> <TD ALIGN="LEFT">inverse d'une matrice</TD> </TR> <TR><TD ALIGN="LEFT">pinv(A)</TD> <TD ALIGN="LEFT">pseudo inverse d'une matrice</TD> </TR> <TR><TD ALIGN="LEFT">svd(A)</TD> <TD ALIGN="LEFT">valeurs singuli&#232;res d'une matrice</TD> </TR> <TR><TD ALIGN="LEFT">norm(A)</TD> <TD ALIGN="LEFT">norme matricielle ou vectorielle</TD> </TR> <TR><TD ALIGN="LEFT">u'</TD> <TD ALIGN="LEFT">prend le transpos&#233; de u</TD> </TR> <TR><TD ALIGN="LEFT">u*v</TD> <TD ALIGN="LEFT">multiplication matricielle</TD> </TR> <TR><TD ALIGN="LEFT">u+v</TD> <TD ALIGN="LEFT">addition matricielle</TD> </TR> <TR><TD ALIGN="LEFT">u-v</TD> <TD ALIGN="LEFT">soustraction matricielle</TD> </TR> <TR><TD ALIGN="LEFT">u.* v</TD> <TD ALIGN="LEFT">multiplication des tableaux u et v terme &#224; terme</TD> </TR> <TR><TD ALIGN="LEFT">u./v</TD> <TD ALIGN="LEFT">division du tableau u par le tableau v terme &#224; terme</TD> </TR> <TR><TD ALIGN="LEFT">find(C(A))</TD> <TD ALIGN="LEFT">indices des composantes du tableau A v&#233;rifiant la condition C(A)</TD> </TR> </TABLE> </TD></TR> </TABLE> </DIV><P></P> <BR><HR> <!--Navigation Panel--> <A NAME="tex2html207"   HREF="node12.html"> <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next"  SRC="file:/usr/lib/latex2html/icons/next.png"></A>  <A NAME="tex2html203"   HREF="node5.html"> <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up"  SRC="file:/usr/lib/latex2html/icons/up.png"></A>  <A NAME="tex2html199"   HREF="node10.html"> <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous"  SRC="file:/usr/lib/latex2html/icons/prev.png"></A>  <A NAME="tex2html205"   HREF="node1.html"> <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents"  SRC="file:/usr/lib/latex2html/icons/contents.png"></A>   <BR> <B> Next:</B> <A NAME="tex2html208"   HREF="node12.html">Programmation</A> <B> Up:</B> <A NAME="tex2html204"   HREF="node5.html">Prise en main de</A> <B> Previous:</B> <A NAME="tex2html200"   HREF="node10.html">Vecteurs vectors...</A>  &nbsp <B>  <A NAME="tex2html206"   HREF="node1.html">Contents</A></B>  <!--End of Navigation Panel--> <ADDRESS> Postel Marie 2002-10-03 </ADDRESS> </BODY> </HTML> 
