Dcs Matlab Manual Function
Dcs Matlab Manual Function
r =
10
>> x=5+3i
x =
5.0000 + 3.0000i
>> x=5+i3
Undefined function or variable 'i3'.
>> y= (5+3i)*5
y =
25.0000 +15.0000i
>> 8/2
ans =
>> 8\2
ans =
0.2500
>> pi
ans =
3.1416
ans =
3.141592653589793
ans =
3.1416e+00
ans =
355/113
>> 355/113
ans =
355/113
a =
10 4
8 -12
b =
20
12
>> b/a
Error using /
Matrix dimensions must agree.
>> inv(a).*b
ans =
30/19 10/19
12/19 -15/19
>> inv(a)*b
ans =
36/19
5/19
ans =
1.8947
0.2632
>> real x
ans =
120
>> real
Error using real
Not enough input arguments.
>> real y
ans =
121
>> clear x
>> clear y
>> x=5+3i
x =
5.0000 + 3.0000i
>> real x
ans =
120
>> clear
>> x= 5+3i
x =
5.0000 + 3.0000i
>> real(x)
ans =
>> angle(x)
ans =
0.5404
>> a=real(x)
a =
>> b=imag(x)
b =
>> [x,y]=cart2pol(a,b)
x =
0.5404
y =
5.8310
>> r= input('enter a number')
enter a number3
r =
>> 5
ans =
p =
2 3 4 5
q =
'p'
speed =
speed =
row =
column =
1.0000
2.0000
3.5000
-6.0000
7.0000
>> b=[1:2:9]
b =
1 3 5 7 9
>> b=[1:1:10]
b =
1 2 3 4 5 6 7 8 9 10
>> size(b0
size(b0
↑
Error: Invalid expression. When calling a function or indexing a variable, use
parentheses. Otherwise, check for
mismatched delimiters.
ans =
1 10
>> b(1,3)
ans =
>> b(1,3)=5
b =
1 2 5 4 5 6 7 8 9 10
>> b(1,3)
ans =
>> var(:,2)
ans =
2
4
>> var(1:2,3)
ans =
4
5
>> var(1,2:1,2)
Index in position 3 exceeds array bounds (must not exceed 1).
>> var(1:1)
ans =
>> var(1:2,3)
ans =
4
5
>> var(1:1,2)
ans =
>> sin(pi)