hw1_2 - a = abs(ra-rb); b = abs((ra-rb)/rb); %answers ti t2...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
%Song, Hwan %AAE 412 %HW1, #2 % close all clear all clc c Delta_t = single(0.1); delta_t = single(5.376e-4); t1 = single(0.0); c = 2.981e8; n = 1; N = [1,10,10^2,10^3,10^4,10^5,10^6,10^7]; ti= []; t while n<=8 t1=0; for j = 1:N(1,n) t1 = t1 + Delta_t; end ti = [ti, t1]; n=n+1; end e t2 = ti + delta_t; ra = c * (t2 - ti) / 2; rb = c * delta_t/2;
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: a = abs(ra-rb); b = abs((ra-rb)/rb); %answers ti t2 ra rb a b for j = 1:N(1,8) t1 = t1 + Delta_t; t2 = t1 + delta_t; ra = c * (t2 - t1) / 2; rb = c * delta_t/2; t = abs((ra-rb)/rb); if t &lt;0.01 error = t; time = j; %time in seconds when it reaches 1% error end end...
View Full Document

Ask a homework question - tutors are online