Numerical Integration in Matlab
Show older comments
Hi guys,
I am trying to numerical integrate a function, but I am not able to do it correctly. Can anyone help me here? I think I am not writing the syntax correctly. I have attached the code below.
kb = 1.38 .* 10.^-23;
h = 1.05 .* 10.^-34;
n_puc = 1.81 .* 10.^19;
g = 5.2 .* 10.^-7;
B1 = 4.5 .* 10.^-20;
B2 = 410;
k_max = sqrt(4.* pi .* n_puc);
w_max = g .* k_max .* k_max;
T = 300;
c = (h.^2 ./ (2 .* pi .* kb .* T.^3 .* B1 .* exp(-B2 ./ T)));
% Integral:
fun = @(x) ((x .* exp((h .* x) ./ (kb .* T))) ./ (((exp((h .* x) ./ (kb .* T)) - 1).^2)));
K = c .* integral(fun,0,w_max);
Thanks in advance guys,
Raj.
Accepted Answer
More Answers (0)
Categories
Find more on Numerical Integration and Differentiation 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!