Syntax
[fp,fn,fe]=lastuidir
Output Parameter
fp : | | file path plus filesep |
fn : | | file name |
fe : | | file extension |
Copyright 2021-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, lastuidir
, is designed to retrieve the file path, file name, and file extension of the last file opened in the MATLAB editor using the uiopen
function. It is part of the SolidGeometry library and was introduced in version 5.0.
Input Parameters
The function does not take any input parameters. It operates based on the internal state of the MATLAB environment, specifically the history of files opened using uiopen
.
Output Parameters
fp
: The file path including the file separator at the end.
fn
: The file name without the path or extension.
fe
: The file extension.
Algorithm Steps
- The function calls
HxSearch
with the string 'uiopen('
to search for occurrences of files opened using uiopen
. The search is limited to the most recent occurrence by specifying the last parameter as 1
.
- If multiple results are found, the function selects the last entry using
text(end,:)
.
- The function locates the position in the string where the file path starts by searching for
'uiopen(''
and adjusts the index accordingly.
- It then extracts the substring containing the file path and name by finding the position of the closing
''
before ',1)'
.
- The
fileparts
function is used to split the extracted string into the file path, name, and extension.
- The file path is concatenated with the file separator to ensure it ends with a separator.
Algorithm explaination created using ChatGPT on 2025-08-18 23:01. (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