Trying to fill the area under the function up to the dotted line.... can't figure out how to get area or fill functions to work
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
tyler Wallis
el 23 de Mayo de 2018
Respondida: Stephan
el 26 de Mayo de 2018
clear;clc;
syms lam
c1=3.7142*10^-16; %W*m^2 c2=1.4388*10^-2; %m*K eps=0.7; T=2000; %K c=299792458; %m/s h=6.62607004*10^-34; %m^2*kg/s E1=1.1*1.602*10^-19; %J or kg*m^2/s^2
lam1=h*c/E1;
M=eps*c1/(lam.^5*(exp(c2/(lam*T))-1)); fplot(M,[0,10*10^-6]) line([lam1 lam1],[0 M1],'Color','red','LineStyle','--')
x=linspace(0,lam1); M1=eps*c1/(lam1^5*(exp(c2/(lam1*T))-1)); area(x,M1)
0 comentarios
Respuesta aceptada
Stephan
el 26 de Mayo de 2018
Hi,
i suppose you wanted to achieve this:
to do so i changed your code this way:
clear;
clc;
syms lam
c1=3.7142*10^-16; %W*m^2
c2=1.4388*10^-2; %m*K
eps=0.7;
T=2000; %K
c=299792458; %m/s
h=6.62607004*10^-34; %m^2*kg/s
E1=1.1*1.602*10^-19; %J or kg*m^2/s^2
lam1=h*c/E1;
x=linspace(0,lam1);
M=eps*c1/(lam.^5*(exp(c2/(lam*T))-1));
M1=eps*c1./(x.^5.*(exp(c2./(x*T))-1));
hold on
fplot(M,[0,10*10^-6])
line(x, M1,'Color','red','LineStyle','--')
area(x,M1)
hold off
Best regards
Stephan
0 comentarios
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!