————————————————————————————————————————————-
My code so far. I'm trying to make it look like the plot above. I very much appreciate the assistance. Let me know of any mistakes!
%% Problem 1) Blackbody Radiation
% constants
%
c = 2.99e8; % speed of light [m/s]
h = 6.63e-34; % Planck's constant [J s]
k = 1.38e-23; % Boltzmann's constant [J/K]
A = 2.898e-3; % Wein's Law constant [K m]
T = 300; % Earth's Temperature [K]
T1= 1000; % Temperature [K] at 1000K
T2= 6000; % Sun's temperature [K]
lam = logspace(-8,5,100); % wavelength [m]
%% Plank's Law
%
% below are three Planck's function for T,T1,T2.
L=((2*h*c*c)./(lam.^(5))).*(exp(h*c./(lam.*k*T)-1)).^(-1); % Blackbody curve for the Earth
Y=((2*h*c*c)./(lam.^(5))).*(exp(h*c./(lam.*k*T1)-1)).^(-1); % Blackbody curve for T1
W=((2*h*c*c)./(lam.^(5))).*(exp(h*c./(lam.*k*T2)-1)).^(-1); % Blackbody curve for the Sun
figuresemilogy(L,'red') hold onloglog(Y,'blue')hold onloglog(W,'yellow')xlabel("x") % I don't know how to change the increments of the x-axis to reflect the above plot.
ylabel("Spectral Radiance")title("Blackbody Curves Plot")
Best Answer