Why am I unable to open a file that contains two periods in its name using the FOPEN function in MATLAB 7.0 (R14)?

2 views (last 30 days)
I have a file named "a.b.txt" in my $MATLAB\work directory (where $MATLAB is the MATLAB root directory on my machine), as returned by typing
matlabroot
at the MATLAB command prompt.)
When I am in this directory, the following command:
fopen('a.b.txt')
works correctly. However, when I am in a different directory, the file is not found, and the command:
cd ..
fopen('a.b.txt')
does not open the file. The same steps open the file correctly in MATLAB 6.5.1 (R13SP1).

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
This bug has been fixed in Release 14 Service Pack 3 (R14SP3). For previous product releases, read below for any possible workarounds:
We have verified that there is a bug in the way that the FOPEN function in MATLAB 7.0 (R14) handles file names with more than one period.
As a workaround, specify the entire path to the file. For example, use:
fopen([matlabroot, '\work\a.b.txt'])

More Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!