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.4 Dimensions d'une matrice / Dimensions of a matrix
Version 2.1.1 du 4 Février 2005 / Version 2.1.1, February 4th 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 17.5 / Next section 17.5

a
ndims (Matrice, Matrix)
b
size (Matrice, Matrix)
c (size, Matrice, Matrix)
r (size, Matrice, Matrix)
1 (size, Matrice, Matrix)
2 (size, Matrice, Matrix)

c
size (Hypermatrice, Hypermatrix)
1 (size,
Hypermatrice, Hypermatrix)
2 (size,
Hypermatrice, Hypermatrix)
3 (size,
Hypermatrice, Hypermatrix)

* (size, Matrice, Matrix)
* (size, Hypermatrice, Hypermatrix)

La fonction ndims retrourne  le nombre de dimensions d'une matrice.
The function ndims retruns the number of dimensions of a matrix.

// PROGRAMME SPAS170401
m = [1, 2, 3; 4, 5, 6];
nd = ndims (m),

Ch17Sc04-Fig01

La fonction size retourne pour chacune des dimensions d'une matrice le nombre d'éléments.
The function size retruns for each of the dimensions of a matrix the number of elements.

// PROGRAMME SPAS170402
m = [1, 2, 3; 4, 5, 6];
[nl, nc] = size (m),

Ch17Sc04-Fig02

En spécifiant le second argument "r" ou 1, on obtient le nombre de lignes. En spécifiant "l" ou 2, on a le nombre de colonnes.
By specifying the second argument "r" or 1, the function returns the number of lines (raws). By specifying "c" or 2, it is the number of columns.

// PROGRAMME SPAS170403
m = [1, 2, 3; 4, 5, 6];
nl1 = size (m,"r"),
nl2 = size (m,1),
nc1 = size (m,"c"),
nc2 = size (m,2),


Ch17Sc04-Fig03

La fonction size retourne pour chacune des dimensions d'une hypermatrice le nombre d'éléments.
The function size returns for each of the dimensions of an hypermatrix the number of elements.

// PROGRAMME SPAS170404
h = hypermat ([2, 3, 4]);
n1 = size (h,1),
n2 = size (h,2),

n3 = size (h,3),


Ch17Sc04-Fig04

La fonction size avec le second argument "*" retourne le produit des nombres d'éléments par dimension.
The function size with the second argument "*" returns the product of the number of elements per dimension.

// PROGRAMME SPAS170405
m = [1, 2, 3; 4, 5, 6];
ne = size (m,"*"),

Ch17Sc04-Fig05

// PROGRAMME SPAS170406
h = hypermat ([2, 3, 4]);
ne = size (h,"*"),

Ch17Sc04-Fig06

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