MATLAB: Randi worked in a program I ran 5 weeks ago, today it doesn’t-what gives

randi

Dear all,
I had a perfectly-functioning program that used this line:
c = randi([1,n],mn,1)
where n and mn are integers. I've re-opened the program to do a monte carlo simulation, and all I get is an error message stating:
Error using randi
Too many input arguments.
Mind you, I haven't changed a coma in the program. I'm just running it again to re-acquaint myself with had I had done.
Any thoughts?

Best Answer

Don't write an m-file that is named randi, at least, if you will ever want to use randi. Try this:
which randi -all
If there is a function named randi that you created, then you did exactly that.
In general, avoid naming functions with existing function names. Check BEFORE you create that file.