How to define variables using triple integrals
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Ive been at this for to long. I need to calculate the triple integral of 1 dz dy dx..
fun = @ (z,y,x) 1
but not I do not know how to type in the limits of integration.
The first one is from 0 to -3/2x-y+3
I put xmin = 0
xmax = -3/2.*x.-y.+3
I get an undefined matlab operator where the period is to the right of x. I've tried every combination and can't seem to be able to type in a simple equation.
If anyone can help me to where matlab will take the upper bound limit of integration that would help a lot!
0 Kommentare
Antworten (1)
Roger Stafford
am 28 Mär. 2015
Bearbeitet: Roger Stafford
am 28 Mär. 2015
See Mathworks' documentation site:
http://www.mathworks.com/help/matlab/ref/integral3.html
As you can see, if you have variable limits of integration in 'integral3', these must be defined in terms of functions, either anonymous functions or other kinds of functions, and not an expression such as you used here.
Also the dots following x and y in your expression are definitely not valid in any case. What were you trying to accomplish there?
2 Kommentare
Roger Stafford
am 2 Apr. 2015
You haven't made it clear what three-dimensional space you are integrating over. In particular you haven't defined your lower integration limits. I have guessed from your remarks that it is over the following tetrahedron:
xmin = 0;
xmax = 3;
ymin = 0;
ymax = @(x)-3/2*x+3;
zmin = 0;
zmax = @(x,y)-3/2-y+3;
The desired integral would then be:
I = integral3(@(x,y,z)1,xmin,xmax,ymin,ymax,zmin,zmax);
If this is the intended region of integration, you could of course have done the integration mentally and gotten
1/6*3*3*2 = 3 (1/6*base*height)
as the answer without ever bothering to use matlab.
Siehe auch
Kategorien
Mehr zu Numerical Integration and Differential Equations finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!