summaryrefslogtreecommitdiff
path: root/nInputData.sci
diff options
context:
space:
mode:
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