Syntax
CPLU=CPLunsort(CPL)
Input Parameter
Output Parameter
CPLU : | | THe order of Conturs has changed |
Examples
CPLunsort(CPLsample(27))
Copyright 2021-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, CPLunsort
, is designed to change the order of contours in a Closed Polygon List (CPL) by using another function called unsortNaN
. It is primarily used for testing other functions like CPLregions
.
Input Parameters
- CPL: The original Closed Polygon List that you want to reorder.
Output Results
- CPLU: The reordered Closed Polygon List.
Algorithm Steps
- The function takes a Closed Polygon List (CPL) as input.
- It calls the function
unsortNaN
with the input CPL to reorder the contours. The result is stored in CPLU
.
- If no output argument is specified (i.e.,
nargout==0
), the function will generate a figure to visually compare the original and unsorted CPLs.
- The figure is set up with two subplots:
- The first subplot displays the original CPL using
CPLplotcwccw
and textCPL
to annotate it. The view is set to a top-down perspective with equal axis scaling and a grid.
- The second subplot displays the unsorted CPL in the same manner as the first subplot.
Example Usage
An example call to the function is CPLunsort(CPLsample(27))
, which would reorder the contours of the sample CPL with ID 27.
Algorithm explaination created using ChatGPT on 2025-08-18 23:10. (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