How can I plot loglog graph for a black body spectrum by taking frequency as x axis in matlab

4 views (last 30 days)
h =6.626e-34; c = 3e8; k= 1.38e-23; T=[3000,5000,10000,20000,30000]; nu=linspace(1e9,1e19,100); B=(2*h*nu.^3/c.^2)/(exp(h*nu /(k*T))-1); plot(nu,B); xlim(1e9, 1e19); loglog(nu,B); xlabel ('frequency ,Hz'); ylabel ('Bv,(w/(m^2steradian)')

Answers (1)

Voss
Voss on 28 May 2022
h =6.626e-34;
c = 3e8;
k= 1.38e-23;
T=[3000,5000,10000,20000,30000];
nu=linspace(1e9,1e19,100);
% B=(2*h*nu.^3/c.^2)/(exp(h*nu /(k*T))-1);
B=(2*h*nu.^3./c.^2)./(exp(h*nu ./(k*T(:)))-1);
plot(nu,B);
% xlim(1e9, 1e19);
xlim([1e9, 1e19]);
loglog(nu,B);
xlabel ('frequency ,Hz');
ylabel ('Bv,(w/(m^2steradian)')

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!