% Script File: square
% Plots the trigonometric interpolant of a square wave.
clear
M=300
A = linspace(0,360,2*M+1)';
D(2:M)=0;D(M+2:2*M)=1;D(1)=.5;D(M+1)=.5;D(2*M+1)=.5;
D=D';
Avals = linspace(0,360,1000)';
F     = CSInterp(D(1:2*M));
Fvals = CSeval(F,360,Avals);
%plot(Avals,Fvals,A,D,'o')
plot(Avals,Fvals)
a = 170;b=235;
axis([a b .985 1.035])
set(gca,'xTick',linspace(a,b,M/4))

