how to add x^0 or y^0 variable in the function(dblquad)!!
조회 수: 1 (최근 30일)
이전 댓글 표시
i have question about how to automatic add x^0 in a3 for every item.Because i must need dblquad.when i use the command without add x^0 by hand .it will error!!
but actually i have a lot of things like a3 without x variable or y variable so i need help.
What command can automatic add x or y variable.
a3=((2*y)/3 - 1)^2*(5085106975559725/144115188075855872 + 3243695640608965i/18446744073709551616)
b3=matlabFunction(a3)
c3=dblquad(b3,-1,1-1,1)% it will error beacuse no x^0 so any one have good ideal about it
댓글 수: 0
답변 (1개)
Star Strider
2015년 4월 20일
Your anonymous function ‘b3’ is a function of one variable. The MATLAB double integration functions want it to be a function of two variables. If you want to integrate it across ‘x’ as well, you would have to do something like this:
syms y x
a3=((2*y)/3 - 1)^2*(5085106975559725/144115188075855872 + 3243695640608965i/18446744073709551616)
c3 = vpa(int(int(a3, y, -1, 1), x, -1, 1), 10)
produces:
c3 =
0.1620497113 + 0.0008075665013i
Experiment to get the result you want.
댓글 수: 2
Star Strider
2015년 4월 20일
The int function is in the Symbolic Math Toolbox.
The dblquad function will not work with your single-variable function ‘c3’.
참고 항목
카테고리
Help Center 및 File Exchange에서 Dates and Time에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!