Error in path, although it "exists"

10 vues (au cours des 30 derniers jours)
Claes Olsson
Claes Olsson le 24 Jan 2019
Réponse apportée : Yash le 3 Jan 2025
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 commentaires
Jan
Jan le 18 Déc 2022
But why was the question raised now?
Steven Lord
Steven Lord le 18 Déc 2022
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.

Connectez-vous pour commenter.

Réponses (1)

Yash
Yash le 3 Jan 2025
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

Catégories

En savoir plus sur MATLAB Compiler dans Help Center et File Exchange

Produits


Version

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by