% earthquake-NS.m % % Script which inputs, plots and analyzes the 1940 El Centro % earthquake north-south acceleration data. % Date: 11-1-06 % Input the data load elcentro_NS.dat -ascii % Column 1 time ; Column 2 acceleration G's data = elcentro_NS; accel = 386.4*data(:,2); time = data(:,1); dt=time(2)-time(1); % Create the times that go with the acceleration. % Plot the time-accel data plot(time,accel,'r-') grid title('N-S Acceleration History 1940 El Centro EarthQuake') xlabel('time (sec) ') ylabel('accel. (in/s^2)') axis([0 31 -150 150]) % Find the maximum and minimum values of the acceleration data % and print them. [amax,imax] = max(accel); [amin,imin] = min(accel); fprintf('\nThe max accel is %5.3f in/s^2 and occurs at time = %5.3f sec.\n ',amax,time(imax)) fprintf('The min accel is %5.3f in/s^2 and occurs at time = %5.3f sec.\n',amin,time(imin))