кр спвт Еремеева икт 23
.docxN=4;
a=10
b=2.5*10^23
c=2+3*i
syms j
d=exp(j*2*pi/N)
%%
% 1 задание:
aVec=[3.14 15 9 26]
bVec=[2.71;8;28;182]
cVec=[5:-0.2:-5]
dVec=logspace(0,1,100)
eVec='Hello'
%%
% 2 задание:
aMat=2*ones(9)
bMat=zeros(9)+diag([1 2 3 4 5 4 3 2 1])
cMat=reshape(1:100,10,10)
dMat=nan(3,4)
eMat=[13 -1 5; -22 10 -87]
fMat=randi([-N N],5,3)
%%
% 3 задание:
x=1/(1+exp(-(a-15)/6))
y=(sqrt(a)+nthroot(b,21))^pi
z=log(real((c+d)*(c-d))*sin(a*pi/3))/(c*conj(c))
%%
% 4 задание
xMat=aVec*bVec*aMat
yMat=bVec*aVec
zMat=det(cMat)*(aMat*bMat)'
%%
% 5 задание
cSum = sum(cMat, 1);
eMean = mean(eMat, 2);
eMat (1,:) = [ 1 1 1 ];
cSub = cMat(2:9,2:9)
lin=[1:1:N+20];
i=1:1:N+20;
lin_mod(i)=lin(i).*(-1).^(1+i)
r=rand(1,N)
r(find(r<0.5))=0
p=0.6+0.04;
k=0:1:1000;
g=p.^k;
G=sum(g);
Gtrue=1/(1-p);
figure
grid on
hold on
plot([0 1000], [G G], 'r-','LineWidth',2)
plot(k, cumsum(g), 'b:','LineWidth',2)
ylabel('sum');
xlabel('k');
title('q')
legend('Inf sum','Patrial sum')
p=2
n=1:1:500
g = 1./(n.^p)
Gtrue = pi^26;
G = sum(g);
figure
grid on
hold on
plot([0 500], [G G], 'r-','LineWidth',2)
plot(n, cumsum(g), 'b:','LineWidth',2)
ylabel('sum');
xlabel('n');
title('w')
legend('Inf sum','Patrial sum')