"Yuji Zhang" <email@example.com> wrote in message news:firstname.lastname@example.org... > Hi Bruno~ > > Thanks for getting back to me. > > I see. I assumed they were same. > > What do you mean by "(array non-vector) if it important their > orientation"?
Read the second sentence of this snippet from the documentation:
"Z = cumtrapz(X,Y) computes the cumulative integral of Y with respect to X using trapezoidal integration. X and Y must be vectors of the same length, or X must be a column vector and Y an array whose first nonsingleton dimension is length(X). cumtrapz operates across this dimension. Inputs X and Y can be complex."
% This works; for vectors, orientation doesn't matter cumtrapz(1:3, (4:6).')
% This works, since the first nonsingleton dimension of the second input is 3 which is the length of the first input cumtrapz([1; 2; 3], ones(3, 4))
% This does NOT work, even though the second input is just the transpose of the second input from the previous example cumtrapz([1; 2; 3], ones(4, 3))