Azzera filtri
Azzera filtri

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

3 visualizzazioni (ultimi 30 giorni)
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';

Risposta accettata

Stephen23
Stephen23 il 22 Lug 2023
Modificato: Stephen23 il 22 Lug 2023
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?:

Più risposte (1)

Bruno Luong
Bruno Luong il 22 Lug 2023
Modificato: Bruno Luong il 22 Lug 2023
folder = 'C:\Users\Desktop\folder_test';
file = 'test.mat';
load([folder filesep() file])

Categorie

Scopri di più su File Operations in Help Center e File Exchange

Prodotti


Release

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by