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
2009년 9월 14일
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
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Environment and Settings에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!