Introducing the Miles Toolbox! (requires MATLAB)
#1
Original Poster
Join Date: Sep 2005
Location: Now in SLC
Programs: DL GM 1MM, MR LT Titanium
Posts: 4,086
Introducing the Miles Toolbox! (requires MATLAB)
Hey all! I've written some utilities for the MATLAB programming language that can make mileage calculations easier. For example, If you're trying to get from BOS-DAY and want to see how many miles you'll get if you connect through CVG, DCA, or LGA:
You can also include the 500 miles per segment rule that most airlines have:
And finally, you can calculate the mileage based on a particular airline's U.S. hubs. If you do this, then "ridiculous" routings are thrown out (e.g. BOS-SLC-DAY):
There's also a function to get mileage on a particular routing:
And there's a function that displays routings as downloaded from FlightAware. For more details, see:
http://www.mathworks.com/matlabcentr...bjectType=file
Click on the "Welcome to the Miles Toolbox" link just below the description to see a more thorough introduction, and please feel free to send me feedback!
--LoganFlyer
Code:
>> cxmiles BOS DAY CVG DCA LGA Calculating LGA..... Route Leg 1 Leg 2 Total R/T BOS-DAY 709 1418 BOS-LGA-DAY 184 549 733 1466 BOS-DCA-DAY 399 391 790 1580 BOS-CVG-DAY 752 64 816 1632
Code:
>> cxmiles BOS DAY CVG DCA LGA 500 Calculating LGA..... Route Leg 1 Leg 2 Total R/T BOS-DAY 709 1418 BOS-DCA-DAY 500 500 1000 2000 BOS-LGA-DAY 500 549 1049 2098 BOS-CVG-DAY 752 500 1252 2504
Code:
>> cxmiles BOS DAY 500 DL Calculating LAX..... Route Leg 1 Leg 2 Total R/T BOS-DAY 709 1418 BOS-JFK-DAY 500 554 1054 2108 BOS-CVG-DAY 752 500 1252 2504 BOS-ATL-DAY 946 500 1446 2892
Code:
>> getmiles BOS ATL SLC SMF BOS-ATL: 946 ATL-SLC: 1590 SLC-SMF: 532 Total: 3068
http://www.mathworks.com/matlabcentr...bjectType=file
Click on the "Welcome to the Miles Toolbox" link just below the description to see a more thorough introduction, and please feel free to send me feedback!
--LoganFlyer
#4
Original Poster
Join Date: Sep 2005
Location: Now in SLC
Programs: DL GM 1MM, MR LT Titanium
Posts: 4,086
Thank you both! I have thought about porting it, but an executable created from MATLAB requires either MATLAB or the MCR (MATLAB Component Runtime) to run. The latter is free, but 236 MB, so I can't easily include it. But I'll see what I can do.