I want to plot y vs. B
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1314400/image.png)
Akzeptierte Antwort
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
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)
Otherwise the arrayfun call would be required.
.
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!