Error in parameter passing between two .m files (Error using feval and Error while evaluating uicontrol callback)
Mostrar comentarios más antiguos
Hello,
I am working on developing a GUI for a Digital down converter (DDC). DDC works well and I am creating a GUI which feeds inputs to the DDC and displays the frequency spectrum. In the GUI.fig there are two edit text boxes where I enter the frequency values and there is a run button which passes the parameters from GUI.m file to DDC_FILTER.m file. This works well when I run in matlab. Once I create this to executable and run the exe, it throws a error. After working on this I figured out this error might be due to passing parameters from GUI.m to DDC_FILTER.m. The errors are below
1) Error using feval
2) Error while evaluating uicontrol callback
3)Error in GUI_mainfcn
4)Error in pushbutton9_Callback
The code looks like this
IN THE FIG.M FILE
function pushbutton9_Callback(hObject, eventdata, handles)
fsvalue = str2num(get(handles.fs,'String'));
fpassvalue = str2num(get(handles.fpass,'String'));
[Tsample,Ts,Tfft,filt_sel1,cfir,pfir,reset,cfir_coef,cfir_wt] = ddc_filter(fsvalue,fpassvalue);
IN THE DDC_FILTER.M FILE
function [Tsample,Ts,Tfft,filt_sel1,cfir,pfir,reset,cfir_coef,cfir_wt] = ddc_filter(fsvalue,fpassvalue)
Fs = fsvalue;
Fpass = fpassvalue;
Any help would be appreciated.
Thanks
Vijay
Respuestas (2)
Walter Roberson
el 13 de Sept. de 2013
In the function that opens the .fig file, add the line
%#function pushbutton9_Callback
GUIDE codes references to GUI callbacks inside of strings where the compiler cannot find them, so the compiler does not know to link the callback function in.
1 comentario
Image Analyst
el 13 de Sept. de 2013
Vijay's "Answer" moved here as a comment:
Hello Walter,
Do I have to add this line here?
% --- Executes just before DDC is made visible.
function DDC_OpeningFc(hObject, eventdata, handles, varargin)
% Choose default command line output for DDC
handles.output = hObject;
Vijay
el 17 de Sept. de 2013
0 votos
Categorías
Más información sobre Entering Commands en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!