unsortrows

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Auxiliary function
Introduced first in SolidGeometry 5.4, Creation date: 2023-11-03, Last change: 2025-09-15

swaps many different rows of a matrix

Description

same as ELunsort

See Also: ELunsort , unsortNaN , CPLunsort

Example Illustration

 missing image of unsortrows(A)

Syntax

A=unsortrows(A)

Input Parameter

A: Original matrix

Output Parameter

A: unosrted matrix, randomly exchnanged rows

Examples


A=sortrows(round(10*rand(10,4)),2), unsortrows(A)




Copyright 2023-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)

The function unsortrows is designed to randomly shuffle the rows of a given matrix. It is a part of the SG-Library and was introduced in SolidGeometry 5.4. The function relies on another function called ELunsort to perform the actual row shuffling.

Input Parameters

Output Results

Example

An example usage of the function is provided in the comments:

A = sortrows(round(10*rand(10,4)),2);
unsortrows(A);

In this example, a 10x4 matrix is generated with random values, sorted by the second column, and then passed to unsortrows to shuffle its rows.

Function Details

The function unsortrows is a simple wrapper around the ELunsort function. It takes a matrix A as input and directly calls ELunsort(A) to perform the row shuffling. The shuffled matrix is then returned as the output.

There are no switch conditions or additional parameters in this function. The primary operation is the delegation of the task to ELunsort, which is assumed to handle the randomization of the matrix rows.

Algorithm explaination created using ChatGPT on 2025-08-18 22:08. (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