Truble with LOAD in GUI
2 次查看(过去 30 天)
显示 更早的评论
Hi, I have problem with loading variables to worksapace using GUI. What I want to do is that when I press the button, open dialog pops up and I select *.mat file, which I created earlier. To this point everything works fine. Name of the file is assigned to a variable. After that I do not realy know what to do. I know, that I simply cannot use load(variable). But even if I tried some modification with assignin and evalin, I sitll can get those variables stored in *.mat file to workspace.
Here is the CallBack function:
function open_menubutton_callback(u,t)
file = uigetfile('*.mat')
load(file,'*.mat')
Any sugestions, what should I add or change?
0 个评论
采纳的回答
Orion
2014-12-18
Hi,
one suggestion :
[FileName,PathName] = uigetfile('*.mat');
evalin('base',sprintf('load(''%s'')',fullfile(PathName,FileName)))
更多回答(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!