How to correcty set this error??
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Hi everybody!! I have to set an error when I read a file.
My error box has to appear when users press "Load" before choosing the file.
I tried lots of combinations, but it doesn't work... It only shows me a textread error like:
??? Error using ==> textread at 167
File not found.
Error in ==> E1_Amm_IT>PB_Carica_Callback at 202
[anno azienda istituto disciplina_dimissione prog_reparto ...
Error in ==> gui_mainfcn at 96
feval(varargin{:});
Error in ==> E1_Amm_IT at 42
gui_mainfcn(gui_State, varargin{:});
Error in ==>
@(hObject,eventdata)E1_Amm_IT('PB_Carica_Callback',hObject,eventdata,guidata(hObject))
??? Error while evaluating uicontrol Callback
I post you my code:
function PB_Browse_Callback(hObject, eventdata, handles)
global file
[file path] = uigetfile('*.txt');
global filepath
filepath = strcat(path, file);
set(handles.ET_Path, 'String', filepath);
filename=get(handles.ET_Path, 'String');
global filepath;
if strcmp(filepath, '')==1
errordlg('Choose a file!', 'ERROR!');
elseif strcmp(filepath, '')==0
% My .m file runs
How can I fix it??
2 comentarios
Walter Roberson
el 19 de En. de 2012
We need to see the code for PB_Carica_Callback
Also, please read
http://matlab.wikia.com/wiki/FAQ#How_can_I_share_data_between_callback_functions_in_my_GUI.3F
Respuesta aceptada
Walter Roberson
el 19 de En. de 2012
Why don't you simply set PB_Carica 'enable' to 'off' until the browsing has been done?
Más respuestas (1)
Ver también
Categorías
Más información sobre Dialog Boxes en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!