I want to plot y vs. B

1 次查看(过去 30 天)
reem123
reem123 2023-3-4
评论: reem123 2023-3-6

采纳的回答

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.
.

请先登录,再进行评论。

更多回答(0 个)

标签

Community Treasure Hunt

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

Start Hunting!

Translated by