Matrix
Eminem: ZADANIE 1
A=randi(100,10,10)
s=0;
z=0;
[w,k]=size(A);
for i=1:2:w;
for j=2:2:k;
s=s+A(i,j);
end
end
s
for i=1:w;
for j=1:k;
if i==j;
if (mod(A(i,j),5)==0)
z=z+1;
end
end
end
end
←→←→←→←→→→→→→→
ZADANIE 2
V=randi(20,1,10)
s=0;
z=0;
d=length(V)
for i=1
;
if (mod(V(i),2)==0)
s=s+1;
else z=z+1;
end
end
←→←→←→←→←→←→←→
ZADANIE 3
A=zeros(10,10)
B=randi(15,1,10)
[w,k]=size(A);
for i=1:w;
for j=1:k;
if (i==j);
A(i,j)=B(i);
end
end
end
INNE :
function[y]=silnia(x)
s=1;
for i=1:x;
s=s*i;
end
y=s;
end
←→←→←→←→