1 ## Copyright (C) 2006 Michel D. Schmid <michaelschmid@users.sourceforge.net>
4 ## This program is free software; you can redistribute it and/or modify it
5 ## under the terms of the GNU General Public License as published by
6 ## the Free Software Foundation; either version 2, or (at your option)
9 ## This program is distributed in the hope that it will be useful, but
10 ## WITHOUT ANY WARRANTY; without even the implied warranty of
11 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 ## General Public License for more details.
14 ## You should have received a copy of the GNU General Public License
15 ## along with this program; see the file COPYING. If not, see
16 ## <http://www.gnu.org/licenses/>.
19 ## @deftypefn {Function File} {}[@var{Pp},@var{Tt}] = poststd(@var{Pn},@var{meanp},,@var{stdP},@var{Tn},@var{meanT},@var{stdT})
20 ## @code{poststd} postprocesses the data which has been preprocessed by @code{prestd}.
23 ## @seealso{prestd,trastd}
25 ## Author: Michel D. Schmid
27 function [Pp,Tt] = poststd(Pn,meanp,stdp,Tn,meant,stdt)
29 ## check range of input arguments
30 error(nargchk(3,6,nargin))
32 error("4 input arguments are not allowed!");
35 error("5 input arguments are not allowed!");
39 ## set all standard deviations which are zero to 1
40 [nRowsII, nColumnsII] = size(Pn);
41 rowZeros = zeros(nRowsII,1);
42 findZeros = find(stdp==0);
43 rowZeros(findZeros)=1;
45 if (sum(rowZeros) != 0)
46 warning("Some standard deviations are zero. Those inputs won't be transformed.");
47 meanpZero = meanp.*nequal;
48 stdpZero = stdp.*nequal + 1*rowZeros;
54 ## calculate the postprocessed inputs
55 nColumnsIIone = ones(1,nColumnsII);
56 Pp = (stdpZero*nColumnsIIone).*Pn + meanpZero*nColumnsIIone;
60 # now set all standard deviations which are zero to 1
61 [nRowsIII, nColumnsIII] = size(stdt);
62 rowZeros = zeros(nRowsIII,1);
63 findZeros = find(stdt==0);
64 rowZeros(findZeros)=1;
66 if (sum(rowZeros) != 0)
67 warning("Some standard deviations are zero. Those targets won't be transformed.");
68 meantZero = meant.*nequal;
69 stdtZero = stdt.*nequal + 1*rowZeros;
75 ## calculate the postprocessed targets
76 nColumnsIIIone = ones(1,nColumnsIII);
77 Tt = (stdtZero*nColumnsIIIone).*Tn + meantZero*nColumnsIIIone;