Matlab regex if statement
- by Dan
I want to have matlab take user input but accept both cases of a letter. For example I have:
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
The if statement obviously doesn't work, but basically I want to accept a lowercase or uppcase Y. Whats the best way to do this?