help to resolve my this GUI code

1 view (last 30 days)
Poonam on 16 Mar 2015
Answered: Sk Sahariyaz Zaman on 28 Apr 2016
labelPos=[left+3*controlWidth+0.06 top-2*controlHeight controlWidth+0.08 controlHeight-0.005];
callbackStr='mainGUI(''Enhancement '');';
This is the pushbutton function of enhancement of my Gui
set(hdl.figHandle_Axes3,'xlim',[.5, imgWidth+.5],'ylim',[.5 imgHeight+.5],'position',enhImgPosition);
set(get(hdl.figHandle_Axes1, 'Title'), 'String', 'Initial segmentation','visible','on');
set(hdl.enhImage, 'XData',[1 imgWidth],'YData',[1 imgHeight],'CData',enhImage);drawnow;
This code for displaying enhancement result on Gui
function Enhancement()
global orgImage;
global enhImage;
global filename0;
global enhResultFilename;
global bwenhancementtResultImage;
cd('.\segmentation results\');
[filename filepath]=uiputfile(segResultFilename,'Save enhancement result');
if filename(1) && ~isempty(bwenhancementtResultImage)
the enhanceImage(orgImage) is my m-file which I have create
But when clicking on the pushbutton I am getting followin error
??? Reference to non-existent field 'enhImage'.
Error in ==> mainGUI>LoadNewAVIFile at 326 set(hdl.enhImage, 'XData',[1 imgWidth],'YData',[1 imgHeight],'CData',enhImage);drawnow;
Error in ==> mainGUI>InitializeMSRMFig at 250 LoadNewAVIFile(figHandle);
Error in ==> mainGUI at 6 feval(action,varargin{:}); % call function
??? Invalid function name 'Enhancement '.
Error in ==> mainGUI at 6 feval(action,varargin{:}); % call function
??? Error while evaluating uicontrol Callback
>> why am i getting this error

Answers (1)

Sk Sahariyaz Zaman
Sk Sahariyaz Zaman on 28 Apr 2016
In deceleration also you need to write as "global enhImage;" then write - enhImage = enhanceImage(orgImage);
Hope this will solve your problem.

Community Treasure Hunt

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

Start Hunting!