sortNEV
This function extracts information out of a structure based on the field
values. The outputs can be the sorted structure and the indeces of those
extracted fields.
Use [SortedStruct, SortedIndeces] = sortNEV(STRUCT, field, TestValue, Report)
STRUCT: The structure to be used for extraction.
field: The field in STRUCT that is set as criteria for extraction.
This parameter is optional. If not passed, the function
will prompt the user to provide the name of the field.
TestValue: The value that "field" needs to be equal to in order to
get extracted.
This parameter is optional. If not passed, the function
will prompt the user to provide the value.
Report: If this flag is set to 1 the function will show a short
summary of the data that was processed.
This parametere is optional.
DEFAULT: will not show report.
OUTPUT
SortedStruct: The sorted structure output.
SortedIndeces: The indeces to the sorted elements.
Example:
[NewStruct, Indeces] = sortNEV(MainStruct, 'TestField', 3, 1);
In the example above, the MainStruct is the structure containing all
elements. The function will search through MainStruct and extract all
elements that have their 'TestField' field set to '3'. It will also
show a report of how many elemenets were processed and how many were
extracted.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Kian Torab
ktorab@blackrockmicro.com
Blackrock Microsystems
Version 1.4.1.0
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%