Help in solving an integral using MATLAB

[EDIT: Thu Jun 23 15:48:04 UTC 2011 - Clarify - MKF]
This is the integral that I'm trying to solve.
clear
clc
syms x y;
f = input('Write function = ');
F = inline (char(f));
a = input ('from (x): ');
b = input ('to (x) : ');
a1 = input ('from (y) : ');
b1 = input ('to (y) : ');
F = int (int(f,x,a,b),y,a1,b1);
the function is:
(1/((3.11e-6)-((2.25e-6)*(((1-((x^2)/(1e-8)))^2)*((1-((y^2)/(1e-8)))^2)*(1+((1.1e-8)*(x^2))+((1.1e-8)*(y^2)))))))
and must be evaluate in x: from -1e-4 to 1e-4 and in y from -1e-4 to 1e-4

 Accepted Answer

f = @(x,y)(1./((3.11e-6)-((2.25e-6).*(((1-((x.^2)./(1e-8))).^2).*((1-((y.^2)./(1e-8))).^2).*(1+((1.1e-8).*(x.^2))+((1.1e-8).*(y.^2)))))))
dblquad(f,-1e-4,1e-4,-1e-4,1e-4)

More Answers (1)

int() applies to symbolic expressions, not to inline functions.
That said: the function is difficult (perhaps impossible) to integrate symbolically, but numeric integration should be fast. Consider using one of the quad* integrators.

Categories

Find more on Programming in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!