Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Matlab gui problem, Plz tell me whats wrong

Status
Not open for further replies.

dashkil

Member level 2
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.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top