Biomodèles/Biomodels
SCILAB 3.0 PAS A PAS
SCILAB 3.0 STEP-TO-STEP

Jacques-Deric Rouault

Laboratoire de Neurobiologie de l'Apprentissage, de la Mémoire et de la Communication. CNRS UMR 8620, Bat. 446, Université Paris-Sud, F91400 Orsay

Orscilab
ORSCILAB

17 VECTEURS, MATRICES ET HYPERMATRICES
17 VECTORS, MATRICES AND HYPERMATRICES
17.6 Fonctions / Functions
Version 2.1.2 du 13 Février 2005 / Version 2.1.2, February 13th 2005
Biomodèles/Biomodels N°1 pp 0x-0y Décembre 2004 December 2004

Retour à la Table générale / Return to the General table
Index général / General index
Passage à la section suivante 18.1 / Next section 18.1

a
Fonction terme à terme (Matrice)
Term to term function (Matrix)

b
isempty (Matrice, Matrix)
c
pertrans (Matrice, Matrix)
Pertransposition (Matrice, Matrix)

d
sub2ind (Matrice, Matrix)
e
ind2sub (Matrice, Matrix)
f
vectorfind (Matrice, Matrix)
g
toeplitz (Matrice, Matrix)

Régle générale : les fonctions qui opérent sur un type opèrent élément par élément (terme à terme) sur une matrice du type.
General rule : the functions which act on a type acts element per element (term to term) on a matrix of the type.

Par exemple, avec une matrice de flottants :
For instance, with a matrix of floats:


// PROGRAMME SPAS170601
m1 = [1, -2, -3; 4, -5, 6];
m2 = sign (m1),

Ch17Sc06-Fig01

La fonction isempty permet de tester si une matrice est vide, autrement dit réduite à la variable vide []..
The function isempty tests if a metrix is empty, i.e. reduced to the empty variable [].

// PROGRAMME SPAS170602
m = [1, -2, -3; 4, -5, 6];
b = isempty (m),

Ch17Sc06-Fig02

La fonction pertrans permet de pertransposer une matrice (symétrie par rapport à la seconde diagonale).
The function pertrans pertransposes a matrix (symetry according to the second diagonal).

// PROGRAMME SPAS170603
m1 = [1, -2, -3; 4, -5, 6];
m2 = pertrans (m1),

Ch17Sc06-Fig03

La fonction sub2ind convertit les index de rangs et de colonnes en un index unique. On précisera le vecteur des dimensions, dans l'exemple  [2, 3]. Voir la section 17.2 Gestion des éléments.
The function sub2ind converts the indexes of raws and columns into a unique index. The vector of dimensions has to be explicited: [2, 3] in the example. See the section 17.2 Management of elements.

// PROGRAMME SPAS170604
i = sub2ind ([2,3], 2, 1),
m1 = [1, -2, -3; 4, -5, 6];
m1 (i),

Ch17Sc06-Fig04

La fonction ind2sub effectue la conversion inverse. On précisera le vecteur des dimensions, dans l'exemple  [2, 3]. Voir la section 17.2 Gestion des éléments.
The function ind2sub performs the inverse conversion. The vector of dimensions has to be explicited: [2, 3] in the example. See the section 17.2 Management of elements.

// PROGRAMME SPAS170605
[r, c] = ind2sub ([2,3], 2),

Ch17Sc06-Fig05

La fonction vectorfind retourne les rangs des lignes ou des colonnes d'une matrice dont les valeurs correspondent à celles d'un vecteur de réference.
The function vectorfind returns the ranks of raws or columns of a matrix which values correpsond to a reference vector .

// PROGRAMME SPAS170606
v = [1, 2];
m = [1, 1; 1, 2; 1, 3; 1, 2; 2, 1; 1, 2];
r = vectorfind (m, v,"r"),

Ch17Sc06-Fig06

// PROGRAMME SPAS170607
v = [1, 1, 1, 1, 2, 1];
m = [1, 1; 1, 2; 1, 3; 1, 2; 2, 1; 1, 2];
c = vectorfind (m, v,"c"),

Ch17Sc06-Gif07

La fonction toeplitz retourne la matrice de Toeplitz d'une matrice complexe, flottante, polynomiale ou de chaines de caractères.
The function toeplitz returns the Toeplitz matrix of a complex, float, polynom or string matrix.

// PROGRAMME SPAS170608
m1 = [1, 2, 3; 4, 5, 6; 7, 8, 9];
m2 = toeplitz (m1),

Ch17Sc06-Fig08

Retour à la Table générale / Return to the General table
Index général / General index
Passage à la section suivante 18.1 / Next section 18.1