Why my wblfit function gives errors
显示 更早的评论
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 个评论
Walter Roberson
2012-9-19
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
2012-9-19
回答(1 个)
Peter Perkins
2012-9-19
0 个投票
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.
类别
在 帮助中心 和 File Exchange 中查找有关 Converters (High Power) 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!