I've written this simple function on Matlab:
function [A] = tries (a, b, c, d)
global S CdM AdA
D = @(Z, Vx, Vy, Vz) 0.5*S*(Vx.^2 + Vy.^2 + Vz.^2)*CdM(sqrt(Vx.^2 + Vy.^2 + Vz.^2))*AdA(Z);
A = D(a, b, c, d);
end
but I keep getting this error: "Index exceeds matrix dimensions" and it says that the error is in line 3.
When I put the same text in the main function (and not in a separate one) it works perfectly. Anything in mind what the problem might be?
tries? - DVarga