dblquad function handle help
Ältere Kommentare anzeigen
Hello. I'm facing the following problem:
dblquad('power(x,3)*power(y,3)',0,1,0,1)
Works perfectly fine! But...
dblquad('x^3*y^3',0,1,0,1)
Gives the following error...
Error using inlineeval (line 15)
Error in inline expression ==> x^3*y^3
Inputs must be a scalar and a square matrix.
To compute elementwise POWER, use POWER (.^) instead.
Error in inline/subsref (line 24)
INLINE_OUT_ = inlineeval(INLINE_INPUTS_, INLINE_OBJ_.inputExpr, INLINE_OBJ_.expr);
Error in quad (line 72)
y = f(x, varargin{:});
Error in dblquad>innerintegral (line 82)
Q(i) = quadf(intfcn, xmin, xmax, tol, trace, y(i), varargin{:});
Error in quad (line 72)
y = f(x, varargin{:});
Error in dblquad (line 58)
Q = quadf(@innerintegral, ymin, ymax, tol, trace, intfcn, ...
So, what I've tried is:
dblquad('x.^3*y.^3',0,1,0,1)
And it works perfectly well. The real problem is that I must define a vector with functions:
k=1;
syms x y
for i=1:n;
for j=1:n;
f(k)=power(x,1+i)*power(y,1+j);
k=k+1;
end
end
And then I must deliver the following code to dblquad:
dblquad(char(f(k)),0,1,0,1);
And char(f(k)) gives me 'x^(1+i)*y^(j+1)' form, which dblquad can't handle. (Noting that "i" and "j" are now real numbers, arbitrary.)
Any ideas?
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Operators and Elementary Operations finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!