フィルターのクリア

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 Center および File ExchangeGet Started with MATLAB についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by