フィルターのクリア

Cancel the beep and an error msg in GUI button cancellation

3 ビュー (過去 30 日間)
dan kin
dan kin 2013 年 5 月 7 日
I created a save2XLS button in GUI that contain the following code:
[filename,pathname]= uiputfile('*.xls','Save as');
column=get(handles.foTable,'columnname')' ;
dataX=get(handles.foTable,'data');
num=[column;dataX];
fullFileName = [pathname filename]
if exist(fullFileName)
%overwrite the file
delete([pathname filename])
xlswrite([pathname filename],num);
else
%write new file
xlswrite([pathname filename],num);
end
If I decide to cancel the "save as" operation by clicking the X or the cancel button I get a beep and an error in the command window. How can I cancel it?
Thanks

採用された回答

Image Analyst
Image Analyst 2013 年 5 月 7 日
Bail out if they click cancel
if filename == 0
return;
end

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeEnvironment and Settings についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by