Matlab gui problem, Plz tell me whats wrong

Status
Not open for further replies.

dashkil

Member level 2
Joined
Mar 3, 2012
Messages
45
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,286
Visit site
Activity points
1,620
here is my code;

Plz tell me whats wrong: I am new to GUI (programming); i want to load a "net0" named variable and use it in other callback function "Rcrd_and_Recog".

Note: i am not using GUIDE GUI; using programming GUI.

Code:
function ASR()

figure('Name','Automatic Isolated Speech Rcognition System',.......
       'Menubar','none',........
       'Color',[1 1 1]);

     Rcrd_and_Recog =uicontrol('Style','pushbutton',....
                               'Units','normalized',....
                               'Position',[0.75 0.75 0.20 0.05],....
                               'String','START',....
                               'Callback',@Record_Recog);

             LD_net = uicontrol('Style','pushbutton',....
                                'Units','normalized',....
                                'Position',[0.75 0.65 0.20 0.05],....
                                'String','LOAD THE NET',....
                                'Callback',@load_net);

     function load_net(varargin)

               [file path]=uigetfile('*.mat','Select the M-file');
               if ~isequal(file, 0)
               L=load(fullfile(path,file));
               Net=fieldnames(L);
               net=Net{1};
               handles.net=net;
               end 
     function Record_Recog(varargin)
             fs=16000;
             y=wavrecord(1*fs,fs,1,'double');

             if length(y)<1157
                result=sim(net0,cat(1,y,zeros(1157-length(y),1)))
             else
                result=sim(net0,y)
             end

     end
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…