File Exchange

image thumbnail

Fit blackbody equation to spectrum

version (2.6 KB) by Tom O'Haver
Fits the blackbody equation to an experimental spectrum to determine temperature


Updated 30 May 2008

View License

Simple example of the use of the FMINSEARCH function to fit the blackbody equation to the emission spectrum of an incandescent body for the purpose of estimating its color temperature and emissivity. fitblackbody.m is the fitting function. BlackbodyDataFit.m is a script that fits a small set of experimental data. Demofitblackbody.m is a script that fits a computer-generated blackbody spectrum with simulated photon noise and temperature noise (random variation in the temperature from point to point in the spectrum).

Cite As

Tom O'Haver (2021). Fit blackbody equation to spectrum (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (1)

Matthew Julian


Thank you for sharing these files, I just have a question regarding the equation for spectral radiance. You consolidate all of the physical constants into a number, but it seems that number has the wrong sign in the exponential. For example, by my calculations, I get 2*h*c^2 = 1.19E-16, but the code has it as E+16. Why is this?

MATLAB Release Compatibility
Created with R13
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!