Importing .mat files on a mac
15 ビュー (過去 30 日間)
古いコメントを表示
Currently i have a large file from SignalCalc that has 54 sub trials in it. For each trial subfolder under the main lab folder there is a matlab folder from which i want to extract the .mat file and a specific variable from that file. As best as a can show in a folder path would be (main folder/ sub folders for the trial/ matlab/ .mat file)
Here is the code im currently trying to use to extract it but unsure why its not working. I get an error regarding cd([dir '/MATLAB/']) that says name is non existant or not a directory.
The main file (Group A - Lab 3) is in my downloads file. THis is the specific error message.
Error using cd
Cannot CD to /Users/BradensMac/Downloads/Group A - Lab 3/Run00001/MATLAB/ (Name is nonexistent or
not a directory).
Error in thirdlab (line 6)
dir = [Labdir '/Run000' Num1]; cd([dir '/MATLAB/'])
done = 0;
Labdir = '/Users/BradensMac/Downloads/Group A - Lab 3';
while done == 0
Num1 = input('Input the run ID of less damped case in single quotes (i.e. ''01'')');
dir = [Labdir '/Run000' Num1];
cd([dir '/MATLAB/'])
load('DPsv00001.mat', 'X1')
done = input('Input 0 to keep uploading, or 1 to finish');
end
2 件のコメント
Fabio Freschi
2019 年 10 月 28 日
Do you have a /Users/BradensMac/Downloads/Group A - Lab 3/Run00001/MATLAB/ directory? What happens if you type
cd /Users/BradensMac/Downloads/Group A - Lab 3/Run00001/MATLAB/
in Mac terminal?
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で File Operations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!