]> Creatis software - CreaPhase.git/blob - octave_packages/dataframe-0.9.1/@dataframe/private/df_strjust.m
Add a useful package (from Source forge) for octave
[CreaPhase.git] / octave_packages / dataframe-0.9.1 / @dataframe / private / df_strjust.m
1 function [a, b] = df_strjust(a, b)
2   
3   %# small auxiliary function: make two char arrays the same width
4
5   %% Copyright (C) 2009-2012 Pascal Dupuis <Pascal.Dupuis@uclouvain.be>
6   %%
7   %% This file is part of Octave.
8   %%
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.
13   %%
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
18   %% details.
19   %%
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.
24   
25   %#
26   %# $Id: df_strjust.m 9585 2012-02-05 15:32:46Z cdemills $
27   %#
28
29   indi = size(a, 2) - size(b, 2);
30   if indi < 0
31     a = horzcat(repmat(' ', size(a, 1), -indi), a);
32   elseif indi > 0,
33     b = horzcat(repmat(' ', size(b, 1), indi), b);
34   endif
35
36 endfunction