MATLAB: How to create stable axes on matlab gui

axes image gui show stable

I have created a matlab gui panel which is usefull for product configuration. I have too many tabs and in every tab I have some choises with pictures.in first step everything looks perfectly fine. But as you can see in the attachments when I restarted the program gui don't shows the images.. After I've been sure again to everything is o.k. (I click every CreateFcn of every axes) It works again. but only till the next restart. What am I doing wrong?
I write images code in axes_CreateFcn title, for exapmle;
function axes_Elektrischer_a_CreateFcn(hObject, eventdata, handles)
imshow(imread('C:\Users\***\Desktop\akbnamen\bilder\Elektrischer_a.png'));
set(hObject,'tag','axes_Elektrischer_a')
function axes_Elektrischer_b_CreateFcn(hObject, eventdata, handles)
imshow(imread('C:\Users\***\Desktop\akbnamen\bilder\Elektrischer_b.png'));
set(hObject,'tag','axes_Elektrischer_b')

Best Answer

fatih - You can specify the parent axes as a parameter to imshow (see imshow name value pairs for details). In your case, you would do something like the following in your OpeningFcn:
imshow(imread('C:\Users\***\Desktop\akbnamen\bilder\Elektrischer_a.png'), 'Parent', handles.axes_Elektrischer_a);
imshow(imread('C:\Users\***\Desktop\akbnamen\bilder\Elektrischer_b.png'), 'Parent', handles.axes_Elektrischer_b);
You don't need to set the Tag of the axes as that should already be set with the name of the axes.