我想讓matlab獲取用戶輸入但接受兩個字母的例子。例如,我有:Matlab正則表達式if語句
function nothing = checkGC(gcfile)
if exist(gcfile)
reply = input('file exists, would you like to overwrite? [Y/N]: ', 's');
if (reply == [Yy])
display('You have chosen to overwrite!')
else
$ Do nothing
end
end
if語句顯然是行不通的,但基本上我想接受一個小寫或uppcase Y.最新最好的方式做到這一點?