Load .mat file from anyfolder

6 vues (au cours des 30 derniers jours)
rihab
rihab le 8 Déc 2015
I have to load .mat file from a folder in my workspace. Can anyone tell me how to do so?

Réponse acceptée

Mohammad Abouali
Mohammad Abouali le 8 Déc 2015
Modifié(e) : Mohammad Abouali le 8 Déc 2015
load C:\myFolder\mySubFolder\myMatFile.mat
or
variableName= 'myVarName';
matfilePath = 'C:\myFolder\mySubFolder\myMatFile.mat';
data = load(matfilePath);
% to access the variable
data.(variableName);

Plus de réponses (0)

Catégories

En savoir plus sur Workspace Variables and MAT Files dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by