% simple model of the black body using MATLAB/Octave/Freemat
wavelength = 0.01:0.01:5.0;     % microns sweep over a range of wavelengths
T = 5000;                       % temperature in kelvin
F = 3.742./ ((wavelength.^5).*(exp(1.439e4./(wavelength*T))-1)) ; % gives the result in W/m2/um x 1e8
plot(wavelength,F);
xlabel('wavelength (\mum)');       %  add axis labels and plot title
ylabel('spectral intensity (W/m^2/\mum) x 10^8');
title('Blackbody Radiation');
legend(sprintf('T = %.0f K',T));
