When using fullfile() on Windows, it outputs the path of a file with the backslash (\) as delimiter. If the output is then passed as a format specifier to a function like sprintf (or compose), it runs into error, e.g. sprintf(fullfile('folder', '%d'), nr), because it interprets the blackslash as an escape character.
This function deals with the issue by adjoining file parts using the forward slash (/) as delimiter.
Valerio Rubino (2021). Join fileparts (https://www.mathworks.com/matlabcentral/fileexchange/90476-join-fileparts), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform CompatibilityWindows macOS Linux
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!