Numerical integration Matlab plot
조회 수: 1 (최근 30일)
이전 댓글 표시
The function which I want to integrate is:
fun = @(x) (1./(exp(0.00004781./(x))-1).*1./x.^4);
q = integral(fun,0,x1)
I want to make a semilogx plot of (q, x1) in matlab for values of x1 from 100*(10^(-9)) to 100*(10^(-6)). How can I do it using for loop?
Thanks in advance.
Raj Patel.
댓글 수: 0
채택된 답변
Ameer Hamza
2020년 9월 22일
You can do it using arrayfun (similar to for-loop, but compact)
x1 = logspace(-9, -6, 10);
fun = @(x) (1./(exp(0.00004781./(x))-1).*1./x.^4);
y = arrayfun(@(x1_) integral(fun, 0, x1_), x1);
semilogx(x1, int_fun);
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!