workdir

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - CODING/DEVELOP
Introduced first in SolidGeometry 4.1, Creation date: 2017-08-04, Last change: 2025-09-14

changes to the working directory and/or defines it



See Also: desktopdir , pcodedirTL , smbFilename , smbPSLibname , matlabtoolboxdir , matlabdir

Example Illustration

 missing image of workdir (wd)

Syntax

workdir([wd])

Input Parameter

wd: working directory path




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 MATLAB function, workdir, is designed to manage the working directory for MATLAB scripts. It is part of the SolidGeometry library and was created by Tim Lueth. The function can change the current working directory and return information about it.

Input Parameters

Algorithm Steps

  1. Persistent Variable: The function uses a persistent variable wd to store the working directory path across multiple calls to the function.
  2. Input Handling: If an input argument is provided and is not empty, the function assigns this value to the persistent variable wd.
  3. Default Path: If wd is empty, it is set to a default path: '/Volumes/LUETH-WIN/WIN AIM Matlab Libraries/SolidGeometry-Code'.
  4. Change Directory: The function changes the current working directory to the path stored in wd using the cd command.
  5. Return Values: The function returns two values:
    • rwd: The current working directory path.
    • wdtext: A hyperlink string that can be used to open the directory in MATLAB by double-clicking.
  6. Output Display: If no output arguments are specified, the function prints a message indicating the directory change and opens the directory using the openbydoubleclick function.
Algorithm explaination created using ChatGPT on 2025-08-18 23:54. (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