Creating a Path to a sub folder

5 次查看(过去 30 天)
William Harris
William Harris 2020-4-2
回答: Rik 2020-4-2
I have created a loop that filters text files then plots them. I have a folder Raw_Data within the main folder, i am wanting this code to run without having to change the directory. This program works perfectly if the raw data subfolder is open but fails to load when not. Is their a way to create a relative path from the main folder so that the code can access the data sets in the raw data. The final line returns the error.
Thankyou.
List = uigetfile('*txt','MultiSelect','on')
mkdir('Filtered_Data')
for i=1:length(List);
filename=load(List{i});
  1 个评论
Rik
Rik 2020-4-2
Does this mean your previous question is no longer relevant?

请先登录,再进行评论。

回答(1 个)

Rik
Rik 2020-4-2
As mentioned in the documentation for uigetfile you can capture the path of the selected files as the second output.

类别

Help CenterFile Exchange 中查找有关 Search Path 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by