필터 지우기
필터 지우기

i want to create a error msage.

조회 수: 2 (최근 30일)
partha das
partha das 2011년 7월 13일
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..

채택된 답변

Chirag Gupta
Chirag Gupta 2011년 7월 13일
Use exist
if (~exist(filename,'file'))
msgbox('File Not found','Error','Error');
end
  댓글 수: 1
partha das
partha das 2011년 7월 13일
it is also not working where file name is variable.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Friedrich
Friedrich 2011년 7월 13일
Hi,
maybe something like this?
msgbox('File not found','Error','Error')
  댓글 수: 4
Friedrich
Friedrich 2011년 7월 13일
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 2011년 7월 13일
but here file name is variable....so its not working..

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by