Syntax
[CPLU,ai]=uniqueNaN(CPL)
Input Parameter
CPL : | | Original NaN sperated list |
Output Parameter
CPLU : | | Reduced Nan separted list with unique entries |
ai : | | indes list for |
Examples
CPL=[CPLsample(13);nan nan;CPLsample(13)]
[a,b]=uniqueNaN(CPL)
Copyright 2019-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth
Algorithm (Workflow)
This algorithm is designed to process a list separated by NaN values, identifying unique sublists within it. The function uniqueNaN
takes a NaN-separated list as input and returns a reduced list with unique entries, along with an index list.
Input Parameters
- CPL: The original list separated by NaN values. This list is processed to identify unique sublists.
Output Results
- CPLU: A reduced version of the input list, containing only unique sublists separated by NaN.
- ai: An index list indicating the position of each unique sublist in the original list.
Algorithm Steps
- Determine the number of sublists in
CPL
using the function separateNaN
, which counts the segments separated by NaN.
- Initialize the list
ul
with the first sublist index and ai
with NaN values, setting the first index to 1.
- Iterate over each sublist in
CPL
starting from the second one:
- For each sublist, compare it with the sublists already identified as unique using
selectNaN
and isequal
.
- If a match is found, update
ai
with the index of the matching unique sublist and break the loop.
- If no match is found, add the current sublist index to
ul
and update ai
with the new unique index.
- After processing all sublists, use
selectNaN
to extract the unique sublists from CPL
based on the indices in ul
.
The function effectively reduces the input list to its unique components, providing a streamlined version of the data for further analysis or processing.
Algorithm explaination created using ChatGPT on 2025-08-18 23:58. (Please note: No guarantee for the correctness of this explanation)
Last html export of this page out of FM database by TL: 2025-09-21