i want to create an error msg in matlab gui
显示 更早的评论
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. here file name is stored in a variable named a. please help me. thank you in advance..
采纳的回答
更多回答(1 个)
Chirag Gupta
2011-7-13
The previous answer seems to work. What are the contents of the variable? Is the variable a cell?
filename = 'MyTest1.xls'
if (~exist(filename,'file'))
msgbox('File Not Found','Error','Error');
end
What is the error if any that you are getting? Note that if the variable filename is a cell, you will need to pass the name explicitly like:
exist(filename{1},'file')
6 个评论
partha das
2011-7-13
partha das
2011-7-13
Friedrich
2011-7-13
I repeat again: If the Excel file is not on the MATLAB path you will need the absolut path to it.
partha das
2011-7-13
Friedrich
2011-7-13
it works fine for me. please post your code and the content of the variable a
partha das
2011-7-13
类别
在 帮助中心 和 File Exchange 中查找有关 Spreadsheets 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!