image thumbnail

Improved relativepath.m

version (2.18 KB) by Ken Chatfield
Convert a path to a relative path


Updated 11 Apr 2013

View License

Updated version of Jochen Lenz' relativepath.m for finding the relative path of a directory or filename relative to another (absolute) path.

The following improvements have been made over the original submission:

* More system agnostic – uses case-sensitive filenames when running under Linux/OSX
* Now supports input filenames as well as paths

Cite As

Ken Chatfield (2021). Improved relativepath.m (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2012b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Inspired by: relativepath.m

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!