how to add x^0 or y^0 variable in the function(dblquad)!!

조회 수: 1 (최근 30일)
tony kevine
tony kevine 2015년 4월 20일
댓글: Star Strider 2015년 4월 20일
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

답변 (1개)

Star Strider
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
tony kevine
tony kevine 2015년 4월 20일
no command int ,i most need dblquad
Star Strider
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 CenterFile Exchange에서 Dates and Time에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by