% cell arrays - pole bunek P = {[1 4 3; 0 5 8; 7 2 9], 'Anne Smith'; 3+7i, -pi:pi/4:pi}; P(1,1) P{1,1} P{1}(1,1) P{1,1}(1) P(3,3) = {5}; cellplot(P) E = ones(2,2); c = cell(size(E)) A(1,1) = {'ahoj'} A(1,2) = {1:5} B{1,1} = 'ahoj' B{1,2} = 1:5 B(1,1) B{1,1} B{1}(1,1) B{1,1}(1) B{1,3}=A cellplot(B) B{1,3}{1,1}(1) % pismeno 'a' B{2,1} = 28 B{2,2} = magic(12); B{2,3} = rand(3) cellplot(B) celldisp(B) B{1,3}{2}(4) = -2500; celldisp(B) F=cell(12,32,8,1,4); length(F) iscell(B{1,3}) iscell(B{1,2}) iscell(B) iscell(B(1)) iscell(B{1}) [str, c, v1, Mag12, PB, R3] = deal(B) [str, c, v1, Mag12, PB, R3] = B{:} G(1,1) = {'ahoj'} G(1,2) = {1:5} H{1,1} = 'ahoj' H{1,2} = 1:5 C = cat(1, G, H) D = cat(2, G, H) [G H];[G;H]; c = {'Dana', 'Mala', 24; 'Jan', 'Hora', 27} fields = {'jmeno', 'prijmeni', 'vek'}; s = cell2struct(c, fields, 2); c = struct2cell(s); clc % struktury: S.auto_typ = 'Skoda Fabia'; S.auto_barva = 'fialova'; S S.rok_vyroby = 2000; S.cena = 65000; S S(2) = struct('auto_typ','Mitsubishi Lancer',... 'auto_barva','red', 'rok_vyroby',2009, 'cena',1400000) S(3) = struct('auto_typ','Kia','auto_barva','red', 'rok_vyroby',2009, 'cena',140000) S(3).cena % cena 3. auta S(3).cena = 80000 % Kia uz stoji mene S(3) fieldnames(S) rmfield(S,ans{3}) isstruct(S) s = struct('a',{[1 4 7 2 9 3], 'Anne'}, ... 'b',{'James',pi}, ... 'c',{magic(3),[1:7]'}) clear clc lidi{1}=struct('jmeno','Eva','prijmeni','Nova','rok_naroz',1984); lidi{2}=struct('jmeno','Ivo','prijmeni','Kos','rok_naroz',1984); lidi{3}=struct('jmeno','Dana','prijmeni','Mala','rok_naroz',1990); pb=serad(lidi,'jmeno') pb=serad(lidi,'prijmeni') clear clc % objekty - komplexní číslo (konstruktor komplex, metoda display) a=komplex() b=komplex(2) c=komplex(2,-1) d=komplex([1,3])