push button (matlab gui) help!

Status
Not open for further replies.

kingh12

New Member
Hello, I have a problem with matlab gui. I use a push button to get a file and I want to open it using another push button but I couldn't do that. The code is;

function open_Callback(hObject, eventdata, handles)
% hObject handle to open (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
[dosyaadi,dosyayolu]=uigetfile('name.mid','Select a file');
if dosyaadi==0
return
end
nmat=readmidi_java(fullfile(dosyayolu,dosyaadi));
handles.nmat=nmat;
guidata(hObject,handles);
dosyaadi


Until that, everything is ok. I just want to use "dosyaadi" ,which is the original name of nmat, in another push button with the function 'system' but it didn't work. This is very normal because I didn't define what 'dosyaadi' is in that push button. How can I do that? I am new at matlab GUI, so I need a help!

function listen_Callback(hObject, eventdata, handles)
% hObject handle to listen (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
nmat=handles.nmat;
system(dosyaadi);
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…