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

回答(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 个评论
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 中查找有关 Number Theory 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by