Looking for help. I'm trying to plot this

13 ビュー (過去 30 日間)
JC
JC 2019 年 4 月 25 日
回答済み: JC 2019 年 4 月 26 日
My goal is to create the plot from the picture below which Figure 2.3. Thank you so much in advance!
Variables
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; % Temperature [K]
lam = logspace(-8,1,100); % wavelength [m]
%
% Planck's Law
% My plot for Planck's law works!
L=((2*h*c^(2))./lam.^(5)).*(exp(h*c./(lam.*k*T)-1)).^(-1);
loglog(L)
%
% Wein's Law
% How do I plot Wein's Law in Matlab correctly? My attempt below.
Y=(h*c)./(k*T.*lam)
and when I use loglog(Y) nothing shows up! :(
The picture below is what I am referencing.
  2 件のコメント
Star Strider
Star Strider 2019 年 4 月 26 日
and when I use loglog(Y) nothing shows up!’
It does when I plot it:
figure
loglog(Y)
and also as:
figure
loglog(lam, Y)
JC
JC 2019 年 4 月 26 日
編集済み: JC 2019 年 4 月 26 日
Using the code below gives me a line?
figure
loglog(lam, Y)
Is there a way where I can plot both functions separately on the same graph?

サインインしてコメントする。

回答 (1 件)

JC
JC 2019 年 4 月 26 日
Any ideas gentlemen?

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by