Hi
In this problem I know that for a=0.5 q=125. I try fo find that now I don't know a value but I know q. How can I estimate a value and use random command for a value.
a =rand(); % estimate number
b = 0.1;
fun = @(x,y) a*x.^2 + b*y.^2;
q = integral2(fun,0,5,-5,0) % real value 125

 채택된 답변

Star Strider
Star Strider 2019년 1월 12일

0 개 추천

Try this:
b = 0.1;
fun = @(x,y,a,b) a*x.^2 + b*y.^2;
q_fcn = @(a) integral2(@(x,y)fun(x,y,a,b),0,5,-5,0) % real value 125
a = fzero(@(a)q_fcn(a) - 125, 1)
producing:
a =
0.5
This solves for ‘a’ given ‘b’, ‘q’ and the limits of integration.

추가 답변 (1개)

erhan aksu
erhan aksu 2019년 1월 13일

0 개 추천

Thanks Star Strider

카테고리

도움말 센터File Exchange에서 Random Number Generation에 대해 자세히 알아보기

질문:

2019년 1월 12일

댓글:

2019년 1월 13일

Community Treasure Hunt

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

Start Hunting!

Translated by