dirup

Get the relative path string to go up a number of levels in the directory structure.

You are now following this Submission

This is a very simple function to obtain the relative path string to go up a number of levels in the directory structure, starting from the current working directory.

As the filesep() function is used to generate the (relative) path string, this function works equally well on Unix-based and Windows machines.

Cite As

Karl (2026). dirup (https://www.mathworks.com/matlabcentral/fileexchange/41674-dirup), MATLAB Central File Exchange. Retrieved .

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.0.0.0