Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TugboatEng 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
Joined
Aug 10, 2005
Messages
9
Location
US
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
 
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

Back
Top