Syntax
CL=CLsortrows(CL)
Input Parameter
Output Parameter
CL : | | Sorted Correlation list |
Examples
[SG,FLW]=SGofCPLz(PLcircle(10,10),20); CL=CLofFLW(FLW), [PLA,PLNB]=PLofCL(CL);
CLN=ELunsort(CL), CLsortrows(CL)
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, CLsortrows
, is designed to sort a correlation list (CL) and is part of the SolidGeometry library. Below is a detailed explanation of the algorithm and its parameters:
Input Parameters
- CL: A correlation list, which is a matrix where each row represents a correlation between two elements.
Output
- CL: The sorted correlation list.
Algorithm Steps
- The function begins by sorting the rows of the input correlation list
CL
using the sortrows
function. This function sorts the rows of a matrix based on the values in the columns, starting with the first column.
- It then identifies the indices of rows where the first column has the value 1 using
find(CL(:,1)==1)
and stores these indices in i1
.
- Similarly, it finds the indices of rows where the first column has the value 2 using
find(CL(:,1)==2)
and stores these indices in i2
.
- The algorithm checks if the second column value of the last row in
i1
is greater than the second column value of the first row in i2
. If this condition is true, it swaps the second column values of the first and last rows in i1
using the flipvar
function.
- If there are no output arguments (
nargout==0
), the function calls PLcorrelationcheck(CL)
to perform a correlation check and CLplot(CL)
to plot the correlation list.
Additional Notes
The function is part of a library for handling closed polygon lists and is used in conjunction with other functions like CLofFLW
, PLcorrelationcheck
, and CLplot
.
Algorithm explaination created using ChatGPT on 2025-08-18 23:13. (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