]> Creatis software - CreaPhase.git/blob - octave_packages/dataframe-0.9.1/@dataframe/private/df_thirddim.m
Add a useful package (from Source forge) for octave
[CreaPhase.git] / octave_packages / dataframe-0.9.1 / @dataframe / private / df_thirddim.m
1 function [df] = df_thirddim(df)
2
3   %# function [resu] = df_thirddim(df)
4   %# This is a small helper function which recomputes the third dim each
5   %# time a change may have occured.
6
7   %% Copyright (C) 2009-2012 Pascal Dupuis <Pascal.Dupuis@uclouvain.be>
8   %%
9   %% This file is part of Octave.
10   %%
11   %% Octave is free software; you can redistribute it and/or
12   %% modify it under the terms of the GNU General Public
13   %% License as published by the Free Software Foundation;
14   %% either version 2, or (at your option) any later version.
15   %%
16   %% Octave is distributed in the hope that it will be useful,
17   %% but WITHOUT ANY WARRANTY; without even the implied
18   %% warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
19   %% PURPOSE.  See the GNU General Public License for more
20   %% details.
21   %%
22   %% You should have received a copy of the GNU General Public
23   %% License along with Octave; see the file COPYING.  If not,
24   %% write to the Free Software Foundation, 51 Franklin Street -
25   %% Fifth Floor, Boston, MA 02110-1301, USA.
26   
27   %#
28   %# $Id: df_thirddim.m 9585 2012-02-05 15:32:46Z cdemills $
29   %#
30
31   %# sanity check
32   dummy = max(cellfun(@length, df._rep));
33   if (dummy != 1),
34     df._cnt(3) = dummy;
35   elseif (length(df._cnt) > 2), 
36     df._cnt = df._cnt(1:2);
37   endif
38
39 endfunction