Why my wblfit function gives errors
Show older comments
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 Comments
Walter Roberson
on 19 Sep 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
on 19 Sep 2012
Answers (1)
Peter Perkins
on 19 Sep 2012
0 votes
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.
Categories
Find more on Converters (High Power) in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!