Matlab regex if statement
Posted
by
Dan
on Stack Overflow
See other posts from Stack Overflow
or by Dan
Published on 2012-04-04T22:29:36Z
Indexed on
2012/04/04
23:29 UTC
Read the original article
Hit count: 209
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?
© Stack Overflow or respective owner