Home > matlab > pltorg.m

pltorg

PURPOSE ^

Copyright (C) 2004-2008 Dynare Team

SYNOPSIS ^

function [nbplt,nr,nc,lr,lc,nstar] = pltorg(number)

DESCRIPTION ^

 Copyright (C) 2004-2008 Dynare Team

 This file is part of Dynare.

 Dynare is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.

 Dynare is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with Dynare.  If not, see <http://www.gnu.org/licenses/>.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [nbplt,nr,nc,lr,lc,nstar] = pltorg(number)
0002 
0003 % Copyright (C) 2004-2008 Dynare Team
0004 %
0005 % This file is part of Dynare.
0006 %
0007 % Dynare is free software: you can redistribute it and/or modify
0008 % it under the terms of the GNU General Public License as published by
0009 % the Free Software Foundation, either version 3 of the License, or
0010 % (at your option) any later version.
0011 %
0012 % Dynare is distributed in the hope that it will be useful,
0013 % but WITHOUT ANY WARRANTY; without even the implied warranty of
0014 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0015 % GNU General Public License for more details.
0016 %
0017 % You should have received a copy of the GNU General Public License
0018 % along with Dynare.  If not, see <http://www.gnu.org/licenses/>.
0019 
0020 nrstar = 3;
0021 ncstar = 3;
0022 nstar  = nrstar*ncstar;
0023 nbplt  = 0;
0024 nr     = 0;
0025 nc     = 0;
0026 lr     = 0;
0027 lc     = 0;
0028 if number == 1
0029     nbplt = 1;
0030     nr    = 1;
0031     nc    = 1;
0032 elseif number == 2
0033     nbplt = 1;
0034     nr    = 2;
0035     nc    = 1;
0036 elseif number == 3
0037     nbplt = 1;
0038     nr    = 3;
0039     nc    = 1;
0040 elseif number == 4
0041     nbplt = 1;
0042     nr    = 2;
0043     nc    = 2;
0044 elseif number == 5
0045     nbplt = 1;
0046     nr    = 3;
0047     nc    = 2;
0048 elseif number == 6
0049     nbplt = 1;
0050     nr    = 3;
0051     nc    = 2;    
0052 elseif number == 7
0053     nbplt = 1;
0054     nr    = 3;
0055     nc    = 3;    
0056 elseif number == 8
0057     nbplt = 1;
0058     nr    = 3;
0059     nc    = 3;
0060 elseif number == 9
0061     nbplt = 1;
0062     nr    = 3;
0063     nc    = 3;
0064 else
0065     if number/nstar == round(number/nstar)
0066         nbplt = number/nstar;
0067         nr    = nrstar;
0068         nc    = ncstar;
0069         lr    = nr;
0070         lc    = nc; 
0071     else
0072         nbplt = ceil(number/nstar);
0073         nr    = nrstar;
0074         nc    = ncstar;
0075         reste = number-(nbplt-1)*nstar;
0076         if reste == 1
0077             lr    = 1;
0078             lc    = 1;
0079         elseif reste == 2
0080             lr    = 2;
0081             lc    = 1;
0082         elseif reste == 3
0083             lr    = 3;
0084             lc    = 1;
0085         elseif reste == 4
0086             lr    = 2;
0087             lc    = 2;
0088         elseif reste == 5
0089             lr    = 3;
0090             lc    = 2;
0091         elseif reste == 6
0092             lr    = 3;
0093             lc    = 2;    
0094         elseif reste == 7
0095             lr    = 3;
0096             lc    = 3;    
0097         elseif reste == 8
0098             lr    = 3;
0099             lc    = 3;
0100         end
0101     end
0102 end

Generated on Tue 22-May-2012 02:40:23 by m2html © 2005