La lecture en ligne est gratuite
Le téléchargement nécessite un accès à la bibliothèque YouScribe
Tout savoir sur nos offres
Télécharger Lire

cours-matlab-bernard

51 pages
2008–2009ecrins% matlab -nojvm< M A T L A B >Copyright 1984-2006 The MathWorks, Inc.Version 7.3.0.298 (R2006b)August 03, 2006This is a Classroom License for instructional use only.Research and commercial use is prohibited.To get started, type one of these: helpwin, helpdesk, or demo.For product information, visit www.mathworks.com.>> quitecrins%1>> help sinSIN Sine.SIN(X) is the sine of the elements of X.Overloaded methodshelp sym/sin.m>> sin(2)ans =0.9093>> SIN(2)??? Undefined variable or capitalized internal function SIN;Caps Lock may be on.>> helpHELP topics:matlab/general - General purpose commands.matlab/ops - Operators and special characters.matlab/lang - Programming language constructs.matlab/elmat - Elementary matrices and matrix manipulation.matlab/elfun - math functions.matlab/specfun - Specialized mathmatlab/matfun - Matrix functions - numerical linear algebra.matlab/datafun - Data analysis and Fourier transforms.matlab/polyfun - Interpolation and polynomials.matlab/funfun - Function functions and ODE solvers.matlab/sparfun - Sparse matrices.matlab/graph2d - Two dimensional graphs.matlab/graph3d - Threematlab/specgraph - Specialized graphs.matlab/graphics - Handle Graphics.matlab/uitools - Graphical user interface tools.matlab/strfun - Character strings.matlab/iofun - File input/output.matlab/timefun - Time and dates.2matlab/datatypes - Data types and structures.matlab/demos - Examples and demonstrations.toolbox ...
Voir plus Voir moins

2008–2009ecrins% matlab -nojvm
< M A T L A B >
Copyright 1984-2006 The MathWorks, Inc.
Version 7.3.0.298 (R2006b)
August 03, 2006
This is a Classroom License for instructional use only.
Research and commercial use is prohibited.
To get started, type one of these: helpwin, helpdesk, or demo.
For product information, visit www.mathworks.com.
>> quit
ecrins%
1>> help sin
SIN Sine.
SIN(X) is the sine of the elements of X.
Overloaded methods
help sym/sin.m
>> sin(2)
ans =
0.9093
>> SIN(2)
??? Undefined variable or capitalized internal function SIN;
Caps Lock may be on.
>> help
HELP topics:
matlab/general - General purpose commands.
matlab/ops - Operators and special characters.
matlab/lang - Programming language constructs.
matlab/elmat - Elementary matrices and matrix manipulation.
matlab/elfun - math functions.
matlab/specfun - Specialized math
matlab/matfun - Matrix functions - numerical linear algebra.
matlab/datafun - Data analysis and Fourier transforms.
matlab/polyfun - Interpolation and polynomials.
matlab/funfun - Function functions and ODE solvers.
matlab/sparfun - Sparse matrices.
matlab/graph2d - Two dimensional graphs.
matlab/graph3d - Three
matlab/specgraph - Specialized graphs.
matlab/graphics - Handle Graphics.
matlab/uitools - Graphical user interface tools.
matlab/strfun - Character strings.
matlab/iofun - File input/output.
matlab/timefun - Time and dates.
2matlab/datatypes - Data types and structures.
matlab/demos - Examples and demonstrations.
toolbox/compiler - MATLAB Compiler
images/images - Image Processing Toolbox.
images/imdemos - Toolbox --- demos and sample images
toolbox/local - Preferences.
nnet/nnet - Neural Network Toolbox.
nnet/nndemos - Demonstrations.
toolbox/optim - Optimization Toolbox.
toolbox/signal - Signal Processing Toolbox.
toolbox/stats - Statistics Toolbox.
toolbox/symbolic - Symbolic Math
toolbox/tour - MATLAB Tour
Graphics/MatDraw - MatDraw GUI Toolbox
For more help on directory/topic, type "help topic".
>> help matfun
>> a=2
a=
2
>> whos
Name Size Bytes Class
a 1x1 8 double array
Grand total is 1 elements using 8 bytes
>> clear
>> whos
>>
3>> x=[ 1 2 3 ]
x=
123
>> y=[ 2, 3, 4]
y=
234
>> z=[ 5 ; 6 ; 7]
z=
5
6
7
>> A=[1 2 ; 5 6 ; 7 8]
A=
12
56
78
>> b=[ 1 2 3 ] ; % Ceci est un commentaire pour souligner l’effet de ";"
>> whos
Name Size Bytes Class
A 3x2 48 double array
b 1x3 24
x 1x3 24 double array
y 1x3 24
z 3x1 24 double array
Grand total is 18 elements using 144 bytes
>> x
x=
4123
>> x+y
ans =
357
>> y + [ 4 5 7]
ans =
6 8 11
>> x=2.6
x=
2.6000
>> pi
ans =
3.1416
>> 1/0
Warning: Divide by zero.
ans =
5Inf
>> ans+1
ans =
Inf
>> 0/0
Warning: Divide by zero.
ans =
NaN
>> i
ans =
0+ 1.0000i
>> sqrt(-1)
ans =
0+ 1.0000i
>> j
ans =
0+ 1.0000i
>> j+1
ans =
1.0000+ 1.0000i
>> [ real(2+i) ; imag(2+i)]
ans =
2
61
>> v=[ 2+i ; 4+7i]
v=
2.0000+ 1.0000i
4.0000+ 7.0000i
>> [ real(v) imag(v)]
ans =
21
47
>> help isreal
ISREAL True for real array.
ISREAL(X) returns 1 if all elements in X have zero
imaginary part and 0 otherwise.
˜ISREAL(X) detects complex arrays (i.e., arrays that have
a non-zero real part).
See also REAL, IMAG, I, J.
>> 9ˆ1/2
ans =
4.5000
>> 9ˆ(1/2)
ans =
73
Relational operators.
eq - Equal ==
ne - Not equal ˜=
lt - Less than <
gt - Greater than >
le - Less than or equal <=
ge - Greater than or equal >=
Logical operators.
and - Logical AND &
or - OR |
not - Logical NOT ˜
xor - EXCLUSIVE OR
any - True if any element of vector is nonzero
all - True if all elements of are
>> (1>2) | 1
ans =
1
>>
8