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 Center および File ExchangeDates and Time についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by