Why my wblfit function gives errors
Mostra commenti meno recenti
For my x dataset of 300 values (0<x<5), the command wblfit(x) gives the following error. I am running version R2009a. I do not have to meddle with evfit built in function, do I?
??? Operands to the || and && operators must be convertible to logical scalar values.
Error in ==> evfit at 94
if n == 0 || nuncensored == 0 || ~isfinite(rangex)
Error in ==> wblfit at 74
parmhatEV = evfit(log(x),alpha,censoring,freq,options);
2 Commenti
Walter Roberson
il 19 Set 2012
What shape is your x? Looking at the error, I would speculate that you are passing in an array but that the code expects a vector.
Russ Adheaux
il 19 Set 2012
Risposte (1)
Peter Perkins
il 19 Set 2012
0 voti
Russ, your data input x is a vector, and in any case the code checks for a vector. But you haven't said what any of your other inputs are. It's pretty much impossible to figure this out second hand. I recommend that you open evfit in the editor, set a break point on line 94, and when execution stops on that line, hover over the three variables n, nuncensored, and rangex, and see which of them is not a scalar. Then look at the variables that are used on the RHS of lines 86-90 and see if you can figure out why.
Given that evfit checks that x is a vector, and checks that cens and freq are the same size as x, my best guess is that you have unintentionally shadowed some function. But of course there may be something subtle that I'm not seeing.
Hope this helps.
Categorie
Scopri di più su Converters (High Power) in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!