Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function zadacha(x)
- % x = L / lambda (например: 5)
- first = true;
- for g = [0:0.1:1,1.05:0.05:1.25]
- if (~first), delete(h1); delete(h2); end
- first = false;
- [h1, h2] = step(x, g);
- pause(0.01);
- end
- end
- function [h1, h2] = step(x, g)
- % x = L / lambda
- t = 0:pi/360:pi;
- n = length(t);
- r1 = r2 = ones(1, n);
- for i=1:n
- v1 = pi*x*(sin(t(i))+g);
- v2 = pi*x*(sin(t(i))-g);
- if (v1 ~= 0), r1(i) = abs(sin(v1)/v1); end
- if (v2 ~= 0), r2(i) = abs(sin(v2)/v2); end
- end
- h1 = polar(t, r1, 'b');
- hold on;
- h2 = polar(t+pi, r2, 'r');
- grid on;
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement