hw1_2 - rb = c * delta_t/2; a = abs(ra-rb); b =...

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;
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: rb = c * delta_t/2; 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 <0.01 error = t; time = j; end end...
View Full Document

This document was uploaded on 10/24/2010.

Ask a homework question - tutors are online