Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

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.

New Articles From Microcontroller Tips

Back
Top