Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- x = 4
- A = randi([5, 105], x, x)
- p1 = 0
- p2 = 0
- p3 = 0
- for i = 1:x
- for j = 1:x
- if A(i, j) < 25
- p1 = p1+1
- a(1, p1) = A(i, j)
- a(2, p1) = i
- a(3, p1) = j
- elseif A(i, j) > 75
- p2 = p2+1
- b(1, p2) = A(i, j)
- b(2, p2) = i
- b(3, p2) = j
- else
- p3 = p3+1
- c(1, p3) = A(i, j)
- c(2, p3) = i
- c(3, p3) = j
- end
- end
- end
- figure(1)
- plot(a(1,:),'r*')
- hold on
- plot(b(1,:),'g*')
- hold on
- plot(c(1,:),'b*')
- figure(1)
- t = [0:0.1:2*pi]
- a = 0.5*sin(t)
- plot(t, a)
- hold on
- figure(1)
- c = [0:0.1:2*pi]
- d = 1* sin(c)
- plot(c,d, 'r')
- hold on
- figure(1)
- x = [0:0.1:2*pi]
- y = 2*sin(x)
- plot(x,y)
- hold on
- x = linspace(0, 2*pi)
- y = sin(x)
- z = cos(x)
- hold on
- subplot(2, 1, 1)
- plot(x, y, 'r')
- title('sin x')
- legend('y = sin x')
- xlabel('x')
- ylabel('y')
- subplot(2, 1, 2, 'r')
- plot(x, z, 'm')
- title('cos x')
- legend('z = cos x')
- xlabel('x')
- ylabel('y')
- clear all;
- a=10;
- SNR_A=30;
- SNR_B=35;
- SNR_C=40;
- y1 = 10 ^ (SNR_A/10);
- y2 = 10 ^ (SNR_B/10);
- y3 = 10 ^ (SNR_C/10);
- A = (1:1000)*1000;
- B = (2:1000)*1000;
- C = (3:1000)*1000;
- D = A * log(1 +y1);
- E = B * log(1 +y2);
- F = C * log(1 +y3);
- title('Kapacita prenosneho media')
- plot(D);
- hold on;
- plot(E);
- hold on;
- plot(F);
- legend({'30db', '35db','40db'}, 'location', 'northwest');
- xlabel('Sirka pasma B')
- ylabel('Kapacita kanala C')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement