Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

new, need help with integration

Status
Not open for further replies.

Lagomorph

Electrical
Aug 10, 2005
9
Hi,
I need to evaluate the following integral:

f(x) = (2/pi)*int('(y^2)/sqrt(y^2-x^2)','y',x,1) as 0<x<1

If I have x, incremented by 0.1 from 0 to 1 in a 1x10 matrix, is there a way I could create an array which will contain the integral above solved using all of the values for x in the array?

Thanks in advance
 
Replies continue below

Recommended for you

Yes, but the array would be 11 not 10.

syms x1 x2
A = [ x1; x2 ] % A horrible way to prime the pump, anyone have a better cleaner way?

x = 0 : 0.1 : 1;
nX = length( x );
for iX = 1 : nX;
A( iX )=(2/pi)*int('(y^2)/sqrt(y^2-x^2)','y',x( iX ),1)
end
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor