From e5e316e1958e27696d7670e2492992d34ff38b68 Mon Sep 17 00:00:00 2001 From: ttt Date: Mon, 9 Jul 2018 16:54:44 +0530 Subject: added scilabs files --- identTime.sci | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 identTime.sci (limited to 'identTime.sci') diff --git a/identTime.sci b/identTime.sci new file mode 100644 index 0000000..c4c47c8 --- /dev/null +++ b/identTime.sci @@ -0,0 +1,32 @@ +function varargout = identTime(varargin) + [lhs , rhs] = argn() + if ( rhs <> 1 ) then + errmsg = msprintf(gettext("%s: Wrong number of input arguments"), "identTime"); + error(errmsg) + elseif typeof(varargin(1)) <> "iddata" then + error(msprintf(gettext("%s:Input model must be ""iddata"" type.\n"),"identTime")) + end + plantData = varargin(1) + //disp('yolo') + inputData = plantData.InputData;inputData = size(inputData,'r') + outputData = plantData.OutputData;outputData = size(outputData,'r') + sampleNumb = max(inputData,outputData) + timeData = (0:sampleNumb-1)*plantData.Ts + t = tlist(['identTime','samples','start','end','Frequency','TimeSeries'],sampleNumb,0,timeData($),1/plantData.Ts,timeData) + varargout(1) = t +endfunction + +function %identTime_p(mytlist) + f = fieldnames(mytlist) + mprintf("\t samples : %d\n",mytlist.samples) + mprintf("\t start : %d\n",mytlist.start) + mprintf("\t end : %d\n",mytlist.end) + if ceil(mytlist.Frequency)-mytlist.Frequency then + mprintf("\t Frequency : %.4f\n",mytlist.Frequency) + else + mprintf("\t Frequency : %d\n",mytlist.Frequency) + end + timeData = mytlist.TimeSeries + mprintf("\t TimeSeries : %.2f, %.2f, . ,%.2f",timeData(1),timeData(2),timeData($)) + +endfunction -- cgit