gevfit error: Operands to the || and && operators must be convertible to logical scalar values

9 ビュー (過去 30 日間)
Hello,
Using Matlab R2018b, I just run an example GEV Distribution
blocksize = 1000;
nblocks = 250;
rng default % For reproducibility
t = trnd(5,blocksize,nblocks);
x = max(t);
% 250 column maxima
paramEsts = gevfit(x)
I got the error message:
Operands to the || and && operators must be convertible to logical scalar values.
Error in gevfit (line 74)
if n == 0 || ~isfinite(rangex)
Error in huy_test_stats (line 9)
paramEsts = gevfit(x);
Does it a bug? or how could it be solved?
Thanks
  1 件のコメント
Roby Pad
Roby Pad 2024 年 2 月 16 日
移動済み: the cyclist 2024 年 2 月 16 日
Hello, I have the very same problem which started all of a sudden a couple of days ago. I have Matlab2023b version, and I have just tried unistalling and reinstalling again, but it doesn't work.
Can someone help me?
Roby

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

採用された回答

the cyclist
the cyclist 2019 年 1 月 2 日
That code works for me, in both 2018b and 2019a.
Does this happen with a freshly started instance of MATLAB?
If so, you might want to use the which command to check whether you are calling the functions from the places you expect. Another common error is to name a variable the same as a function.
  4 件のコメント
wave_buoys
wave_buoys 2019 年 1 月 3 日
the problem was solved after reinstalling MATLAB (the same version 2018b)
Have a great day!
Colin
Colin 2024 年 4 月 14 日 19:09
Very old thread here, but I just had the same problem and this appears to be the only thread directly addressing it. What worked for me (using R2023a) was to go into the toolbox/stats/stats/gevfit.m function and change line 73 from
rangex=range(x);
to
rangex = xmax-xmin;
Something seems buggy with the range function, in other words, at least in this setting.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeHistorical Contests についてさらに検索

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by