フィルターのクリア

Randi worked in a program I ran 5 weeks ago, today it doesn't-what gives?

1 回表示 (過去 30 日間)
Fede C 2018 London
Fede C 2018 London 2019 年 10 月 17 日
コメント済み: Guillaume 2019 年 10 月 17 日
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?

採用された回答

John D'Errico
John D'Errico 2019 年 10 月 17 日
編集済み: John D'Errico 2019 年 10 月 17 日
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.
  6 件のコメント
Stephen23
Stephen23 2019 年 10 月 17 日
編集済み: Stephen23 2019 年 10 月 17 日
" I don't have a script named randi, or a function with that name."
MATLAB disagrees with you:
C:\Users\federico\Documents\MATLAB\mvgc_v1.0\utils\legacy\randi\randi.m
Guillaume
Guillaume 2019 年 10 月 17 日
It appears you're using this toolbox. Delete it or at least remove it from your path since it shadows built-in functions randi and rng and maybe more.
I would also recommend getting in touch with them to complain about that shadowing.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by