PLEASE HELP, INTEGRAL MATLAB Error using integral2Calc>integral2t/tensor
Afficher commentaires plus anciens
Réponses (1)
Walter Roberson
le 28 Mar 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)
Catégories
En savoir plus sur Calculus dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

