Error in path, although it "exists"

10 ビュー (過去 30 日間)
Claes Olsson
Claes Olsson 2019 年 1 月 24 日
回答済み: Yash 2025 年 1 月 3 日
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 件のコメント
Jan
Jan 2022 年 12 月 18 日
But why was the question raised now?
Steven Lord
Steven Lord 2022 年 12 月 18 日
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.

サインインしてコメントする。

回答 (1 件)

Yash
Yash 2025 年 1 月 3 日
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

カテゴリ

Help Center および File ExchangeMATLAB Compiler についてさらに検索

タグ

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by