Syntax
PL=woNaN(PL)
Input Parameter
PL : | | vector row list containing NaN |
Output Parameter
PL : | | vector row list without NaN |
Examples
Shows the effect for closed polygon lines
PL=PLofCPL([PLcircle(5);NaN NaN;PLcircle(3)])
SGfigure(0,90);
CPLplot(PL,'r-',2);
CPLplot(woNaN(PL),'b-');
Copyright 2017-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 function, woNaN
, is designed to process a vector row list, PL
, which may contain NaN
values. The primary goal is to remove any rows from PL
that have a NaN
in the first column, returning a cleaned list, NPL
.
Input Parameters
- PL: A vector row list that may contain
NaN
values. It is expected that NaN
values are used to separate polygons in the list.
Output Results
- NPL: A vector row list with all rows containing
NaN
in the first column removed.
- ii: A logical index vector indicating which rows of
PL
were retained in NPL
.
Algorithm Steps
- Check if the input
PL
is empty. If it is, return an empty NPL
and exit the function.
- Create a logical index vector
ii
that identifies rows in PL
where the first column is not NaN
.
- Use this index vector
ii
to filter PL
, creating NPL
which contains only the rows without NaN
in the first column.
- If no output arguments are specified, the function would plot the original and cleaned data for visualization, but this part is commented out in the code.
The function is useful in scenarios where NaN
values are used to separate polygons in a list, and these need to be removed for further processing, such as triangulation.
Algorithm explaination created using ChatGPT on 2025-08-19 01:16. (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