Академический Документы
Профессиональный Документы
Культура Документы
s=
5 3 1 -1 -3 -5
>> s(2 : 5)
ans =
3 1 -1 -3
>> s(1 : 2 : 5)
ans =
5 1 -3
>> s (6 : -2 : 2)
ans =
-5 -1 3
a=
5 3 1 -1 -3 -5
>> a=s(2 : 5)
a=
3 1 -1 -3
>> b=s(1 : 2 : 5)
b=
5 1 -3
>> c=s (6 : -2 : 2)
c=
-5 -1 3
>> d=[a b]
d=
3 1 -1 -3 5 1 -3
>> e=[b c]
e=
5 1 -3 -5 -1 3
>> d=[a;b]
>> e=[b;c]
e=
5 1 -3
-5 -1 3
>> x=(-3 -2 -1 0 1 2 3 4 5)
??? x=(-3 -2 -1 0 1 2 3 4 5)
>> x=(-3 : 1 : 5)
x=
-3 -2 -1 0 1 2 3 4 5
>> x=(-3 : 5)
x=
-3 -2 -1 0 1 2 3 4 5
>> y=x^3+2*x^2-3*x-4
>> y=x.^3+2*x.^2-3*x-4
y=
-4 2 0 -4 -4 6 32 80 156
>> k=2
k=
m=
2 -6 4 8 -12 1
>> m*k
ans =
4 -12 8 16 -24 2
>> m.^k
ans =
4 36 16 64 144 1
>> m/k
ans =
ans =
2.0000 3.5000 5.0000 6.5000 8.0000
>> linspace(4,-4,5)
ans =
4 2 0 -2 -4
Error: The expression to the left of the equals sign is not a valid target for an assignment.
>> a=[linspace(-4,0,5);linspace(4,-4,5);linspace(2,8,5)]
a=
b=
-1 0 -1 2 -2
2 4 6 8 10
2 1 0 -1 -2
>> a + b
ans =
-5.0000 -3.0000 -3.0000 1.0000 -2.0000
>> 2.*A-B
>> 2.*a-b
ans =
-7 -6 -3 -4 2
6 0 -6 -12 -18
2 6 10 14 18
>> a.*b
ans =
ans =
-1 2 2
0 4 1
-1 6 0
2 8 -1
-2 10 -2
>> 2*b'
ans =
-2 4 4
0 8 2
-2 12 0
4 16 -2
-4 20 -4
>>
>>