Load .mat file from anyfolder
6 views (last 30 days)
Show older comments
I have to load .mat file from a folder in my workspace. Can anyone tell me how to do so?
0 Comments
Accepted Answer
Mohammad Abouali
on 8 Dec 2015
Edited: Mohammad Abouali
on 8 Dec 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);
0 Comments
More Answers (0)
See Also
Categories
Find more on Workspace Variables and MAT Files in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!