Code covered by the BSD License  

Highlights from
relativepath.m

4.8

4.8 | 6 ratings Rate this file 10 Downloads (last 30 days) File Size: 2 KB File ID: #3858

relativepath.m

by Jochen Lenz

 

14 Aug 2003 (Updated 18 Aug 2003)

Convert path representations.

| Watch this File

File Information
Description

RELATIVEPATH returns the relative path from an actual path to the target path.

Both arguments must be strings with absolute paths. The actual path is optional, if omitted the current dir is used instead. In case the volume drive letters don't match, an absolute path will be returned.

If a relative path is returned, it always starts with '.\' or '..\'
 
    Syntax:
       rel_path = RELATIVEPATH( target_path, actual_path )

MATLAB release MATLAB 6.0 (R12)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (7)
01 Nov 2005 Changshun Deng

very good! many thanks!

09 Feb 2010 Ano Nymous

worked fine, good examples

16 Apr 2011 David Zhang  
16 Apr 2011 David Zhang  
16 Apr 2011 David Zhang

works great on mac, does it also work on windows?

20 May 2011 Lukas  
06 Nov 2011 Igor

results in lowercase letters...

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
path Jochen Lenz 22 Oct 2008 07:06:32
directories Jochen Lenz 22 Oct 2008 07:06:32
files Jochen Lenz 22 Oct 2008 07:06:32
dir Jochen Lenz 22 Oct 2008 07:06:32
cd Jochen Lenz 22 Oct 2008 07:06:32
absolute Jochen Lenz 22 Oct 2008 07:06:32
relative Jochen Lenz 22 Oct 2008 07:06:32
convert Jochen Lenz 22 Oct 2008 07:06:32
absolute Marvin 18 Dec 2010 13:15:27
absolute David Zhang 15 Apr 2011 22:26:17
path David Zhang 15 Apr 2011 22:27:40
dir David Zhang 15 Apr 2011 22:27:51
relative David Zhang 15 Apr 2011 22:27:52
convert Rainer Saage 30 Jan 2012 13:43:44

Contact us at files@mathworks.com