Professional Documents
Culture Documents
b =
2.8000
>> a=5
a =
>> c="bonjour";
c="bonjour";
|
Error: The input character is not valid in MATLAB statements or expressions.
>> c="bonjour" ;
c="bonjour" ;
|
Error: The input character is not valid in MATLAB statements or expressions.
>>
>> c="bonjour"
c="bonjour"
|
Error: The input character is not valid in MATLAB statements or expressions.
>> char=c;
Undefined function or variable 'c'.
>> c='bonjour'
c =
bonjour
>> c='bonjour';
>>
>> who;
a b c
>> c
c =
bonjour
>> a
a =
>> v=[5 20 30 0]
v =
5 20 30 0
>> v'
ans =
5
20
30
0
>> length(v)
ans =
>> v[1:2]
v[1:2]
|
Error: Unbalanced or unexpected parenthesis or bracket.
u =
1 4 10 16
>> v*u
Error using *
Inner matrix dimensions must agree.
>> w=v*u
Error using *
Inner matrix dimensions must agree.
>> w=v*v'
w =
1325
>> w=u*v'
w =
385
>> w=u'*v
w =
5 20 30 0
20 80 120 0
50 200 300 0
80 320 480 0
>> w=v*u'
w =
385
>> w=u.*v
w =
5 80 300 0
>>
>> for n=2 :1:5 end
>> for n=2:1:5
n
end
n =
n =
n =
n =
>> n
n =
>> n(2)
Index exceeds matrix dimensions.
>> n(0)
Subscript indices must either be real positive integers or logicals.
>> v= [ 5 20 30 0]
v =
5 20 30 0
>> v(0)
Subscript indices must either be real positive integers or logicals.
>> v(1)
ans =
>> v(6)
Index exceeds matrix dimensions.
>> length(v)
ans =
>> size(v)
ans =
1 4
>> w=v.*v
w =
25 400 900 0
>> w=v²
w=v²
|
Error: The input character is not valid in MATLAB statements or expressions.
>> w=v^2
Error using ^
Inputs must be a scalar and a square matrix.
To compute elementwise POWER, use POWER (.^) instead.
>> w=v.^2
w =
25 400 900 0
w =
w =
10
w =
15
w =
20
w =
25
>>
>> who
ans n v w
g =
25 400 900 0
g =
25 400 900 0
g =
25 400 900 0
g =
25 400 900 0
25 400 900 0
k =
25 400 900 0
k =
25 400 900 0
k =
25 400 900 0
k =
25 400 900 0
>>
>> m=[1 5 8 7;2 7 0 9 ;1 3 5 8]
m =
1 5 8 7
2 7 0 9
1 3 5 8
>> det(m)
Error using det
Matrix must be square.
>> a=[4 2 ;3 8]
a =
4 2
3 8
>> det(a)
ans =
26
>> a=[4 2 1 ;3 8 3]
a =
4 2 1
3 8 3
>> det(a)
Error using det
Matrix must be square.
a =
4 2 1
3 8 3
4 8 7
>> det(a)
ans =
102
>> b=a'
b =
4 3 4
2 8 8
1 3 7
>> s=2+5j
s =
2.0000 + 5.0000i
>> mod(s)
Error using mod
Not enough input arguments.
>> s=2+5j
s =
2.0000 + 5.0000i
>> s=2+5j
s =
2.0000 + 5.0000i
>> arg(s)
Undefined function 'arg' for input arguments of type 'double'.
>> s=2+5j
s =
2.0000 + 5.0000i
>> inv(a)
ans =
>> s=2+5j
s =
2.0000 + 5.0000i
>> d=s'
d =
2.0000 - 5.0000i
>> l=mod(s)
Error using mod
Not enough input arguments.
>> abs(s)
ans =
5.3852
>> arc(s)
Undefined function 'arc' for input arguments of type 'double'.
>> argument(s)
Undefined function 'argument' for input arguments of type 'double'.
>> arg(s)
Undefined function 'arg' for input arguments of type 'double'.
>> ang(s)
Undefined function 'ang' for input arguments of type 'double'.
ans =
1.1903
>> angl(s)
Undefined function 'angl' for input arguments of type 'double'.
ans =
1.1903
>>