1 function varargout = size(df, varargin)
2 %# function resu = size(df, varargin)
3 %# This is size operator for a dataframe object.
5 %% Copyright (C) 2009-2012 Pascal Dupuis <Pascal.Dupuis@uclouvain.be>
7 %% This file is part of Octave.
9 %% Octave is free software; you can redistribute it and/or
10 %% modify it under the terms of the GNU General Public
11 %% License as published by the Free Software Foundation;
12 %% either version 2, or (at your option) any later version.
14 %% Octave is distributed in the hope that it will be useful,
15 %% but WITHOUT ANY WARRANTY; without even the implied
16 %% warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
17 %% PURPOSE. See the GNU General Public License for more
20 %% You should have received a copy of the GNU General Public
21 %% License along with Octave; see the file COPYING. If not,
22 %% write to the Free Software Foundation, 51 Franklin Street -
23 %% Fifth Floor, Boston, MA 02110-1301, USA.
26 %# $Id: size.m 9585 2012-02-05 15:32:46Z cdemills $
33 varargout{1} = df._cnt;
35 varargout{1} = df._cnt(1);
36 if (1 == df._cnt(2) && length(df._cnt) > 2),
37 varargout{2} = df._cnt(3);
39 varargout{2} = df._cnt(2);
42 varargout{1:2} = df._cnt(1:2);
43 if 2==length(df._cnt),
46 varargout{3} = df._cnt(3);
54 varargout{1} = df._cnt;
56 varargout{1} = varargout{1}(varargin{1});
66 if (length(df._cnt) < 3),
69 varargout{1} = df._cnt;
72 varargout{1} = varargout{1}(varargin{1});
85 function usage = print_usage()
86 usage = strcat('Invalid call to size. Correct usage is: ', ' ', ...
87 '-- Overloaded Function: size (A, N)');