Error in path, although it "exists"

Dear Mathworks,
I am running some code that worked fine under r2017a, but now I am on the prerelease 2019a. I want to load a file from a starting directory, that tests OK with "exist", but when I use uigetfile, I get an error message. Any idea? /Claes Olsson
K>> [fNames, fPath, filterNdx] = uigetfile(...
{'*.raw', 'Bruker *.raw v.3'; ...
'*.brml', 'Bruker *.brml'; ...
'*.*', 'All Files'}, ...
'Open *.raw File', ...
'G:\Department\SF\Measurement\SESPC16337\2019\1jan\', 'MultiSelect', 'on');
Error using matlab.ui.internal.dialog.FileSystemChooser/PathParser (line 87)
Invalid directory to operate on
Error in matlab.ui.internal.dialog.FileSystemChooser/set.InitialPathName (line 32)
iPath = PathParser(obj,iPath);
Error in uigetputfile_helper (line 52)
ufd.InitialPathName = dialog_pathname;
Error in uigetfile (line 130)
[filename, pathname, filterindex] = uigetputfile_helper(0, varargin{:});
K>> exist('G:\Department\SF\Measurement\SESPC16337\2019\1jan\')
ans =
7
K>> ver
-----------------------------------------------------------------------------------------------------
MATLAB Version: 9.6.0.1011450 (R2019a) Prerelease
MATLAB License Number: Prerelease
Operating System: Microsoft Windows 10 Enterprise Version 10.0 (Build 17134)
Java Version: Java 1.8.0_181-b13 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
-----------------------------------------------------------------------------------------------------
MATLAB Version 9.6 (R2019a)
Image Processing Toolbox Version 11.0 (R2019a)
MATLAB Compiler Version 7.0.1 (R2019a)
Optimization Toolbox Version 8.3 (R2019a)

4 Comments

Prerelease 2019a? Why don't you use the final release instead?
At the time the question was asked (January 2019) the final release of R2019a was not avaiable.
But why was the question raised now?
My guess is that someone posted a spam answer or comment (which made this question one of the "Most recently updated" items) and then that spam was deleted.

Sign in to comment.

Answers (1)

Hi Claes,
This works perfectly fine in the final release of MATLAB R2019a. However, I found one mistake in the code shared, the extensions to filter the files should be separated by semi-colon instead of a comma. Given below is the updated code:
[fNames, fPath, filterNdx] = uigetfile(...
{'*.raw'; 'Bruker *.raw v.3'; ...
'*.brml'; 'Bruker *.brml'; ...
'*.*'; 'All Files'}, ...
'Open *.raw File', ...
'G:\Department\SF\Measurement\SESPC16337\2019\1jan\', 'MultiSelect', 'on');
If the issue persists for you, please contact MathWorks Technical Support at: https://www.mathworks.com/support/contact_us.html

Categories

Find more on MATLAB Compiler in Help Center and File Exchange

Products

Release

R2018b

Asked:

on 24 Jan 2019

Answered:

on 3 Jan 2025

Community Treasure Hunt

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

Start Hunting!