by Robin Schregle & Tim Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - CODING/DEVELOP
Introduced first in SolidGeometry 5.5, Creation date: 2025-06-30, Last change: 2025-08-18
fpath=SGlibpath
fpath: | filepath without filesep |
SGlibpath % Should work on mac and PC
This function, SGlibpath, is designed to return the file path of the toolbox directory in which it resides. It is a utility function for file handling, specifically within the SolidGeometry library.
The function SGlibpath does not take any input parameters. It is called without arguments.
fpath: This is the output of the function. It is a string representing the file path of the toolbox directory, without a trailing file separator.which command to determine the full path of a specific file, in this case, 'PLcircle'. The which function is a built-in MATLAB function that returns the full path to the specified file or function.which is stored in the variable fullpath.fileparts on fullpath. The fileparts function is another built-in MATLAB function that splits a full file path into its constituent parts: the path, the file name, and the file extension.fileparts function returns the directory path, which is stored in the variable fpath.fpath as the output, which is the directory path of the toolbox without a trailing file separator.To use the function, simply call SGlibpath in the MATLAB command window. It should work on both Mac and PC platforms:
SGlibpath
The function is related to other file handling functions such as desktopdir, pcodedirTL, smbFilename, smbPSLibname, expname, matlabtoolboxdir, and matlabdir.