Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %% prob1
- x = [0:.01:100]; %#ok<*NBRAK>
- y = [x.^2];
- y2 = [-x.^2+24*x];
- figure(1)
- plot(x,y)
- hold on
- plot(x,y2)
- xlabel('x')
- ylabel('y')
- title('x in relation to y')
- legend('y1','y2')
- grid on
- axis ([1 10 1 400])
- clear
- %% prob2
- x = rand (1,1000000);
- y = randn(1,1000000);
- figure(2)
- subplot(1,2,1)
- hist(x,20) %#ok<*HIST>
- subplot(1,2,2)
- hist(y,20)
- clear
- %% prob3
- R = 670;
- C = 1*10^(-6)';
- w = (1:.25:100000);
- G = ((sqrt(1+(w.^2).*(R^2)*(C^2))).^(-1));
- figure(3)
- semilogx(w,G)
- xlabel('frequency')
- ylabel('Gain')
- grid on
- clear
- %% prob4
- L = 15+.15*randn(10000,1);
- figure(4)
- subplot(1,3,1)
- hist(L,10)
- subplot(1,3,2)
- hist(L,40)
- subplot(1,3,3)
- hist(L,100)
- clear
- %% prob5
- x = 1:.001:100;
- y1 = x.^1;
- y2 = x.^2;
- y3 = x.^3;
- y4 = x.^4;
- y5 = x.^5;
- y6 = x.^6;
- figure(5)
- subplot(3,2,1)
- loglog(x,y1)
- grid on
- subplot(3,2,2)
- loglog(x,y2)
- grid on
- subplot(3,2,3)
- loglog(x,y3)
- grid on
- subplot(3,2,4)
- loglog(x,y4)
- grid on
- subplot(3,2,5)
- loglog(x,y5)
- grid on
- subplot(3,2,6)
- loglog(x,y6)
- grid on
- clear
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement