function [cut, mindistance, maxdistance, elevationcut, lowerz, upperz,... rhomin] = inputchecker(cut, mindistance, maxdistance, elevationcut,... lowerz, upperz, rhomin) % Use VCP to determine the number of cuts switch cut{1,1}.VCP case 11 cuts = 16; case 12 cuts = 17; case 21 cuts = 11; case 31 cuts = 8; case 32 cuts = 7; case 121 cuts = 20; case 211 cuts = 16; case 212 cuts = 17; case 221 cuts = 11; end if (mindistance < 1 || ~isnumeric(mindistance) || mindistance > maxdistance) mindistance = 1; fprintf('\nMinimum distance must be a numeric value of at least one and must be less than the maximum distance!'); fprintf('\nResetting minimum distance to zero kilometers.\n'); end if (maxdistance > 298 || ~isnumeric(maxdistance) || maxdistance < mindistance) maxdistance = 298; fprintf('\nMaximum distance must be a numeric value of less than 450 and must be greater than the minimum distance!'); fprintf('\nResetting maximum distance to 450 kilometers.\n'); end if (elevationcut < 0 || elevationcut > cuts || ~isnumeric(elevationcut)) elevationcut = 1; fprintf('\nElevation cut must be a numeric value of at least 1, but no greater than %d.',cuts); fprintf('\nResetting elevation cut to the lowest cut (1).\n'); end if (lowerz < -15 || ~isnumeric(lowerz)) lowerz = -15; fprintf('\nThe minimum reflectivity value must be at least -15 dBZ!'); fprintf('\nResetting the minimum reflectivity to -15.\n'); end if (upperz > 80 || ~isnumeric(upperz)) upperz = 80; fprintf('\nThe maximum reflectivity value must be less than 80 dBZ!'); fprintf('\nResetting maximum reflectivity to 80 dBZ.\n'); end if (rhomin > 1 || ~isnumeric(rhomin)) rhomin = 1; fprintf('\nThe correlation coefficient value must be less than one!'); fprintf('\nResetting correleation coefficient to 1.\n'); end end