function [ responsivity ] = sensor( wavelength ) %UNTITLED3 Summary of this function goes here % Detailed explanation goes here m = length(wavelength); responsivity = zeros([1 length(wavelength)]); for i = 1:m if(wavelength(i) < 240) responsivity(i) = 0.01; else if((wavelength(i) >= 240) && (wavelength(i) < 260)) responsivity(i) = (.03/20)*(wavelength(i) - 240)+0.01; else if((wavelength(i) >= 260) && (wavelength(i) < 280)) responsivity(i) = (.02/20)*(wavelength(i)-260)+0.04; else if((wavelength(i) >= 280) && (wavelength(i) < 300)) responsivity(i) = (.04/20)*(wavelength(i)-280)+0.06; else if((wavelength(i) >=300) && (wavelength(i) < 340)) responsivity(i) = (.04/40)*(wavelength(i)-300)+0.1; else if((wavelength(i) >= 340) && (wavelength(i) < 355)) responsivity(i) = 0.14; else if((wavelength(i) >= 355) && (wavelength(i) < 360)) responsivity(i) = (-.005/5)*(wavelength(i)-355)+0.14; else if((wavelength(i) >= 360) && (wavelength(i) < 370)) responsivity(i) = (-.115/10)*(wavelength(i)-360)+0.135; else if((wavelength(i) >= 370) && (wavelength(i) < 380)) responsivity(i) = (-.02/10)*(wavelength(i)-370)+0.02; else if(wavelength(i) >= 380) responsivity(i) = 0; end end end end end end end end end end end end