Dynamic-Calibration/utils/YALMIP-master/@sdpvar/cumtrapz.m

25 lines
463 B
Mathematica
Raw Normal View History

2019-12-18 11:25:45 +00:00
function X=cumtrapz(X,I)
%CUMTRAPZ (overloaded)
if nargin == 1 && min(X.dim)==1
B = cumtrapz(X.basis);
else
if nargin == 1
I = find(X.dim>1,1);
if isempty(I)
I = 1;
end
end
B = [];
for i = 1:length(X.lmi_variables)+1
C = reshape(X.basis(:,i),X.dim);
C = cumtrapz(C,I);
B = [B C(:)];
end
end
X.basis = B;
X.conicinfo = [0 0];
X.extra.opname = '';
X = flush(X);
X = clean(X);