Work with data just in selected paths

Hello together,
I have special folder with data (ex.):
FilePath1 = '/home/user/workspace/QT/Software_2.0_QT/IO/Motor_Set_1/AKG_C1000S/Distance_0.5m/Scenario_M1/001_m1_60_const_20200611_200515'
FilePath2 = '/home/user/workspace/QT/Software_2.0_QT/IO/Motor_Set_1/AKG_C1000S/Distance_0.5m/Scenario_M1/002_m2_60_const_20200811_200411'
inside are different .mat files.
I want calculate data with just this two paths.
addpath(Filepath1);
and
addpath(Filepath2);
are not working. And if my current MATLAB folder
'/home/user/workspace/QT/Software_2.0_QT/IO/Motor_Set_1/AKG_C1000S/Distance_0.5m/Scenario_M1'
MATLAB starting to work with all foler inside:
001, 002,003,...030.
And i want just 001 and 002
How can I choose and lock my working folder?
Thank you!

Respuestas (1)

Aditya Verma
Aditya Verma el 24 de Jun. de 2020

0 votos

Hi!
Could you check in the lists of all search paths if you have accidently added those subfolders? You can check it using the 'Set path' dialogue box. Find it in the Home tab, in the Environment section.
Using the same dialogue box you can add or remove the folders you want.
Thanks

6 comentarios

Hello, yes, thank you, i tried it allready.
The problem is - for example, I have in one Folder, three subfolder - 001, 002, 003
I do, addpath(001) and addpath(003) (without adding 002) and than want find and analyse all mat.file from folder in subfolder 001 and subfolder 003. And MATLAB still find 002 and show me an error:
Error using load
'002.mat' is not found in the
current folder or on the MATLAB path, but exists in:
/home/user/workspace/QT/Software_2.0_QT/IO/Motor_Set_1/AKG_C1000S/Distance_0.5m/Scenario_M1/002_m1_30_90_triangles_20200611_200554/SNR_F1
Change the MATLAB current folder or add its folder to the MATLAB path.
Error in analysis_algorithms_23_06_20 (line 41)
load(file_name)
How can I avoid this?
Aditya Verma
Aditya Verma el 24 de Jun. de 2020
What is the exact command you are using to load the files?
load(file_name)
file_name =
'001_m1_60_const_20200611_200515_SNR_019_PLL.mat'
Aditya Verma
Aditya Verma el 24 de Jun. de 2020
Okay, so the way it works is that it checks all the paths for the file specified in load command. If the file is not found, then only it gives an error, which is expected behaviour. Here, in this case it also gives a suggestion along with that error.
Aditya Verma
Aditya Verma el 24 de Jun. de 2020
I still don't understand what you want to acheive. Do you want to suppress the error?
Nik Rocky
Nik Rocky el 24 de Jun. de 2020
I want to compare mat.file from subfolder 001 with mat.file from subfolder 003.
All subfolders are in one same folder.
I would prefer to write in a code:
load data x from folder 001
load data y from folder 003
compare x and y

La pregunta está cerrada.

Etiquetas

Preguntada:

el 24 de Jun. de 2020

Cerrada:

el 20 de Ag. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by