hw23_derek_rampal

hw23_derek_rampal - Derek Rampal HW 23 Code Derek Rampal...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Derek Rampal HW 23 Code: % % Derek Rampal % HW23 % % clear; % Problem 1 % N = 15 data1 = [0 6 12 18 24 30 36 42 48 54 60 66 72 78 84 124 134 148 156 147 133 121 109 99 85 78 89 104 116 124]; [m1,n1] = size(data1); % trap sum = 0; for i = 1:n1-1 sum = sum + 6*(data1(2,i)+data1(2,i+1))/2; end ; length_trap = sum average_velocity_trap = sum/84 %spline S = cubic_spline_get_coeffs(data1(1,:),data1(2,:)); Sint = splineint(S); [m2,n2] = size(Sint); sum1=0; for i = 1:m2 sum1 = sum1 + Sint(i,:)*[6^4; 6^3; 6^2; 6]; end ; length_spline = sum1 average_velocity_spline = sum1/84 %trig poly data1 = [0 6 12 18 24 30 36 42 48 54 60 66 72 78 84 124 134 148 156 147 133 121 109 99 85 78 89 104 116 124]; z1 = fft(data1(2,:),14); ff_eval = @(x) real(fft_evaluate(z1,x)); (data1(2,:)); %To compare estimated to determine if function is executing interpolated = (ff_eval(0:pi/7:2*pi)) %function is executing length_fourier = 42/pi*quad(ff_eval,0,2*pi) avg_velocity_fourier = 1/(84) * length_fourier % Problem 2 data =...
View Full Document

{[ snackBarMessage ]}

Page1 / 4

hw23_derek_rampal - Derek Rampal HW 23 Code Derek Rampal...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online