integration in matlab - error
조회 수: 3 (최근 30일)
이전 댓글 표시
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?
댓글 수: 0
채택된 답변
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
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Operating on Diagonal Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!