You can pass the image path to the GUI through the Matlab command line, and use that path in the _OpeningFcn of your Guide GUI. In the example below I simply display the input string in a text box. Do take into account absence of any inputs as well.
% --- Executes just before GuiWithInput is made visible.
function GuiWithInput_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to GuiWithInput (see VARARGIN)
% Choose default command line output for GuiWithInput
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
if(numel(varargin))
TextToDisplay = varargin{1};
else
TextToDisplay = 'Dummy String to be displayed!';
end
set( handles.edit1, 'String', TextToDisplay);
The varargin variable in the _OpeningFcn function, contains the command line inputs supplied to the GUI by the user. It is of type cell array, with each cell containing inputs supplied.
Assuming the call to your GUI is,
GUI_Name( 'input1', 2, [ 2; 4; 6])
you can access those inputs in the _OpeningFcn using:
varargin{1} % contains a string 'input1'
varargin{2} % contains a double with value 2
varargin{3} % contains a numeric column array with value [ 2; 4; 6]