s=1; s=2; s=3; V=s^3
s=1; s=2; s=3; V=s.^3
s=[1 2 3]; V=s.^3
s=[1 2 3]; V=s^3
x = 4:15:20
x = 4:20:15
x = linspace(4, 15, 20)
x = linspace(4, 20, 15)
x = linspace(15, 4, 20)
A = 1 3 5 7
A = linspace(1, 7, 4)
A=1, A=3, A=5, A=7
A = 1:7:2
Ingen av alternativene
A=[1 2; 3 4]; B=[8 9]; A*B
A=[1 2; 3 4]; B=[8 9]; B*A
A=[1 2; 3 4]; B=[8 9]; A+B
A=[1 2; 3 4]; B=[8 9]; A'*B
Alle gir feilmelding
A=[1 2; 3 4]; B=[8 9]; A.*B
A=[1 2; 3 4]; B=[8 9]; B.*A
A=[1 2; 3 4]; B=[8 9]; A.+B
A=[1 2; 3 4]; B=[8 9]; A'.*B
Tøys, alle gir feilmelding
Feilmelding
4
8
2 4 6 8
4 6 8 10
pi = 3.1416
'pi = 3,1416'
'pi' = num2str(pi)
['pi = ' num2str(pi)]
['pi = num2str(pi)']
[4 -1 9]
[4 0 0 -1 9]
[4; 0; 0; -1; 9]
[1 0 0 -1 9]
[1; 0; 0; -1; 9]
2 1
3 2 1
16 9 4
24 6
4 3 2 1
4 3 2 0
3 2 1 0
2 1 0 0
P=[-1 0 4]; polyval(polyint(P), -2, 2)
P=[-1 0 4]; polyint(P)from -2 to 2
P=[-1 0 4]; polyint(P=2) - polyint(P=-2)
P=[-1 0 4]; polyval(polyint(P), 2) - polyval(polyint(P), -2)
P=[-1 0 4]; polyval(polyint(P), 2, -2)
hastighet_kmh = 10:10:100;
hastighet_ms = hastighet_kmh*5/18;
hastigheter = [hastighet_kmh', hastighet_ms'];
disp(' km/h m/s'); disp(hastigheter);
kmh_og_ms.m
start kmh_og_ms.m
start kmh_og_ms
kmh_og_ms
execute kmh_og_ms
10 x 2
2 x 10
1 x 20
20 x 1
10 x 1