I want to plot y vs. B

1 Ansicht (letzte 30 Tage)
reem123
reem123 am 4 Mär. 2023
Kommentiert: reem123 am 6 Mär. 2023
  2 Kommentare
reem123
reem123 am 4 Mär. 2023
yes
reem123
reem123 am 4 Mär. 2023
B > =1

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Torsten
Torsten am 4 Mär. 2023
Verschoben: Torsten am 4 Mär. 2023
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 Kommentare
Star Strider
Star Strider am 4 Mär. 2023
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 am 6 Mär. 2023
Thank you

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu MATLAB finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by