Effacer les filtres
Effacer les filtres

can anyone fix this issue?

1 vue (au cours des 30 derniers jours)
sana saleeme
sana saleeme le 1 Mai 2016
gui_mainfcn(gui_State, varargin{:});
Error in @(hObject,eventdata)plz('pushbutton1_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating UIControl Callback
and my code is
function varargout = plz(varargin)
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @plz_OpeningFcn, ...
'gui_OutputFcn', @plz_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
% --- Executes just before plz is made visible.
function plz_OpeningFcn(hObject, eventdata, handles, varargin)
% Choose default command line output for plz
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes plz wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = plz_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Get default command line output from handles structure
varargout{1} = handles.output;
% --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
[c, d] = uigetfile({'*.*' , 'all files'});
imj = imread([c , d]);
s = imshow(imj , 'parent' , handles.axes1);
imshow(s);
  1 commentaire
sana saleeme
sana saleeme le 1 Mai 2016
i want to browse an image it browse image but don't show

Connectez-vous pour commenter.

Réponse acceptée

Walter Roberson
Walter Roberson le 1 Mai 2016
The order of outputs from uigetfile is file name first and then directory. Your use of [c , d] has the components in the wrong order.
What you should use instead of [c, d] is fullfile(d, c)
filename = fullfile(d, c);
imj = imread(filename);
  2 commentaires
sana saleeme
sana saleeme le 1 Mai 2016
Walter Roberson kindly give your email please
Walter Roberson
Walter Roberson le 1 Mai 2016
I do not answer much of my email. I respond more to posted questions.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Migrate GUIDE Apps dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by