% ***********************************************************************
% bilirubin_extinction.m
% ***********************************************************************
%
% Data description:
% The extinction coefficient of bilirubin in [cm^-1/(mol/L)] (240-700nm),
% with a resolution of 5nm.
%
% Prepared by: Tenn Francis Chen on March 2011
%
% ***********************************************************************
%
% Original data source:
% 
%      H. Du, R. A. Fuh, J. Li, A. Corkan, J. S. Lindsey, "PhotochemCAD: A
%      computer-aided design and research tool in photochemistry," 
%      Photochemistry and Photobiology, 68, 141-142, 1998
%
%      Published by Oregon Medical Laser Center
%      http://omlc.ogi.edu/spectra/PhotochemCAD/html/bilirubin.html
%
% ***********************************************************************
clear all
data0=[17201, 16068, 18569, 16903, 17803, 17777, 17727, 18609, 17730, 17525, 17575, 17601, 17134, 17096, 16660, 16587, 16104, 16569, 15957, 15464, 15799, 15298, 15237, 15224, 14719, 14475, 14582, 14448, 13997, 14146, 13946, 13730, 13750, 13526, 13226, 13349, 13221, 12850, 13251, 12845, 12552, 12249, 12282, 12169, 12227, 11836, 11768, 11571, 11241, 11227, 11161, 11017, 11029, 11063, 10785, 10687, 10564, 10473, 10337, 10342, 10025, 10160, 10052, 9966, 9862, 9941, 9760, 9628, 9777, 9667, 9522, 9219, 9092, 9217, 9308, 9142, 9135, 8952, 8980, 8858, 8930, 8887, 8893, 8813, 8980, 8771, 8836, 8733, 8676, 8716, 8870, 8774, 8682, 8623, 8729, 8524, 8568, 8647, 8809, 8611, 8598, 8608, 8685, 8509, 8495, 8695, 8551, 8476, 8446, 8557, 8541, 8533, 8445, 8467, 8571, 8516, 8577, 8515, 8457, 8511, 8613, 8616, 8678, 8433, 8505, 8569, 8523, 8470, 8540, 8588, 8512, 8534, 8692, 8547, 8544, 8593, 8541, 8432, 8692, 8468, 8557, 8723, 8628, 8649, 8357, 8622, 8453, 8636, 8629, 8470, 8518, 8585, 8554, 8624, 8340, 8593, 8558, 8643, 8449, 8524, 8422, 8631, 8457, 8493, 8521, 8380, 8511, 8304, 8408, 8371, 8659, 8394, 8415, 8497, 8562, 8224, 8283, 8579, 8331, 8301, 8217, 8310, 8208, 8299, 8223, 8231, 8468, 8202, 8310, 8255, 8234, 8231, 8207, 8101, 8200, 8266, 8135, 8027, 8060, 8100, 8116, 7871, 7967, 8078, 8065, 8112, 7940, 7908, 7805, 7873, 7944, 7829, 8021, 7864, 7654, 7795, 7737, 7742, 7619, 7716, 7919, 7807, 7706, 7781, 7742, 7641, 7639, 7510, 7606, 7789, 7661, 7411, 7512, 7594, 7624, 7575, 7625, 7566, 7372, 7426, 7465, 7367, 7446, 7329, 7589, 7371, 7211, 7482, 7447, 7279, 7227, 7326, 7069, 7345, 7132, 7222, 7297, 7396, 7222, 7241, 7206, 7083, 7034, 7254, 7150, 6987, 6792, 7010, 6990, 7044, 7083, 6897, 6821, 6735, 6894, 6850, 7080, 6901, 6892, 6823, 6818, 6808, 6905, 6801, 6520, 6557, 6615, 6686, 6699, 6630, 6546, 6665, 6577, 6517, 6604, 6336, 6557, 6527, 6383, 6423, 6344, 6455, 6316, 6258, 6210, 6275, 6174, 6217, 6360, 6158, 6302, 6068, 6198, 6175, 6106, 6031, 5909, 5862, 5948, 5993, 5899, 6008, 5813, 5751, 5994, 5884, 5828, 5814, 5625, 5867, 5619, 5557, 5695, 5677, 5542, 5476, 5635, 5688, 5484, 5323, 5450, 5326, 5430, 5562, 5207, 5192, 5148, 5250, 5309, 5055, 5095, 5310, 5206, 5029, 4894, 5166, 5076, 4927, 5028, 4920, 4864, 4850, 4969, 4963, 4755, 4829, 4922, 4577, 4745, 4800, 4653, 4735, 4793, 4820, 4697, 4699, 4651, 4350, 4607, 4521, 4421, 4572, 4882, 4721, 4336, 4558, 4592, 4805, 4530, 4440, 4468, 4423, 4530, 4266, 4398, 4247, 4381, 4349, 4345, 4388, 4630, 4393, 4328, 4229, 4439, 4369, 4359, 4381, 4537, 4196, 4175, 4354, 4334, 4233, 4169, 4183, 4383, 4470, 4255, 4464, 4354, 4349, 4554, 4297, 4224, 4507, 4500, 4555, 4383, 4370, 4532, 4384, 4627, 4395, 4667, 4686, 4252, 4564, 4803, 4685, 4723, 4637, 4569, 4542, 4736, 4799, 4727, 4912, 4841, 4824, 4960, 5067, 4861, 4949, 5045, 5154, 5209, 5137, 4966, 5136, 5195, 5239, 5324, 5322, 5278, 5179, 5443, 5223, 5466, 5399, 5584, 5682, 5655, 5598, 5845, 5799, 5665, 5800, 5820, 5897, 6017, 5934, 5991, 6069, 6069, 6132, 6220, 6194, 6217, 6383, 6340, 6460, 6447, 6668, 6543, 6719, 6661, 6675, 6707, 6862, 6762, 6969, 6995, 6989, 7076, 7223, 7157, 7292, 7438, 7389, 7441, 7482, 7601, 7715, 7724, 7729, 7784, 8026, 7976, 8117, 8208, 8186, 8368, 8315, 8416, 8396, 8573, 8576, 8711, 8930, 8881, 8949, 8888, 9051, 9114, 9231, 9304, 9385, 9516, 9378, 9611, 9681, 9804, 9805, 10008, 9945, 10161, 10156, 10357, 10414, 10523, 10583, 10716, 10791, 10828, 10927, 11095, 11348, 11245, 11376, 11483, 11546, 11688, 11776, 12013, 12021, 12153, 12148, 12316, 12372, 12537, 12556, 12909, 12826, 12999, 13028, 13114, 13334, 13520, 13528, 13634, 13773, 13919, 14005, 14120, 14239, 14352, 14606, 14572, 14788, 14937, 14998, 15126, 15211, 15340, 15619, 15695, 15757, 15865, 16075, 16192, 16328, 16611, 16743, 16916, 16890, 17146, 17356, 17299, 17501, 17638, 17940, 18070, 18298, 18353, 18556, 18673, 18939, 19070, 19249, 19378, 19595, 19810, 19832, 20010, 20297, 20528, 20687, 20882, 21017, 21090, 21499, 21581, 21686, 22037, 22090, 22199, 22447, 22730, 22901, 23059, 23214, 23322, 23519, 23706, 23928, 24050, 24143, 24473, 24607, 24812, 24957, 25175, 25424, 25594, 25568, 25920, 26115, 26383, 26457, 26624, 26726, 27045, 27218, 27439, 27845, 27854, 28165, 28128, 28455, 28628, 28734, 29131, 29156, 29514, 29624, 29845, 30037, 30289, 30556, 30632, 30818, 30911, 31191, 31535, 31685, 31874, 32203, 32398, 32597, 32521, 32931, 32832, 33186, 33419, 33466, 33763, 34080, 34176, 34517, 34820, 34889, 35070, 35399, 35549, 35691, 35763, 36097, 36416, 36580, 36878, 37123, 37271, 37543, 37571, 37941, 38196, 38459, 38624, 38886, 39028, 39276, 39629, 39658, 39869, 40219, 40282, 40881, 40959, 41128, 41191, 41421, 41641, 42006, 41919, 42236, 42491, 42552, 42812, 42986, 43202, 43473, 43757, 43939, 44048, 44087, 44347, 44637, 44799, 44901, 45156, 45270, 45186, 45634, 45644, 46012, 45861, 46264, 46256, 46301, 46855, 46781, 47014, 47163, 47139, 47477, 47718, 47603, 47924, 48048, 48024, 48460, 48532, 48434, 48774, 48961, 48803, 49340, 49314, 49541, 49343, 49775, 49809, 50174, 50037, 50059, 50450, 50221, 50191, 50978, 50684, 50697, 51044, 51251, 51292, 51563, 51450, 51631, 51824, 51755, 51902, 52087, 52186, 52258, 52271, 52334, 52435, 52534, 52891, 52978, 52650, 52869, 52781, 53111, 52971, 53290, 53476, 53547, 53354, 53704, 53567, 53443, 53308, 53527, 53832, 53922, 54077, 53780, 54020, 53705, 54182, 54297, 54300, 54313, 54341, 54175, 54422, 54570, 54646, 54547, 54791, 54865, 54993, 54607, 55000, 54881, 54980, 54686, 54669, 54890, 54859, 54757, 54793, 54962, 54686, 54917, 54941, 54921, 54874, 54857, 54837, 54815, 54946, 54890, 54769, 54828, 54787, 54630, 54667, 54674, 54476, 54388, 54356, 54433, 54453, 54484, 54295, 54156, 54345, 53959, 53753, 53846, 53840, 53743, 53665, 53590, 53399, 53140, 53197, 53051, 52783, 52621, 52633, 52275, 52324, 52103, 52102, 51871, 51691, 51579, 51175, 51160, 50749, 50654, 50447, 50192, 50125, 49910, 49526, 49338, 49013, 48842, 48668, 48310, 47991, 47827, 47509, 47193, 47144, 46759, 46486, 46168, 45729, 45306, 45040, 44690, 44294, 44085, 43963, 43419, 43033, 42703, 42352, 41971, 41716, 41225, 40771, 40478, 39926, 39677, 39243, 38749, 38201, 37878, 37452, 36965, 36495, 35988, 35519, 35141, 34631, 34078, 33742, 33324, 32842, 32473, 31958, 31365, 30959, 30608, 30113, 29624, 29207, 28797, 28414, 27938, 27585, 27051, 26721, 26260, 25861, 25381, 24919, 24534, 24170, 23785, 23343, 22824, 22523, 22114, 21584, 21324, 20944, 20402, 20077, 19763, 19378, 18932, 18556, 18204, 17820, 17426, 17145, 16787, 16448, 16029, 15685, 15361, 14989, 14672, 14357, 14019, 13745, 13410, 13098, 12792, 12452, 12186, 11959, 11830, 11544, 11294, 11009, 10714, 10485, 10195, 9940, 9630, 9395, 9095, 8910, 8608, 8322, 8192, 7884, 7704, 7517, 7318, 7031, 6819, 6599, 6483, 6168, 6088, 5887, 5719, 5506, 5399, 5180, 5066, 4891, 4766, 4532, 4460, 4284, 4202, 4052, 3874, 3752, 3653, 3486, 3412, 3332, 3150, 3150, 3036, 2898, 2793, 2746, 2654, 2529, 2502, 2359, 2326, 2210, 2143, 2030, 2032, 2004, 1863, 1858, 1718, 1776, 1702, 1586, 1610, 1560, 1465, 1385, 1383, 1374, 1299, 1314, 1200, 1148, 1116, 1032, 1108, 995, 966, 941, 920, 908, 847, 848, 846, 737, 782, 724, 716, 704, 624, 616, 574, 602, 582, 547, 507, 525, 486, 489, 487, 432, 397, 411, 418, 365, 401, 362, 376, 346, 340, 327, 357, 292, 306, 270, 273, 252, 212, 253, 285, 233, 251, 248, 236, 236, 214, 189, 213, 202, 215, 170, 136, 183, 222, 148, 165, 134, 191, 177, 141, 157, 208, 180, 118, 117, 153, 122, 154, 179, 129, 103, 164, 118, 130, 83, 84, 99, 126, 153, 71, 109, 101, 72, 72, 114, 69, 72, 90, 177, 107, 107, 81, 92, 122, 38, 15, 54, 120, 104, 60, 41, 82, 127, 102, 80, 67, 65, 33, 84, 67, 65, 93, 84, 59, 73, 14, 78, 9, 71, 40, 118, 57, 100, 90, 65, 61, 86, 69, 76, 47, 85, 71, 62, 31, 69, 85, 69, 46, 94, 125, 33, 104, 70, 59, 33, 22, 2, 55, 42, 62, 76, 71, 81, 34, 64, 68, 57, 27, 62, 69, 45, 72, 90, 55, 105, 20, 47, 21, 11, 57, 77, 20, 57, 61, 106, 15, 8, 0, 69, 18, 48, 6, 42, 28, 39, 13, 20, 42, 9, 53, 67, 39, 72, 41, 52, 73, 39, 0, 72, 64, 52, 109, 12, 50, 0, 10, 36, 60, 78, 15, 28, 52, 99, 10, 0, 40, 0, 17, 64, 82, 19, 29, 38, 7, 65, 36, 19, 18, 0, 46, 0, 20, 12, 9, 0, 0, 3, 47, 40, 17, 34, 11, 33, 19, 30, 68, 52, 9, 21, 34, 24, 8, 0, 24, 32, 54, 19, 14, 12, 59, 32, 79, 0, 40, 0, 14, 22, 77, 26, 2, 0, 0, 0, 25, 0, 29, 0, 17, 0, 0, 52, 27, 0, 17, 0, 0, 19, 22, 21, 0, 0, 49, 0, 5, 61, 30, 16, 55, 0, 16, 0, 0, 16, 47, 30, 0, 44, 0, 12, 57, 51, 44, 22, 46, 0, 60, 27, 78, 39, 74, 56, 0, 0, 26, 55, 18, 111, 18, 0, 11, 0, 0, 57, 6, 0, 52, 38, 30, 24, 85, 28, 37, 3, 0, 67, 0, 8, 56, 71, 59, 40, 0, 6, 17, 9, 74, 91, 42, 3, 65, 0, 23, 56, 0, 6, 0, 0, 72, 25, 53, 8, 29, 37, 30, 0, 60, 12, 37, 8, 0, 0, 25, 69, 78, 65, 19, 7, 38, 82, 54, 2, 30, 2, 0, 22, 48, 0, 32, 3, 39, 12, 12, 0, 50, 6, 0, 80, 19, 20, 86, 0, 29, 36, 85, 31, 15, 4, 85, 0, 46, 25, 0, 0, 0, 0, 0, 70, 30, 25, 0, 89, 0, 3, 62, 28, 29, 47, 55, 0, 49, 5, 51, 0, 70, 0, 65, 0, 78, 0, 28, 0, 78, 58, 16, 41, 0, 0, 77, 0, 36, 2, 16, 0, 13, 14, 47, 0, 0, 34, 28, 43, 0, 0, 29, 51, 60, 45, 0, 51, 27, 71, 54, 61, 29, 91, 0, 12, 16, 14, 33, 75, 78, 0, 13, 48, 0, 0, 0, 0, 29, 33, 0, 0, 6, 61, 36, 11, 27, 56, 5, 43, 16, 0, 0, 76, 32, 0, 0, 40, 20, 39, 0, 0, 0, 18, 0, 33, 54, 0, 0, 12, 91, 0, 0, 0, 0, 0, 94, 36, 0, 87, 35, 34, 0, 26, 0, 0, 0, 79, 86, 0, 0, 77, 0, 36, 3, 0, 8, 19, 0, 0, 6, 24, 80, 7, 0, 0, 0, 61, 79, 0, 52, 0, 53, 94, 55, 0, 14, 99, 0, 42, 0, 53, 59, 74, 0, 54, 60, 0, 30, 25, 0, 8, 25, 68, 6, 47, 25, 0, 27, 106, 0, 62, 38, 81, 38, 104, 18, 111, 0, 74, 52, 36, 0, 50, 44, 43, 55, 66, 48, 0, 48, 87, 68, 2, 31, 0, 16, 27, 87, 181, 87, 44, 107, 44, 89, 28, 14, 73, 7, 77, 44, 80, 14, 12, 33, 11, 5, 0, 0, 12, 0, 0, 48, 34, 0, 58, 159, 46, 64, 17, 30, 0, 21, 0, 0, 6, 86, 37, 0, 0, 53, 6, 22, 41, 60, 39, 52, 8, 46, 43, 11, 12, 0, 8, 15, 0, 33, 33, 0, 33, 11, 25, 50, 0, 0, 0, 0, 0, 8, 0, 45, 0, 17, 12, 33, 0, 54, 35, 35, 51, 19, 0, 0, 71, 0, 8, 22, 9, 41, 0, 0, 12, 21, 0, 49, 13, 24, 0, 0, 0, 3, 17, 0, 71, 32, 0, 0, 53, 12, 45, 50, 0, 5, 0, 8, 35, 0, 0, 103];

wave0 = [239.75, 240, 240.25, 240.5, 240.75, 241, 241.25, 241.5, 241.75, 242, 242.25, 242.5, 242.75, 243, 243.25, 243.5, 243.75, 244, 244.25, 244.5, 244.75, 245, 245.25, 245.5, 245.75, 246, 246.25, 246.5, 246.75, 247, 247.25, 247.5, 247.75, 248, 248.25, 248.5, 248.75, 249, 249.25, 249.5, 249.75, 250, 250.25, 250.5, 250.75, 251, 251.25, 251.5, 251.75, 252, 252.25, 252.5, 252.75, 253, 253.25, 253.5, 253.75, 254, 254.25, 254.5, 254.75, 255, 255.25, 255.5, 255.75, 256, 256.25, 256.5, 256.75, 257, 257.25, 257.5, 257.75, 258, 258.25, 258.5, 258.75, 259, 259.25, 259.5, 259.75, 260, 260.25, 260.5, 260.75, 261, 261.25, 261.5, 261.75, 262, 262.25, 262.5, 262.75, 263, 263.25, 263.5, 263.75, 264, 264.25, 264.5, 264.75, 265, 265.25, 265.5, 265.75, 266, 266.25, 266.5, 266.75, 267, 267.25, 267.5, 267.75, 268, 268.25, 268.5, 268.75, 269, 269.25, 269.5, 269.75, 270, 270.25, 270.5, 270.75, 271, 271.25, 271.5, 271.75, 272, 272.25, 272.5, 272.75, 273, 273.25, 273.5, 273.75, 274, 274.25, 274.5, 274.75, 275, 275.25, 275.5, 275.75, 276, 276.25, 276.5, 276.75, 277, 277.25, 277.5, 277.75, 278, 278.25, 278.5, 278.75, 279, 279.25, 279.5, 279.75, 280, 280.25, 280.5, 280.75, 281, 281.25, 281.5, 281.75, 282, 282.25, 282.5, 282.75, 283, 283.25, 283.5, 283.75, 284, 284.25, 284.5, 284.75, 285, 285.25, 285.5, 285.75, 286, 286.25, 286.5, 286.75, 287, 287.25, 287.5, 287.75, 288, 288.25, 288.5, 288.75, 289, 289.25, 289.5, 289.75, 290, 290.25, 290.5, 290.75, 291, 291.25, 291.5, 291.75, 292, 292.25, 292.5, 292.75, 293, 293.25, 293.5, 293.75, 294, 294.25, 294.5, 294.75, 295, 295.25, 295.5, 295.75, 296, 296.25, 296.5, 296.75, 297, 297.25, 297.5, 297.75, 298, 298.25, 298.5, 298.75, 299, 299.25, 299.5, 299.75, 300, 300.25, 300.5, 300.75, 301, 301.25, 301.5, 301.75, 302, 302.25, 302.5, 302.75, 303, 303.25, 303.5, 303.75, 304, 304.25, 304.5, 304.75, 305, 305.25, 305.5, 305.75, 306, 306.25, 306.5, 306.75, 307, 307.25, 307.5, 307.75, 308, 308.25, 308.5, 308.75, 309, 309.25, 309.5, 309.75, 310, 310.25, 310.5, 310.75, 311, 311.25, 311.5, 311.75, 312, 312.25, 312.5, 312.75, 313, 313.25, 313.5, 313.75, 314, 314.25, 314.5, 314.75, 315, 315.25, 315.5, 315.75, 316, 316.25, 316.5, 316.75, 317, 317.25, 317.5, 317.75, 318, 318.25, 318.5, 318.75, 319, 319.25, 319.5, 319.75, 320, 320.25, 320.5, 320.75, 321, 321.25, 321.5, 321.75, 322, 322.25, 322.5, 322.75, 323, 323.25, 323.5, 323.75, 324, 324.25, 324.5, 324.75, 325, 325.25, 325.5, 325.75, 326, 326.25, 326.5, 326.75, 327, 327.25, 327.5, 327.75, 328, 328.25, 328.5, 328.75, 329, 329.25, 329.5, 329.75, 330, 330.25, 330.5, 330.75, 331, 331.25, 331.5, 331.75, 332, 332.25, 332.5, 332.75, 333, 333.25, 333.5, 333.75, 334, 334.25, 334.5, 334.75, 335, 335.25, 335.5, 335.75, 336, 336.25, 336.5, 336.75, 337, 337.25, 337.5, 337.75, 338, 338.25, 338.5, 338.75, 339, 339.25, 339.5, 339.75, 340, 340.25, 340.5, 340.75, 341, 341.25, 341.5, 341.75, 342, 342.25, 342.5, 342.75, 343, 343.25, 343.5, 343.75, 344, 344.25, 344.5, 344.75, 345, 345.25, 345.5, 345.75, 346, 346.25, 346.5, 346.75, 347, 347.25, 347.5, 347.75, 348, 348.25, 348.5, 348.75, 349, 349.25, 349.5, 349.75, 350, 350.25, 350.5, 350.75, 351, 351.25, 351.5, 351.75, 352, 352.25, 352.5, 352.75, 353, 353.25, 353.5, 353.75, 354, 354.25, 354.5, 354.75, 355, 355.25, 355.5, 355.75, 356, 356.25, 356.5, 356.75, 357, 357.25, 357.5, 357.75, 358, 358.25, 358.5, 358.75, 359, 359.25, 359.5, 359.75, 360, 360.25, 360.5, 360.75, 361, 361.25, 361.5, 361.75, 362, 362.25, 362.5, 362.75, 363, 363.25, 363.5, 363.75, 364, 364.25, 364.5, 364.75, 365, 365.25, 365.5, 365.75, 366, 366.25, 366.5, 366.75, 367, 367.25, 367.5, 367.75, 368, 368.25, 368.5, 368.75, 369, 369.25, 369.5, 369.75, 370, 370.25, 370.5, 370.75, 371, 371.25, 371.5, 371.75, 372, 372.25, 372.5, 372.75, 373, 373.25, 373.5, 373.75, 374, 374.25, 374.5, 374.75, 375, 375.25, 375.5, 375.75, 376, 376.25, 376.5, 376.75, 377, 377.25, 377.5, 377.75, 378, 378.25, 378.5, 378.75, 379, 379.25, 379.5, 379.75, 380, 380.25, 380.5, 380.75, 381, 381.25, 381.5, 381.75, 382, 382.25, 382.5, 382.75, 383, 383.25, 383.5, 383.75, 384, 384.25, 384.5, 384.75, 385, 385.25, 385.5, 385.75, 386, 386.25, 386.5, 386.75, 387, 387.25, 387.5, 387.75, 388, 388.25, 388.5, 388.75, 389, 389.25, 389.5, 389.75, 390, 390.25, 390.5, 390.75, 391, 391.25, 391.5, 391.75, 392, 392.25, 392.5, 392.75, 393, 393.25, 393.5, 393.75, 394, 394.25, 394.5, 394.75, 395, 395.25, 395.5, 395.75, 396, 396.25, 396.5, 396.75, 397, 397.25, 397.5, 397.75, 398, 398.25, 398.5, 398.75, 399, 399.25, 399.5, 399.75, 400, 400.25, 400.5, 400.75, 401, 401.25, 401.5, 401.75, 402, 402.25, 402.5, 402.75, 403, 403.25, 403.5, 403.75, 404, 404.25, 404.5, 404.75, 405, 405.25, 405.5, 405.75, 406, 406.25, 406.5, 406.75, 407, 407.25, 407.5, 407.75, 408, 408.25, 408.5, 408.75, 409, 409.25, 409.5, 409.75, 410, 410.25, 410.5, 410.75, 411, 411.25, 411.5, 411.75, 412, 412.25, 412.5, 412.75, 413, 413.25, 413.5, 413.75, 414, 414.25, 414.5, 414.75, 415, 415.25, 415.5, 415.75, 416, 416.25, 416.5, 416.75, 417, 417.25, 417.5, 417.75, 418, 418.25, 418.5, 418.75, 419, 419.25, 419.5, 419.75, 420, 420.25, 420.5, 420.75, 421, 421.25, 421.5, 421.75, 422, 422.25, 422.5, 422.75, 423, 423.25, 423.5, 423.75, 424, 424.25, 424.5, 424.75, 425, 425.25, 425.5, 425.75, 426, 426.25, 426.5, 426.75, 427, 427.25, 427.5, 427.75, 428, 428.25, 428.5, 428.75, 429, 429.25, 429.5, 429.75, 430, 430.25, 430.5, 430.75, 431, 431.25, 431.5, 431.75, 432, 432.25, 432.5, 432.75, 433, 433.25, 433.5, 433.75, 434, 434.25, 434.5, 434.75, 435, 435.25, 435.5, 435.75, 436, 436.25, 436.5, 436.75, 437, 437.25, 437.5, 437.75, 438, 438.25, 438.5, 438.75, 439, 439.25, 439.5, 439.75, 440, 440.25, 440.5, 440.75, 441, 441.25, 441.5, 441.75, 442, 442.25, 442.5, 442.75, 443, 443.25, 443.5, 443.75, 444, 444.25, 444.5, 444.75, 445, 445.25, 445.5, 445.75, 446, 446.25, 446.5, 446.75, 447, 447.25, 447.5, 447.75, 448, 448.25, 448.5, 448.75, 449, 449.25, 449.5, 449.75, 450, 450.25, 450.5, 450.75, 451, 451.25, 451.5, 451.75, 452, 452.25, 452.5, 452.75, 453, 453.25, 453.5, 453.75, 454, 454.25, 454.5, 454.75, 455, 455.25, 455.5, 455.75, 456, 456.25, 456.5, 456.75, 457, 457.25, 457.5, 457.75, 458, 458.25, 458.5, 458.75, 459, 459.25, 459.5, 459.75, 460, 460.25, 460.5, 460.75, 461, 461.25, 461.5, 461.75, 462, 462.25, 462.5, 462.75, 463, 463.25, 463.5, 463.75, 464, 464.25, 464.5, 464.75, 465, 465.25, 465.5, 465.75, 466, 466.25, 466.5, 466.75, 467, 467.25, 467.5, 467.75, 468, 468.25, 468.5, 468.75, 469, 469.25, 469.5, 469.75, 470, 470.25, 470.5, 470.75, 471, 471.25, 471.5, 471.75, 472, 472.25, 472.5, 472.75, 473, 473.25, 473.5, 473.75, 474, 474.25, 474.5, 474.75, 475, 475.25, 475.5, 475.75, 476, 476.25, 476.5, 476.75, 477, 477.25, 477.5, 477.75, 478, 478.25, 478.5, 478.75, 479, 479.25, 479.5, 479.75, 480, 480.25, 480.5, 480.75, 481, 481.25, 481.5, 481.75, 482, 482.25, 482.5, 482.75, 483, 483.25, 483.5, 483.75, 484, 484.25, 484.5, 484.75, 485, 485.25, 485.5, 485.75, 486, 486.25, 486.5, 486.75, 487, 487.25, 487.5, 487.75, 488, 488.25, 488.5, 488.75, 489, 489.25, 489.5, 489.75, 490, 490.25, 490.5, 490.75, 491, 491.25, 491.5, 491.75, 492, 492.25, 492.5, 492.75, 493, 493.25, 493.5, 493.75, 494, 494.25, 494.5, 494.75, 495, 495.25, 495.5, 495.75, 496, 496.25, 496.5, 496.75, 497, 497.25, 497.5, 497.75, 498, 498.25, 498.5, 498.75, 499, 499.25, 499.5, 499.75, 500, 500.25, 500.5, 500.75, 501, 501.25, 501.5, 501.75, 502, 502.25, 502.5, 502.75, 503, 503.25, 503.5, 503.75, 504, 504.25, 504.5, 504.75, 505, 505.25, 505.5, 505.75, 506, 506.25, 506.5, 506.75, 507, 507.25, 507.5, 507.75, 508, 508.25, 508.5, 508.75, 509, 509.25, 509.5, 509.75, 510, 510.25, 510.5, 510.75, 511, 511.25, 511.5, 511.75, 512, 512.25, 512.5, 512.75, 513, 513.25, 513.5, 513.75, 514, 514.25, 514.5, 514.75, 515, 515.25, 515.5, 515.75, 516, 516.25, 516.5, 516.75, 517, 517.25, 517.5, 517.75, 518, 518.25, 518.5, 518.75, 519, 519.25, 519.5, 519.75, 520, 520.25, 520.5, 520.75, 521, 521.25, 521.5, 521.75, 522, 522.25, 522.5, 522.75, 523, 523.25, 523.5, 523.75, 524, 524.25, 524.5, 524.75, 525, 525.25, 525.5, 525.75, 526, 526.25, 526.5, 526.75, 527, 527.25, 527.5, 527.75, 528, 528.25, 528.5, 528.75, 529, 529.25, 529.5, 529.75, 530, 530.25, 530.5, 530.75, 531, 531.25, 531.5, 531.75, 532, 532.25, 532.5, 532.75, 533, 533.25, 533.5, 533.75, 534, 534.25, 534.5, 534.75, 535, 535.25, 535.5, 535.75, 536, 536.25, 536.5, 536.75, 537, 537.25, 537.5, 537.75, 538, 538.25, 538.5, 538.75, 539, 539.25, 539.5, 539.75, 540, 540.25, 540.5, 540.75, 541, 541.25, 541.5, 541.75, 542, 542.25, 542.5, 542.75, 543, 543.25, 543.5, 543.75, 544, 544.25, 544.5, 544.75, 545, 545.25, 545.5, 545.75, 546, 546.25, 546.5, 546.75, 547, 547.25, 547.5, 547.75, 548, 548.25, 548.5, 548.75, 549, 549.25, 549.5, 549.75, 550, 550.25, 550.5, 550.75, 551, 551.25, 551.5, 551.75, 552, 552.25, 552.5, 552.75, 553, 553.25, 553.5, 553.75, 554, 554.25, 554.5, 554.75, 555, 555.25, 555.5, 555.75, 556, 556.25, 556.5, 556.75, 557, 557.25, 557.5, 557.75, 558, 558.25, 558.5, 558.75, 559, 559.25, 559.5, 559.75, 560, 560.25, 560.5, 560.75, 561, 561.25, 561.5, 561.75, 562, 562.25, 562.5, 562.75, 563, 563.25, 563.5, 563.75, 564, 564.25, 564.5, 564.75, 565, 565.25, 565.5, 565.75, 566, 566.25, 566.5, 566.75, 567, 567.25, 567.5, 567.75, 568, 568.25, 568.5, 568.75, 569, 569.25, 569.5, 569.75, 570, 570.25, 570.5, 570.75, 571, 571.25, 571.5, 571.75, 572, 572.25, 572.5, 572.75, 573, 573.25, 573.5, 573.75, 574, 574.25, 574.5, 574.75, 575, 575.25, 575.5, 575.75, 576, 576.25, 576.5, 576.75, 577, 577.25, 577.5, 577.75, 578, 578.25, 578.5, 578.75, 579, 579.25, 579.5, 579.75, 580, 580.25, 580.5, 580.75, 581, 581.25, 581.5, 581.75, 582, 582.25, 582.5, 582.75, 583, 583.25, 583.5, 583.75, 584, 584.25, 584.5, 584.75, 585, 585.25, 585.5, 585.75, 586, 586.25, 586.5, 586.75, 587, 587.25, 587.5, 587.75, 588, 588.25, 588.5, 588.75, 589, 589.25, 589.5, 589.75, 590, 590.25, 590.5, 590.75, 591, 591.25, 591.5, 591.75, 592, 592.25, 592.5, 592.75, 593, 593.25, 593.5, 593.75, 594, 594.25, 594.5, 594.75, 595, 595.25, 595.5, 595.75, 596, 596.25, 596.5, 596.75, 597, 597.25, 597.5, 597.75, 598, 598.25, 598.5, 598.75, 599, 599.25, 599.5, 599.75, 600, 600.25, 600.5, 600.75, 601, 601.25, 601.5, 601.75, 602, 602.25, 602.5, 602.75, 603, 603.25, 603.5, 603.75, 604, 604.25, 604.5, 604.75, 605, 605.25, 605.5, 605.75, 606, 606.25, 606.5, 606.75, 607, 607.25, 607.5, 607.75, 608, 608.25, 608.5, 608.75, 609, 609.25, 609.5, 609.75, 610, 610.25, 610.5, 610.75, 611, 611.25, 611.5, 611.75, 612, 612.25, 612.5, 612.75, 613, 613.25, 613.5, 613.75, 614, 614.25, 614.5, 614.75, 615, 615.25, 615.5, 615.75, 616, 616.25, 616.5, 616.75, 617, 617.25, 617.5, 617.75, 618, 618.25, 618.5, 618.75, 619, 619.25, 619.5, 619.75, 620, 620.25, 620.5, 620.75, 621, 621.25, 621.5, 621.75, 622, 622.25, 622.5, 622.75, 623, 623.25, 623.5, 623.75, 624, 624.25, 624.5, 624.75, 625, 625.25, 625.5, 625.75, 626, 626.25, 626.5, 626.75, 627, 627.25, 627.5, 627.75, 628, 628.25, 628.5, 628.75, 629, 629.25, 629.5, 629.75, 630, 630.25, 630.5, 630.75, 631, 631.25, 631.5, 631.75, 632, 632.25, 632.5, 632.75, 633, 633.25, 633.5, 633.75, 634, 634.25, 634.5, 634.75, 635, 635.25, 635.5, 635.75, 636, 636.25, 636.5, 636.75, 637, 637.25, 637.5, 637.75, 638, 638.25, 638.5, 638.75, 639, 639.25, 639.5, 639.75, 640, 640.25, 640.5, 640.75, 641, 641.25, 641.5, 641.75, 642, 642.25, 642.5, 642.75, 643, 643.25, 643.5, 643.75, 644, 644.25, 644.5, 644.75, 645, 645.25, 645.5, 645.75, 646, 646.25, 646.5, 646.75, 647, 647.25, 647.5, 647.75, 648, 648.25, 648.5, 648.75, 649, 649.25, 649.5, 649.75, 650, 650.25, 650.5, 650.75, 651, 651.25, 651.5, 651.75, 652, 652.25, 652.5, 652.75, 653, 653.25, 653.5, 653.75, 654, 654.25, 654.5, 654.75, 655, 655.25, 655.5, 655.75, 656, 656.25, 656.5, 656.75, 657, 657.25, 657.5, 657.75, 658, 658.25, 658.5, 658.75, 659, 659.25, 659.5, 659.75, 660, 660.25, 660.5, 660.75, 661, 661.25, 661.5, 661.75, 662, 662.25, 662.5, 662.75, 663, 663.25, 663.5, 663.75, 664, 664.25, 664.5, 664.75, 665, 665.25, 665.5, 665.75, 666, 666.25, 666.5, 666.75, 667, 667.25, 667.5, 667.75, 668, 668.25, 668.5, 668.75, 669, 669.25, 669.5, 669.75, 670, 670.25, 670.5, 670.75, 671, 671.25, 671.5, 671.75, 672, 672.25, 672.5, 672.75, 673, 673.25, 673.5, 673.75, 674, 674.25, 674.5, 674.75, 675, 675.25, 675.5, 675.75, 676, 676.25, 676.5, 676.75, 677, 677.25, 677.5, 677.75, 678, 678.25, 678.5, 678.75, 679, 679.25, 679.5, 679.75, 680, 680.25, 680.5, 680.75, 681, 681.25, 681.5, 681.75, 682, 682.25, 682.5, 682.75, 683, 683.25, 683.5, 683.75, 684, 684.25, 684.5, 684.75, 685, 685.25, 685.5, 685.75, 686, 686.25, 686.5, 686.75, 687, 687.25, 687.5, 687.75, 688, 688.25, 688.5, 688.75, 689, 689.25, 689.5, 689.75, 690, 690.25, 690.5, 690.75, 691, 691.25, 691.5, 691.75, 692, 692.25, 692.5, 692.75, 693, 693.25, 693.5, 693.75, 694, 694.25, 694.5, 694.75, 695, 695.25, 695.5, 695.75, 696, 696.25, 696.5, 696.75, 697, 697.25, 697.5, 697.75, 698, 698.25, 698.5, 698.75, 699, 699.25, 699.5, 699.75, 700];

wave = ceil(wave0(1)):5:floor(wave0(end));
data = interp1(wave0,data0,wave);

fid=fopen('bilirubin_extinction.txt','wb');
for i=1:length(wave)
    fprintf(fid,'%d  %3.4g \n',wave(i),data(i));
end
fclose(fid);


plot(wave,data,'b-','linewidth',1.5);
set(gca,'FontSize', 14);
grid on
title('bilirubin','fontsize',14)
ylabel('molar extinction coefficient (cm^{-1}/(mol/L))','fontsize',14);
xlabel('wavelength (nm)','fontsize',14);
xlim([min(wave),max(wave)]);
set(gcf,'PaperUnits','inches','PaperPosition',[0 0 6 5]);
pause
print('-dpng', '-r100','bilirubin_extinction.png');
close 
   



