summaryrefslogtreecommitdiff
path: root/nInputData.sci
diff options
context:
space:
mode:
authorpriyakedia2018-07-31 16:10:34 +0530
committerpriyakedia2018-07-31 16:10:34 +0530
commitdb25cb043776c50d0f0ee98636301906b065d8f0 (patch)
tree999773628035605e4963be2712401bf9836188a6 /nInputData.sci
parenta0084443a1d6a9bebd29a0860c7ae83c22f08002 (diff)
downloadFOSSEE-System-Identification-Toolbox-db25cb043776c50d0f0ee98636301906b065d8f0.tar.gz
FOSSEE-System-Identification-Toolbox-db25cb043776c50d0f0ee98636301906b065d8f0.tar.bz2
FOSSEE-System-Identification-Toolbox-db25cb043776c50d0f0ee98636301906b065d8f0.zip
examples included
Diffstat (limited to 'nInputData.sci')
-rw-r--r--nInputData.sci43
1 files changed, 39 insertions, 4 deletions
diff --git a/nInputData.sci b/nInputData.sci
index 59a3b64..8d5a481 100644
--- a/nInputData.sci
+++ b/nInputData.sci
@@ -1,15 +1,50 @@
function varargout = nInputSeries(varargin)
- [lhs rhs] = argn(0)
+// Count the number of input output data series
+//
+// Calling Sequence
+// ioData = nInputSeries(plantData)
+//
+// Parameters
+// plantData : iddata type module
+// ioData : structure type variable having input and output object
+//
+// Description
+// plantData must be iddata type. The function returns the number of input and output data series in struct form. It has two fields name as input and output.
+//
+// Examples
+// plantData = iddata(rand(100,3),rand(100,2),0.1)
+// ioData = nInputSeries(plantData)
+//
+// Examples
+// plantData = iddata(rand(100,2),[],0.1)
+// ioData = nInputSeries(plantData)
+//
+// Examples
+// plantData = iddata([],rand(100,3),0.1)
+// ioData = nInputSeries(plantData)
+//
+// Authors
+// Ashutosh Kumar Bhargava, Bhushan Manjarekar
+//
+ [lhs rhs] = argn(0)
if rhs <> 1 then
- error(msprintf(gettext("%s: Wrong number of input arguments."),"iddataplot"))
+ error(msprintf(gettext("%s: Wrong number of input arguments."),"nInputSeries"))
end
iddataData = varargin(1)
if typeof(iddataData) <> 'iddata' then
error(msprintf(gettext("%s:Wrong type for input argument %d: ""iddata"" expected."),"nInputSeries",1))
end
+ t = struct('input',0,'output',0)
+
if ~size(iddataData.InputData,'*') then
- varargout(1) = 1
+ t.input = 0
else
- varargout(1) = size(iddataData.InputData,'c')
+ t.input = size(iddataData.InputData,'c')
end
+ if ~size(iddataData.OutputData,'*') then
+ t.output = 0
+ else
+ t.output = size(iddataData.InputData,'c')
+ end
+ varargout(1) = t
endfunction