フィルターのクリア

import to the workspace a .mat file saved in a folder other than pwd

3 ビュー (過去 30 日間)
Alberto Acri
Alberto Acri 2023 年 7 月 22 日
編集済み: Stephen23 2023 年 7 月 22 日
How can I import a .mat file saved in a folder other than pwd to the workspace?
folder = 'C:\Users\Desktop\folder_test';
file = 'test.mat';

採用された回答

Stephen23
Stephen23 2023 年 7 月 22 日
編集済み: Stephen23 2023 年 7 月 22 日
The recommended approach is to use FULLFILE (and to always LOAD into an output variable):
S = load(fullfile(folder,file))
Why do you imagine that this has changed since last time you asked how to define path strings?:

その他の回答 (1 件)

Bruno Luong
Bruno Luong 2023 年 7 月 22 日
編集済み: Bruno Luong 2023 年 7 月 22 日
folder = 'C:\Users\Desktop\folder_test';
file = 'test.mat';
load([folder filesep() file])

カテゴリ

Help Center および File ExchangeFile Operations についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by