Load .mat file from anyfolder

6 次查看(过去 30 天)
I have to load .mat file from a folder in my workspace. Can anyone tell me how to do so?

采纳的回答

Mohammad Abouali
Mohammad Abouali 2015-12-8
编辑:Mohammad Abouali 2015-12-8
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 个)

类别

Help CenterFile Exchange 中查找有关 Workspace Variables and MAT-Files 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by