I want to plot y vs. B

조회 수: 1 (최근 30일)
reem123
reem123 2023년 3월 4일
댓글: reem123 2023년 3월 6일
  댓글 수: 2
reem123
reem123 2023년 3월 4일
yes
reem123
reem123 2023년 3월 4일
B > =1

댓글을 달려면 로그인하십시오.

채택된 답변

Torsten
Torsten 2023년 3월 4일
이동: Torsten 2023년 3월 4일
B >= 1 ?
B = 1:0.1:10;
y = arrayfun(@(B) 2/sqrt(pi)*integral(@(x)x.^0.5./(B*exp(x)-1),0,Inf),B);
plot(B,y)
grid on
  댓글 수: 3
Star Strider
Star Strider 2023년 3월 4일
Since ‘B’ is not an integration limit, this would also work —
B = 1:0.1:10;
y = 2/sqrt(pi)*integral(@(x)x.^0.5./(B*exp(x)-1),0,Inf, 'ArrayValued',1)
y = 1×91
2.6124 1.6562 1.3616 1.1727 1.0359 0.9304 0.8460 0.7764 0.7180 0.6680 0.6248 0.5870 0.5537 0.5240 0.4974 0.4734 0.4517 0.4319 0.4138 0.3971 0.3818 0.3676 0.3544 0.3422 0.3308 0.3201 0.3101 0.3007 0.2919 0.2836
Otherwise the arrayfun call would be required.
.
reem123
reem123 2023년 3월 6일
Thank you

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by