|
Dear Bruno!
> I have this piece of code that crashes my Matlab 2010a 64 bits, Vista.
>
> a=zeros(1,2e4);
> a(1000:1000:end)=NaN;
> a(logical(0./a)) = 0;
>
> With 2007a, it throw an error of the third statement "NaN's cannot be converted to logicals."
>
> Admittedly this piece of code is strange, but the crashes indicates something is not right in the built-in basic library.
>
> Bruno
Perhaps the level of strangeness can be reduced?
a = zeros(1, 5);
a(logical([0, 1, NaN, 0 / 0, 0 / NaN])) = 0
or:
b = 0;
b(logical(0 / b)) = 0
I do not have 2010a to test this.
In 2009a the expected error message "NaN's cannot be converted to logicals." appears, as you surely know already, Bruno.
Thanks Bruno for finding this bug! Jan
|