PLEASE HELP, INTEGRAL MATLAB Error using integral2Calc>integral2t/tensor
Mostrar comentarios más antiguos
Respuestas (1)
Walter Roberson
el 28 de Mzo. de 2022
qmin=@(p)y^2
That looks in the workspace to find the current value of a variable named y and stores that value internally in the function handle. Then it creates the function handle to accept a single parameter (named p for convenience) with the function handle set to completely ignore the value passed in to it, and to instead retrieve the saved y value and square that. If that saved y does not happen to be a square matrix then it would give an error because only square matrices can have the matrix power ^ operator applied to them -- y^2 is y*y which is inner product of y and y .
You are returning the value of y^2 no matter what input is being passed to you, and MATLAB is noticing that and complaining.
You should probably be using closer to
fun = @(y,x,z) ones(size(y))
ymin = -1;
ymax = 1;
xmin = @(y) y.^2;
xmax = @(y) 2-y.^2;
zmin = 0;
zmax = @(y,x) 6-x-2*y;
V = integral3( f, ymin, ymax, xmin, xmax, zmin, zmax)
Categorías
Más información sobre Calculus en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

