% ***********************************************************************
% water1.m
% ***********************************************************************
%
% Data description:
% refractive index (real part) of water (400-2500nm), 
% linearly interpolated from original data (resolution of 5nm) 
%
% Prepared by: Gladimir V. G. Baranoski on November 2008
%
% ***********************************************************************
%
% Original data source:
% 
% K.F. Palmer and D. Williams, Optical Properties of water in the near 
% infrared, Journal of the Optical Society of America, V.64, 
% pp. 1107-1110, August, 1974.
%
% ***********************************************************************
%
% graph generate using Matlab 2014
%
% ***********************************************************************

clear all
data=[
1.346 
1.345 
1.344 
1.343 
1.342 
1.341 
1.34 
1.339 
1.338 
1.338 
1.337 
1.336 
1.336 
1.335 
1.335 
1.334 
1.334 
1.334 
1.334 
1.333 
1.333 
1.333 
1.333 
1.333 
1.333 
1.333 
1.333 
1.333 
1.333 
1.333 
1.333 
1.333 
1.333 
1.333 
1.333 
1.333 
1.333 
1.333 
1.333 
1.333 
1.333 
1.333 
1.333 
1.333 
1.333 
1.332 
1.332 
1.332 
1.332 
1.332 
1.332 
1.332 
1.332 
1.332 
1.332 
1.332 
1.332 
1.332 
1.332 
1.332 
1.332 
1.332 
1.332 
1.332 
1.332 
1.332 
1.332 
1.332 
1.332 
1.332 
1.332 
1.332 
1.332 
1.331 
1.331 
1.331 
1.331 
1.331 
1.331 
1.331 
1.331 
1.331 
1.331 
1.331 
1.33 
1.33 
1.33 
1.33 
1.33 
1.33 
1.33 
1.33 
1.33 
1.33 
1.33 
1.33 
1.33 
1.33 
1.329 
1.329 
1.329 
1.329 
1.329 
1.329 
1.329 
1.329 
1.329 
1.329 
1.329 
1.329 
1.328 
1.328 
1.328 
1.328 
1.328 
1.328 
1.328 
1.328 
1.328 
1.328 
1.328 
1.328 
1.328 
1.328 
1.328 
1.328 
1.328 
1.328 
1.328 
1.328 
1.328 
1.328 
1.328 
1.328 
1.328 
1.328 
1.327 
1.327 
1.327 
1.327 
1.327 
1.327 
1.327 
1.327 
1.327 
1.327 
1.327 
1.326 
1.326 
1.326 
1.326 
1.326 
1.326 
1.326 
1.326 
1.326 
1.326 
1.325 
1.325 
1.325 
1.325 
1.325 
1.325 
1.325 
1.325 
1.325 
1.325 
1.325 
1.325 
1.325 
1.325 
1.325 
1.324 
1.324 
1.324 
1.324 
1.324 
1.324 
1.324 
1.324 
1.324 
1.324 
1.324 
1.324 
1.324 
1.323 
1.323 
1.323 
1.323 
1.323 
1.323 
1.323 
1.323 
1.323 
1.323 
1.323 
1.322 
1.322 
1.322 
1.322 
1.322 
1.322 
1.322 
1.322 
1.321 
1.321 
1.321 
1.321 
1.321 
1.321 
1.321 
1.321 
1.321 
1.321 
1.321 
1.321 
1.321 
1.32 
1.32 
1.32 
1.32 
1.32 
1.32 
1.32 
1.32 
1.32 
1.319 
1.319 
1.319 
1.319 
1.319 
1.319 
1.319 
1.319 
1.319 
1.319 
1.318 
1.318 
1.318 
1.318 
1.318 
1.318 
1.318 
1.318 
1.318 
1.318 
1.317 
1.317 
1.317 
1.317 
1.317 
1.316 
1.316 
1.316 
1.316 
1.316 
1.316 
1.315 
1.315 
1.315 
1.315 
1.315 
1.314 
1.314 
1.314 
1.314 
1.314 
1.314 
1.314 
1.314 
1.314 
1.314 
1.314 
1.314 
1.314 
1.314 
1.313 
1.313 
1.313 
1.312 
1.312 
1.312 
1.312 
1.312 
1.312 
1.312 
1.312 
1.312 
1.311 
1.311 
1.311 
1.311 
1.311 
1.311 
1.31 
1.31 
1.31 
1.31 
1.31 
1.31 
1.31 
1.31 
1.31 
1.309 
1.309 
1.309 
1.309 
1.309 
1.308 
1.308 
1.308 
1.307 
1.307 
1.307 
1.307 
1.306 
1.306 
1.306 
1.306 
1.306 
1.306 
1.306 
1.306 
1.306 
1.306 
1.306 
1.305 
1.305 
1.305 
1.305 
1.305 
1.304 
1.304 
1.304 
1.304 
1.303 
1.303 
1.303 
1.303 
1.302 
1.302 
1.302 
1.302 
1.302 
1.301 
1.301 
1.301 
1.301 
1.3 
1.3 
1.3 
1.299 
1.299 
1.298 
1.298 
1.298 
1.297 
1.297 
1.297 
1.296 
1.296 
1.296 
1.295 
1.295 
1.295 
1.294 
1.294 
1.294 
1.294 
1.293 
1.293 
1.293 
1.292 
1.292 
1.291 
1.291 
1.29 
1.29 
1.289 
1.289 
1.288 
1.287 
1.287 
1.286 
1.286 
1.285 
1.285 
1.284 
1.284 
1.283 
1.283 
1.283 
1.282 
1.282 
1.282 
1.281 
1.281 
1.281 
1.28 
1.28 
1.28 
1.279 
1.279 
1.278 
1.278 
1.277 
1.277 
1.276 
1.276 
1.275 
1.275 
1.274 
1.274 
1.273 
1.272 
1.272 
1.271 
1.27 
1.269 
1.269 
1.268 
];

fid=fopen('riW.txt','wb');
for i=1:421
    wave(i)=395+i*5;
    fprintf(fid,'%d  %3.4g \n',wave(i),data(i));
end
fclose(fid);


plot(wave,data,'b-','linewidth',3);
axis([400 2500 1.2 1.4]);
set(gca,'FontSize', 14);
grid on
title('Water','fontsize',14)
ylabel('refractive index','fontsize',14);
xlabel('wavelength (nm)','fontsize',14);
set(gcf,'PaperUnits','inches','PaperPosition',[0 0 6 5]);
pause
print('-dpng', '-r100','water1.png');
close 
   




