Effacer les filtres
Effacer les filtres

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

1 vue (au cours des 30 derniers jours)
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 commentaire
Roby Pad
Roby Pad le 16 Fév 2024
Déplacé(e) : the cyclist le 16 Fév 2024
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

Connectez-vous pour commenter.

Réponse acceptée

the cyclist
the cyclist le 2 Jan 2019
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 commentaires
wave_buoys
wave_buoys le 3 Jan 2019
the problem was solved after reinstalling MATLAB (the same version 2018b)
Have a great day!
Colin
Colin le 14 Avr 2024
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.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Historical Contests dans Help Center et File Exchange

Produits


Version

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by