How to add integral in a integral function

I need to add an complex integral inside of a integral function like this:
integral(@(x)sin(integral(@(a)sin(a),0,x)),0,1)
However, it turns out to be an error with message: “Limits of integration must be double or single scalars.”
P.S. My function is much complex than 'sin(x)', here just is an example.
How to solve this?

 採用された回答

Torsten
Torsten 2022 年 11 月 30 日
編集済み: Torsten 2022 年 11 月 30 日

0 投票

format long
integral(@(x)sin(integral(@(a)sin(a),0,x)),0,1,'ArrayValued',true)
ans =
0.156096097878724
integral(@(x)sin(1-cos(x)),0,1)
ans =
0.156096097878724

その他の回答 (0 件)

カテゴリ

製品

リリース

R2021a

タグ

質問済み:

2022 年 11 月 30 日

コメント済み:

2022 年 12 月 1 日

Community Treasure Hunt

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

Start Hunting!

Translated by