Facebook
From Violet Peafowl, 1 Year ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 261
  1. Zad 1.
  2. clear;
  3. set(gcf,'NumberTitle','Off','MenuBar','None','Name','x^k');
  4. W=2:2:20;            // b) zmieniamy na W=1:2:21
  5. [m,n]=size(W);
  6. x=-5:0.01:5;
  7. for k = 1:n
  8. y=x.^(W(k));
  9. plot(x,y);
  10. axis equal
  11. M(k)=getframe;
  12. end
  13. movie(M,10,10)
  14.  
  15. c)
  16. clear;
  17. set(gcf,'NumberTitle','Off','MenuBar','None','Name','x^k');
  18. W=0:0.5:1
  19. [m,n]=size(W);
  20. x=-2*pi:0.01:2*pi;
  21. for k = 1:n
  22. y=sin(x+W(k)*2*pi);
  23. plot(x,y);
  24. axis equal
  25. M(k)=getframe;
  26. end
  27.  
  28. movie(M,10,10)
  29.  
  30. Zad2.
  31. a=50;
  32. [X,Y] = meshgrid(-a:.5:a);
  33. R = sqrt(X.^2 + Y.^2) + eps;
  34. figure('Resize','off');
  35. W=[1:-0.01:0 0.01:0.01:1];
  36. [m,n]=size(W);
  37. for k = 1:n
  38.  Z = sin(R*W(k))./(R*W(k));
  39.  surf(X,Y,Z)
  40.  axis([-a a -a a -0.2 1]);
  41.  M(k) = getframe;
  42. end
  43. movie(M,10,30)
  44.  
  45. zad3.
  46. a=20;
  47. [X,Y] = meshgrid(-a:0.01:a);
  48. R = figure('Resize','off','units','normalized','outerposition',[0 0 1 1])
  49. W=[1:-0.01:0 0.01:0.01:1];
  50. [m,n]=size(W);
  51. for k = 1:n
  52.  Z = cos(W(k)*x)+(W(k)*y);
  53.  mesh(X,Y,Z)
  54.  axis([-a a -a a -0.2 1]);
  55.  M(k) = getframe;
  56. end
  57. movie(M,10,30)
  58.