Resolves relative paths and extra filesep characters in the input.
Syntax:
OUTPUT = REALPATH(THEPATH)
where THEPATH is the path to a file or folder, which should exist.
Example:
realpath('../myfile.txt');
% returns /home/user/whatever/myfile.txt
Cite As
M MA (2026). realpath (https://in.mathworks.com/matlabcentral/fileexchange/8680-realpath), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R12
Compatible with any release
Platform Compatibility
Windows macOS LinuxCategories
Find more on Filename Construction in Help Center and MATLAB Answers
Tags
Acknowledgements
Inspired: realpath
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
| Version | Published | Release Notes | |
|---|---|---|---|
| 1.0.0.0 |
