Filter löschen
Filter löschen

i want to create a error msage.

2 Ansichten (letzte 30 Tage)
partha das
partha das am 13 Jul. 2011
I want to run a program where a excel file will be taken as input and i want that if the excel file is not find there should be an error msg. how can i create that type of error msg box. please help me. thank you in advance..

Akzeptierte Antwort

Chirag Gupta
Chirag Gupta am 13 Jul. 2011
Use exist
if (~exist(filename,'file'))
msgbox('File Not found','Error','Error');
end
  1 Kommentar
partha das
partha das am 13 Jul. 2011
it is also not working where file name is variable.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Friedrich
Friedrich am 13 Jul. 2011
Hi,
maybe something like this?
msgbox('File not found','Error','Error')
  4 Kommentare
Friedrich
Friedrich am 13 Jul. 2011
if exist('C:\path_to file_\name.xls','file') ~=2
msgbox('File not found','Error','Error')
else
%do what you like with the file here
partha das
partha das am 13 Jul. 2011
but here file name is variable....so its not working..

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Get Started with MATLAB finden Sie in Help Center und File Exchange

Tags

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by