How can I load variables in a .MAT file into the base workspace from a GUI in MATLAB 7.8 (R2009a)?

13 次查看(过去 30 天)
I am creating a GUI, and one of the features that I would like to include is the ability for a user to select and load a file into the base workspace in order to inspect the variables in the file.

采纳的回答

MathWorks Support Team
You can use the EVALIN function to load a .MAT file into the base workspace from a function. For example, you can place the following code in the callback function of a push button in your GUI:
filename = uigetfile('*.mat');
command = sprintf('load(''%s'')', filename);
evalin('base', command);

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Environment and Settings 的更多信息

产品


版本

R2009a

Community Treasure Hunt

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

Start Hunting!

Translated by