fitting_uCP
PURPOSE 
sentido = 1 -> Increassing uCP (i.e. increasing the distortion parameter)
SYNOPSIS 
function [uCP, l_min, l_max, porcentaje, sentido] = fitting_uCP(param, param_actual, uCP, l_min, l_max, porcentaje, sentido)
DESCRIPTION 
CROSS-REFERENCE INFORMATION 
This function calls:
This function is called by:
SOURCE CODE 
0001
0002
0003
0004
0005
0006 function [uCP, l_min, l_max, porcentaje, sentido] = fitting_uCP(param, param_actual, uCP, l_min, l_max, porcentaje, sentido)
0007 if((param - param_actual > 0) & (sentido == 1))
0008
0009 porcentaje = porcentaje / 2;
0010
0011 if(porcentaje >= 1)
0012 porcentaje = 0.25;
0013 end
0014
0015 l_max = uCP;
0016
0017 uCP = (1 - porcentaje) * uCP;
0018
0019 if(uCP < l_min)
0020 uCP = (l_min + l_max)/2;
0021 end
0022
0023 sentido = 0;
0024 return;
0025 end
0026
0027 if((param - param_actual < 0) & (sentido == 1))
0028
0029 l_min = uCP;
0030
0031 uCP = (1 + porcentaje) * uCP;
0032
0033 if(uCP > l_max)
0034 uCP = (l_min + l_max)/2;
0035 end
0036
0037 sentido = 1;
0038
0039 porcentaje = 2 * porcentaje;
0040 return;
0041 end
0042
0043 if((param - param_actual < 0) & (sentido == 0))
0044
0045 porcentaje = porcentaje / 2;
0046
0047 l_min = uCP;
0048
0049 uCP = (1 + porcentaje) * uCP;
0050
0051 if(uCP > l_max)
0052 uCP = (l_min + l_max)/2;
0053 end
0054
0055 sentido = 1;
0056 return;
0057 end
0058
0059 if((param - param_actual > 0) & (sentido == 0))
0060
0061 if(porcentaje >= 1)
0062 porcentaje = 0.25;
0063 end
0064
0065 l_max = uCP;
0066
0067 uCP = (1 - porcentaje) * uCP;
0068
0069 if(uCP < l_min)
0070 uCP = (l_min + l_max)/2;
0071 end
0072
0073 sentido = 0;
0074
0075 porcentaje = 2 * porcentaje;
0076 return;
0077 end
Generated on Fri 07-Mar-2014 13:29:20 by m2html © 2005