Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- % full rectified sine wave
- clear
- clc
- k_max = input('Enter>>');
- num_kmax = length(k_max);
- for z = 1:num_kmax
- k = [-k_max(z):k_max(z)];
- L_k = length(k);
- a_k = zeros(1, L_k); % Form vector of Fourierseries coefficients,
- for i=1:2:L_k % as a zero array and then
- a_k(i)=2/(pi*(1-k(i)^2)); % fill in nonzero values
- end
- omega_0 = 2*pi;
- t = 0:.005:3;
- x = a_k*exp(j*omega_0*k'*t);
- subplot(num_kmax,1,z),plot(t,real(x)), ylabel('partialsum'),...
- axis([0 3 -0.5 1.2]), text(.05,-.25,['max. har. =',num2str(k_max(z))]),...
- text(2.0,-.25,['Name / Matric No']),
- end
- xlabel('t');
Add Comment
Please, Sign In to add comment