clear % finger in every pie (заниматься всем сразу) % % follow the steps!!! % create matrix (the simplest - using assignment): A=[pi,pi/2 0.5, 0.3 sqrt(4); eps realmin (realmin)/eps 1:2] % space (or) comma B=[pi:pi/12:2*pi] % vector (as arithmetic progression) [B0:stepB:Bend] realmin realmax eps % type control isreal(A) %explain... isfinite(A) % result % the main matrices constructors: a= eye(2,3) % identity matrix % zeros matrix % matrix elements are equal one x=randi([-2,2],4,1) % random integer matrix % uniformly distributed random matrix in the interval (0,1) % editing matrices a=[ones(3);eye(6,3);zeros(3)]; % concatenation spy(a,'r*',10) % visualization nonzero elements by graph a(2:2:end)=0 spy(a) % concatenation using function cat (examples for two directions): % along row % along column % changing the shape of the matrix (explain): arep=repmat(1:4,5,2) ar=reshape (a,4,9) % conditional assignment: a(a>0)=3 a(a==0)=1 % deleting blocks: a(5:end,:)=[] % the last (end-5+1) lines (rows) a(:,2)=[] % the second column is deleted b=a'*x % product of matrices, explain a' % Creating special-type matrices: D=diag(1:5) % explain dd=diag(a) % create random matrix 8-order T % use for T function triu % use for T function tril % element-by-element operations on matrices: d=a.^3 c=a.*rand(size(a)) % eplain and ... % add example for .\ % Workspace information who whos % need to assign new variable with identificator mylogical value ans! save ab a b clear load ab