Poissrnd throwing Warning: Colon operands must be real scalars...
29 views (last 30 days)
Show older comments
Hello all, I am using poissrnd on a 49x49 array of some detector photocounts (on the order of 10^6), and I keep getting the following warnings each time I run the command. I've picked and chosen a few random numbers from the matrix, and I can't seem to replicate the warning. I'm trying to figure out why it's being thrown and what I can do to stop it.
K>> poissrnd(round(I1));
Warning: Colon operands must be real scalars.
> In binornd at 62
In poissrnd at 66
In poissrnd at 61
In poissrnd at 61
In poissrnd at 61
In poissrnd at 61
In poissrnd at 61
In poissrnd at 61
In poissrnd at 61
In spatialSRI4 at 105
Warning: Colon operands must be real scalars.
> In binornd at 62
In poissrnd at 66
In poissrnd at 61
In poissrnd at 61
In spatialSRI4 at 105
Warning: Colon operands must be real scalars.
> In binornd at 62
In poissrnd at 66
In poissrnd at 61
In spatialSRI4 at 105
Warning: Colon operands must be real scalars.
> In binornd at 62
In poissrnd at 66
In spatialSRI4 at 105
Note that this happens even if I do round(abs(I1)) as the input to poissrnd.
Thanks all, -Mike
0 Comments
Answers (4)
Walter Roberson
on 11 Sep 2011
I suggest you invoke
dbstop if warning
and then when the warning pops up, you would be able to examine the statement binornd at 62 and see what values it has and what the problem is with those values.
Michael
on 6 Nov 2012
I just experienced this problem when I used an array of type single, but it stopped when I changed it to double. So that's a workaround.
Still, this seems like a big ol' bug that Mathworks should really get fixed after more than a year. Submit support requests to get their butts in gear.
0 Comments
Kazem
on 10 Jul 2024
I had similar warning and the problem was from
the index of array had length more than one.
It means that
val = A (x)
x was [6, 9]
0 Comments
See Also
Categories
Find more on Calendar in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!