Load a file from a different folder

7 ビュー (過去 30 日間)
Jasper Mark
Jasper Mark 2021 年 1 月 25 日
コメント済み: Titus Edelhofer 2021 年 1 月 26 日
I am having difficulty loading a file from a different folder. The data is currently stored in a network server. I currently have a workaround by bringing the file of interest ot my matlab specific folder and using this code.
cfg = [];
[FileName] = uipickfile('.mff');
cfg.dataset = FileName;
data = ft_preprocessing(cfg);
Is there anyway to load my file of interest without having to drag it to the matlab folder. I will be working with about 1250 files and would like to save the storage on my device?
  1 件のコメント
Stephen23
Stephen23 2021 年 1 月 25 日
Do you mean the third-party function uipickfiles (with an s at the end):

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

回答 (1 件)

Titus Edelhofer
Titus Edelhofer 2021 年 1 月 25 日
Hi Jasper,
I don't know where uipickfile comes from. If you use uigetfile, you would have a second output argument you can use:
[filename,pathname] = uigetfile('*.mff');
cfg.dataset = fullfile(pathname,filename);
Titus
  2 件のコメント
Jasper Mark
Jasper Mark 2021 年 1 月 25 日
Thank you for the suggestion. I have used the uigetfile function in previous versions of the script and was left with the same problem. I tried that again...with no sucess :/. I imagine there may be a problem with how the secure network server is set up
Titus Edelhofer
Titus Edelhofer 2021 年 1 月 26 日
Hi Jasper,
I'm not not sure where the problem is, reading the file or locating the file.
  • Did you try using the full path (with fullfile)?
  • Did you try simply putting the fully qualified file name (without interactive selection), something like
cfg.dataset = '\\mynetworkfolder\mymfffile.mff';
If yes to either of them, what's the error you see?
Titus

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

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by