0
votes

can anyone help me? I have a loop as follows:

global im2
axes(handles.axes4);

for i= 1:40

cd(strcat('C:\Users\JerryFarla\Desktop\images test\yale faces\ImageZ\',num2str(i)));
c = imread('1 (1).jpg');

%subplot(222)  
axes(handles.axes4)
imshow(c);

set(handles.image_number,'String',strcat('Processed now --->',num2str(i)))   

end
img=imread('C:\Users\JerryFarla\Desktop\images test\yale faces\ImageZ\1 (*).jpg');
a=img;
axes(handles.axes5)
imshow(img)

my issue is that it gives me the error

??? Reference to non-existent field 'image_number'.

Error in ==> testgui1>pushbutton2_Callback at 270 set(handles.image_number,'String',strcat('Processed now --->',num2str(i)))

Is the error due to my version of matlab (i'm using the R2011a version)? If yes, is there any function with the same purpose in this version of matlab?

1
Does the handles structure have a field named image_number before the set command is executed? - Tomáš Kratochvíla
You could take a look at the following answer: mathworks.com/matlabcentral/answers/… - Tomáš Kratochvíla
The issue is that you don't have an image_number field in handles - Suever

1 Answers

0
votes

Your GUI need to have a uicontrol or a member of name "image_number". You probably don't have this control as part of GUI. If your intention is to create a control named "image_number" dynamically, use function "uicontrol" to do so.

The issue is not due to MATLAB version R2011A.