programs

profilesaleh55
LogicGames_Sinx_Corrected.m

%% Title - Sinc(x) Challenge Problem %% Governing Equations % y (x) = sin (x) / x % range = -4pi to + 4pi %% Set range vector lowerlim = -4 * pi ; upperlim = 4 * pi ; x = lowerlim : pi/20 : upperlim ; % Nudge any zero values by the smallest number possible x = x + (x == 0) * 1E-20 ; % Matlab also has a function for that (eps) %x = x + (x == 0) * eps; %% Determine y for each x y = sin(x) ./ x ; % ./ so that we go element-by-element %% Plot Results plot (x,y)