Info

此问题已关闭。 请重新打开它进行编辑或回答。

How to: Get file in different functions

1 次查看(过去 30 天)
Hello kity
Hello kity 2012-12-28
关闭: MATLAB Answer Bot 2021-8-20
Hi,
in this menu i select a file.
function OpenMenuItem_Callback(hObject, eventdata, handles)
% hObject handle to OpenMenuItem (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
[filename, pathname] = uigetfile({'*.xls'},'File Selector');
i want that file(name) used in different m-files.
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
popup_sel_index = get(handles.popupmenu1, 'Value');
how do i get filename here????
switch popup_sel_index
case 1
AnotherMfile
end
so lets say
function AnotherMfile
what to type here to get filename??
[num, txt]=xlsread(filename);
end

回答(1 个)

Walter Roberson
Walter Roberson 2012-12-28

此问题已关闭。

Community Treasure Hunt

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

Start Hunting!

Translated by