MATCHCASE returns the case number of the value(s) that best match the arguments given in the function
Syntax
- MATCHCASE(Pno%, Ndim%, "ColLab$_1",.., "ColLab$_Ndim%", Val_1,..,Val_Ndim%-1, [Mode%=0,1])
- MATCHCASE(@ObjFn(..), Ndim%, @ObjColPar_1,.., @ObjColPar_Ndim%, Val_1,..,Val_Ndim%-1, [Mode%=0,1])
- MATCHCASE(Telitab$, Ndim%, "ColLab$_1",.., "ColLab$_Ndim%", Val_1,..,Val_Ndim%-1, [Mode%=0,1])
Arguments
- Pno% is the number that refers to the TeLiTab sets in the Data slot. Pno% should be an integer value or a parameter which is assigned an integer value and is the number of theTeLiTab set in the expressions' data slot.
- @ObjFn() refers to the Object from which data will be used.
- TeLiTab$ refers to the string parameter that contains the TeLiTab.
- Ndim% is the number of dimensions (or columns in the table...).
- "ColLab$_1" and @ObjColPar_1 etc refer to the columns that will be used
- Val_1,..,Val_Ndim%-1 are the value that should be matched with the dataset
- Mode% determines the way of matching
- Mode%=1 full coincide (complete match of all values)
- Mode%=0 coincides the bset (best match of all values)
- See also Telitab access for a generic description on the use of TeLiTab data
- Similar to other Data analysis functions, the MATCHCASE is a convenient way to evaluate data. Please also look at these functions for syntax examples
- The case in the database with the smallest Euclidian distance [ http://en.wikipedia.org/wiki/Euclidean_distance] to the case (or pattern) given through the MATCHCASE argument list, is assumed to be the best match. For this purpose, the database is scaled per column between 0 and 1, on the basis of the minimum and maximum column value (only if minimum<maximum). If no match is found for Mode%=0 (complete match), an error message is issued and the session is terminated.
Examples
The function:
A = MATCHCASE(1,3,"XC","YC","ZC",2,6,13,1)
With in the Dataslot:
|MATCHCASE1|
0
3 "XC" "YC" "ZC"
"1" 1 9 10
"2" 2 8 11
"3" 3 7 12
"4" 4 6 13
"5" 5 5 14
"6" 6 4 15|
Results in: A=3. This means that case three has the smallest Euclidian distance with the dataset: 2,6,13.
Quick links: Functions overview | Attribute overview | Constants overview | Dimensions overview