flipvar

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Auxiliary function
Introduced first in SolidGeometry 1.1, Creation date: 2013-09-21, Last change: 2025-09-14

returns two flipped variable

Description

Attention, the order of variables change between input and output

See Also: ELunsort , ELsort

Example Illustration

 missing image of flipvar(a,b)

Syntax

[b,a]=flipvar(a,b)

Input Parameter

a: Variable A
b: Variable B

Output Parameter

b: Variable B
a: Variable B

Examples

a=4; b=5; [b,a]=flipvar(a,b)



Copyright 2013-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, flipvar, is a simple utility designed to swap the values of two input variables. It is part of the SolidGeometry library and was introduced in version 1.1. The function is authored by Tim Lueth and is categorized under auxiliary procedures.

Input Parameters

Output Results

Algorithm Explanation

The function flipvar operates by temporarily storing the value of the first input variable, a, in a temporary variable x. It then assigns the value of the second input variable, b, to a. Finally, it assigns the value stored in x (originally from a) to b. This effectively swaps the values of a and b.

Example

Consider the following example where a = 4 and b = 5. After calling [b,a] = flipvar(a,b), the values will be swapped such that b = 4 and a = 5.

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