From f43691113d7c80c981951f1d9ec4911fd7de7495 Mon Sep 17 00:00:00 2001 From: Adeline CARNIS Date: Wed, 11 Jan 2017 12:45:58 +0100 Subject: [PATCH] Example of DesignEllipticFilter.xml produced a warning, addition/substraction with an empty matrix(call csim). Change-Id: I787c020517f3b722e1e7ecb295c6c6930ebee4a6 --- scilab/modules/cacsd/macros/csim.sci | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scilab/modules/cacsd/macros/csim.sci b/scilab/modules/cacsd/macros/csim.sci index ed0f34b..c57dc7a 100644 --- a/scilab/modules/cacsd/macros/csim.sci +++ b/scilab/modules/cacsd/macros/csim.sci @@ -135,12 +135,14 @@ function [y,x]=csim(u,dt,sl,x0,tol) ut=u; if min(size(ut))==1 then ut=matrix(ut,1,-1),end deff("[y]=u(t)",["ind=find(dt<=t);nn=ind(\$)" - "if (t==dt(nn)|nn==nt) then " + "if isempty(nn) then" + "y=[]" + "elseif (t==dt(nn)|nn==nt) then " " y=ut(:,nn)" "else " " y=ut(:,nn)+(t-dt(nn))/(dt(nn+1)-dt(nn))*(ut(:,nn+1)-ut(:,nn))" "end"]); - deff("[ydot]=%sim2(%tt,%y)","ydot=ak*%y+bk*u(%tt)"); + deff("[ydot]=%sim2(%tt,%y)","ydot = [];if ~isempty(u(%tt)) then ydot = ak*%y+bk*u(%tt);end"); elseif type(u)<>15 then deff("[ydot]=%sim2(%tt,%y)","ydot=ak*%y+bk*u(%tt)"); ut=ones(mb,nt);for k=1:nt, ut(:,k)=u(dt(k)),end -- 1.7.9.5