plotting a function which is an Integral

Hi I am new to matlab and i would like to know how to plot the function
for x in the intervall (0,50). Does someone have an idea?

 採用された回答

Torsten
Torsten 2022 年 3 月 23 日

0 投票

a=1;
fun = @(z,x) z.^a./sinh(z).*1./(x.^2+z.^2);
X = 0:0.1:50;
for i = 1:numel(X)
x = X(i);
F(i) = x*sin(x)*integral(@(z)fun(z,x),0,Inf)
end
plot(X,F)

2 件のコメント

David Astner
David Astner 2022 年 3 月 23 日
Hi. thank you i always get the error message: Execution of script integral as a function is not supported
Torsten
Torsten 2022 年 3 月 23 日
Rename the script in test.m.
integral.m is a MATLAB function - the name is reserved.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeProgramming についてさらに検索

タグ

質問済み:

2022 年 3 月 23 日

コメント済み:

2022 年 3 月 23 日

Community Treasure Hunt

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

Start Hunting!

Translated by