Clear Filters
Clear Filters

how to call mfile function from gui?i have input image in one call back which i need to pass to the function in mfile....function call should be in another callback..

2 views (last 30 days)
function pushbutton2_Callback(hObject, eventdata, handles)
ention(handles.A,S,S1,S2,S3,S4,S5,S6) ;
function pushbutton1_Callback(hObject, eventdata, handles)
[file path]=uigetfile('*.jpg','Select any image');
chosenfile=[path file];
handles.A=imread(chosenfile);
global img
img=imread(chosenfile);
imshow(img);
%S values are values got from user using popmenu(7)
function popupmenu1_Callback(hObject, eventdata, handles)
global S
k= get(hObject,'String');
s=k{get(hObject,'Value')};
S=str2num(s);
i cant call my en function by passing those values along with img..i have also tried with handles.A or handles.S...
help me out..
error is
Reference to non-existent field 'A'.
Error in ==> d>pushbutton2_Callback at 140
ention(handles.A,S,S1,S2,S3,S4,S5,S6) ;
Error in ==> gui_mainfcn at 96
feval(varargin{:});
Error in ==> d at 42
gui_mainfcn(gui_State, varargin{:});
??? Error while evaluating uicontrol Callback

Answers (1)

Walter Roberson
Walter Roberson on 23 Mar 2014

Categories

Find more on Interactive Control and Callbacks in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!