findchangerow

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Auxiliary function
Introduced first in SolidGeometry 4.0, Creation date: 2017-07-24, Last change: 2025-09-14

returns in a list of succeding rows, when the row is different to its predecessor

Description

creates a change index list from any row list

See Also: mod1

Example Illustration

 missing image of findchangerow(c)

Syntax

[i,CIL]=findchangerow(c)

Input Parameter

c: list of succeeding rows

Output Parameter

i: index list
CIL: Change index list

Examples


[a,b]=findchangerow([1 2 3 4 5 5 6 1]')




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 algorithm is designed to identify changes in a list of succeeding rows. It returns an index list and a change index list, indicating where changes occur between consecutive rows.

Input Parameters

Output Results

Algorithm Steps

  1. Determine the number of rows n in the input matrix c.
  2. Initialize a logical array i of size n with false values.
  3. Create a circularly shifted version of c called cc, which shifts the rows by one position.
  4. Iterate over each row k from 1 to n:
  5. Find the indices a where i is true.
  6. Calculate the change index list CIL using the indices a and the function mod1 to handle circular indexing.
  7. If CIL is empty, set CIL to [1 n] to indicate no changes.

This algorithm is useful for detecting changes in sequences of data, such as time series or ordered lists, where identifying transitions or differences is important.

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