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
- wd: This is an optional input parameter representing the path to the desired working directory. If provided, the function will change the current working directory to this path.
Algorithm Steps
- Persistent Variable: The function uses a persistent variable
wd
to store the working directory path across multiple calls to the function.
- Input Handling: If an input argument is provided and is not empty, the function assigns this value to the persistent variable
wd
.
- Default Path: If
wd
is empty, it is set to a default path: '/Volumes/LUETH-WIN/WIN AIM Matlab Libraries/SolidGeometry-Code'
.
- Change Directory: The function changes the current working directory to the path stored in
wd
using the cd
command.
- 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.
- 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