1 function resu = df_allmeta(df, dim = [])
3 %# function resu = df_allmeta(df)
4 %# Returns a new dataframe, initalised with the all the
5 %# meta-information but with empty data
7 %% Copyright (C) 2009-2012 Pascal Dupuis <Pascal.Dupuis@uclouvain.be>
9 %% This file is part of Octave.
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.
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
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.
28 %# $Id: df_allmeta.m 9585 2012-02-05 15:32:46Z cdemills $
36 dim = dim(1:2); %# ignore third dim, if any
39 resu._cnt(1:2) = min(dim, df._cnt(1:2));
40 if (!isempty(df._name{1})),
41 resu._name{1} = df._name{1}(1:resu._cnt(1));
42 resu._over{1} = df._over{1}(1:resu._cnt(1));
44 if (!isempty(df._name{2})),
45 resu._name{2} = df._name{2}(1:resu._cnt(2));
46 resu._over{2} = df._over{2}(1:resu._cnt(2));
48 if (!isempty(df._ridx)),
49 if (size(df._ridx, 2) >= resu._cnt(2)),
50 resu._ridx = df._ridx(1:resu._cnt(1), :, :);
52 resu._ridx = df._ridx(1:resu._cnt(1), 1, :);
55 %# init it with the right orientation
56 resu._data = cell(size(df._data));
57 resu._rep = cell(size(df._rep));
58 resu._type = df._type(1:resu._cnt(2));