% KTE/PPEL - Lenka Sroubova % 1. prednaska 25.09.2018 % zaznam z prikazoveho okna MATLABu % --------------------------------- 3+5 ans = 8 eps ans = 2.2204e-16 realmin ans = 2.2251e-308 realmax ans = 1.7977e+308 i ans = 0.0000 + 1.0000i j ans = 0.0000 + 1.0000i i+j ans = 0.0000 + 2.0000i 3-ans ans = 3.0000 - 2.0000i 100/0 ans = Inf 0/10 ans = 0 0/0 ans = NaN pi ans = 3.1416 3+5 ans = 8 3*(5+6/(8+2*(4+5))) ans = 15.6923 a=3*(5+6/(8+2*(4+2))) a = 15.9000 A = [1,2,3;4,5,6] A = 1 2 3 4 5 6 B = [10,20;40,30]; B B = 10 20 40 30 x = [1,2,3,4,5,6,7,8,9,-10,-11,-12] x = Columns 1 through 8 1 2 3 4 5 6 7 8 Columns 9 through 12 9 -10 -11 -12 x = [1,2,3,4,5,6,7,8,9,-10,-11,-12; 0,1,2,3,4,5,6,7,8,9,10,11] x = Columns 1 through 8 1 2 3 4 5 6 7 8 0 1 2 3 4 5 6 7 Columns 9 through 12 9 -10 -11 -12 8 9 10 11 ; x = [1,2,3,4,5,6,7,8,9,-10,-11,-12; 0,1,2,3,4,5,6,7,8,9,10,11] x = Columns 1 through 8 1 2 3 4 5 6 7 8 0 1 2 3 4 5 6 7 Columns 9 through 12 9 -10 -11 -12 8 9 10 11 y = [1,2,3,4,5,6,7,8,9,-10,-11,-12] y = Columns 1 through 8 1 2 3 4 5 6 7 8 Columns 9 through 12 9 -10 -11 -12 x x = Columns 1 through 8 1 2 3 4 5 6 7 8 0 1 2 3 4 5 6 7 Columns 9 through 12 9 -10 -11 -12 8 9 10 11 z = [y;x] z = Columns 1 through 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 0 1 2 3 4 5 6 7 Columns 9 through 12 9 -10 -11 -12 9 -10 -11 -12 8 9 10 11 z z = 1 2 3 4 5 6 7 8 9 -10 -11 -12 1 2 3 4 5 6 7 8 9 -10 -11 -12 0 1 2 3 4 5 6 7 8 9 10 11 f=[1,2,3] f = 1 2 3 G = [5,6,4;7,9,8] G = 5 6 4 7 9 8 H = [f;G] H = 1 2 3 5 6 4 7 9 8 H(2,3) ans = 4 H(3,2) ans = 9 sin(pi/2) ans = 1 x=[0,0.2,0.4,0.6,0.8,1,1.2] x = 0 0.2000 0.4000 0.6000 0.8000 1.0000 1.2000 y=sin(x) y = 0 0.1987 0.3894 0.5646 0.7174 0.8415 0.9320 plot(x,y) 1:7 ans = 1 2 3 4 5 6 7 3:10 ans = 3 4 5 6 7 8 9 10 3:-1:1 ans = 3 2 1 3:-1:-5 ans = 3 2 1 0 -1 -2 -3 -4 -5 3:2:15 ans = 3 5 7 9 11 13 15 3:4:15 ans = 3 7 11 15 3:4:21 ans = 3 7 11 15 19 x=[0:0.1:2*pi]; y=sin(x); plot(x,y) H H = 1 2 3 5 6 4 7 9 8 H(1,:) ans = 1 2 3 H(2,:) ans = 5 6 4 H H = 1 2 3 5 6 4 7 9 8 H(:,2) ans = 2 6 9 H(:,3) ans = 3 4 8 H H = 1 2 3 5 6 4 7 9 8 H(1:2,1:2) ans = 1 2 5 6 H H = 1 2 3 5 6 4 7 9 8 H(1:2,1:3) ans = 1 2 3 5 6 4 r='ahoj' r = 'ahoj' z='a' z = 'a' who Your variables are: A B G H a ans f r x y z whos Name Size Bytes Class Attributes A 2x3 48 double B 2x2 32 double G 2x3 48 double H 3x3 72 double a 1x1 8 double ans 2x3 48 double f 1x3 24 double r 1x4 8 char x 1x63 504 double y 1x63 504 double z 1x1 2 char r r = 'ahoj' r(1,4) ans = 'j' r(4) ans = 'j' r(2:4) ans = 'hoj' r(4:-1:1) ans = 'joha' r(1) ans = 'a' c=4+5i c = 4.0000 + 5.0000i whos Name Size Bytes Class Attributes A 2x3 48 double B 2x2 32 double G 2x3 48 double H 3x3 72 double a 1x1 8 double ans 1x1 2 char c 1x1 16 double complex f 1x3 24 double r 1x4 8 char x 1x63 504 double y 1x63 504 double z 1x1 2 char C=[1+i,2-i;3+6i,7-5i] C = 1.0000 + 1.0000i 2.0000 - 1.0000i 3.0000 + 6.0000i 7.0000 - 5.0000i whos Name Size Bytes Class Attributes A 2x3 48 double B 2x2 32 double C 2x2 64 double complex G 2x3 48 double H 3x3 72 double a 1x1 8 double ans 1x1 2 char c 1x1 16 double complex f 1x3 24 double r 1x4 8 char x 1x63 504 double y 1x63 504 double z 1x1 2 char diary off