%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Computational Physics % FALL 2008 % % Instructor: Kevin H. Knuth % % % HW 1 % Plotting a Sine Wave % % The purpose of this homework set is to introduce you to writing % Matlab functions, and making plots. % % % TURN IN: % m-files titled plotSINE.m % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Problem by: Kevin H. Knuth % Created on: 09 January 2008 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This program should be written in two versions, the second more % sophisticated than the first. % % Version 1 % Write a function plotSINE that plots a sine wave as a function of time % given the amplitude, frequency, and phase. % % Version 2 % The plot's range should vary depending on the frequency of the sine wave. % It should vary in powers of 10 in seconds (eq. 1 sec, 10 sec, 100 sec, % or 0.1 sec, 0.01 sec, etc.). Make sure that the sampling rate is such % that the plot does not suffer from aliasing. % % Turn in Version 2 only. % % Usage: h = plotSINE(A, F, P) % Inputs: A - amplitude in arbitrary units % F - frequency in Hz % P - phase in radians % Outputs: h - handle to figure % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%