Borrar filtros
Borrar filtros

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

1 visualización (últimos 30 días)
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 comentario
Roby Pad
Roby Pad el 16 de Feb. de 2024
Movida: the cyclist el 16 de Feb. de 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

Iniciar sesión para comentar.

Respuesta aceptada

the cyclist
the cyclist el 2 de En. de 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 comentarios
wave_buoys
wave_buoys el 3 de En. de 2019
the problem was solved after reinstalling MATLAB (the same version 2018b)
Have a great day!
Colin
Colin el 14 de Abr. de 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.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Historical Contests en Help Center y File Exchange.

Productos


Versión

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by