op plots 3 20 points The table below shows the different for
Solution
wavelength_input = input(\'Please enter the wavelength: \', \'s\'); %taking wavelength as input
 inputs = strsplit(wavelength_input, \' \'); %splitting the input into units and the numerical magnitude
 mag = double(inputs{1}); %first element of the cell taken as the numberical value
 unit = inputs{2}; %second element of the cell taken as the unit
%if statements to check the unit of the wavelength input and multiplying by
 %the appropriate magnitude and store the magnitude to a wavelength variable
 if strcmp(unit, \'pm\')
     wavelength = mag * 10^-12;
elseif strcmp(unit, \'nm\')
     wavelength = mag * 10^-9;
   
 elseif strcmp(unit,\'mm\')
     wavelength = mag * 10^-3;
elseif strcmp(unit,\'km\')
     wavelength = mag * 10^3;
end
%if loop to check the range in which the wavelength lies and outputting the
 %light form correspondingly
 if wavelength<=10^-11
     light_form = \'Gamma Rays\';
elseif (wavelength<=10^-8 & wavelength>10^-11)
     light_form = \'X-rays\';
elseif (wavelength<4*10^-7 & wavelength>10^-8)
     light_form = \'Ultraviolet Radiation\';
elseif (wavelength<=7*10^-7 & wavelength>=4*10^-7)
     light_form = \'Visible Light\';
elseif wavelength<=10^-3 & wavelength>7*10^-7
     light_form = \'Infrared Radiation\';
elseif wavelength<=10^-1 & wavelength>10^-3
     light_form = \'Microwaves\';
else
     light_form = \'Radio Waves\';
end
%displaying wavelength and lightform using disp
 disp(strcat(\'Wavelength: \', num2str(wavelength)));
 disp(strcat(\'Light Form: \',light_form));

