integration in matlab - error

2 ビュー (過去 30 日間)
Rasmus
Rasmus 2014 年 3 月 4 日
編集済み: Mischa Kim 2014 年 3 月 5 日
I have to integrate the following expression
(3*sin^4 x)/x^4 with 0 as lower limit and 3 as upper limit.
my code is the following:
fun=@(x) (3*(sin.^4)(x))/x^4
q6=integral(fun,0,2)
what do i do wrong, it keeps saying ---> Unbalanced or unexpected parenthesis or bracket.
I can't see the problem - Anyone?

採用された回答

Mischa Kim
Mischa Kim 2014 年 3 月 5 日
編集済み: Mischa Kim 2014 年 3 月 5 日
Rasmus, use
fun = @(x) 3*(sin(x).^4)./x.^4;
sin^4 x is just another way of writing (sin(x))^4.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeOperating on Diagonal Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by