« first day (494 days earlier)      last day (2724 days later) » 

7:27 AM
@excaza that's rather horrific. I usually answer all parfor things, but I'll make an exception here
 
 
6 hours later…
1:18 PM
@ballBreaker I didn't notice that one of my mercs got to lvl 28; now he's dead and kosts 85,233 rubies to revive :p
with 100$ for 1300 rubies, that's equal to paying 6,500$ for it :p
 
 
4 hours later…
5:36 PM
@Ander I'll also be writing a paper for an IOP journal. Wish me luck:D
 
5:47 PM
Some days ago, some anonymous hater gave me 3 downvotes 😠 but serial downvoting was corrected later on! Today, I think some anonymous fan is making me a victim of serial upvoting 😜 (I got 3 upvotes within like just 2 minutes). 😃
 
@AndrasDeak I wish you luck, but only if you'll promise to send the paper once finished
 
haha, no way:D
 
then no luck from me :P
 
@Sardar_Usama -3 will be reversed, +3 probably not
 
😃
anyway, I wish you best of luck
 
6:04 PM
Ah, thanks. I was mostly joking as Ander struggled with IOP's journal format in the past
 
6:27 PM
@AndrasDeak nice! good luck!
We were thinking on uppng our jounral to something with Nature on its name
well see
they are also cooler about tex formats :P
Just because of that
 
oooooh, noice!
I hope you do!:D
 
haha yeah I hope I do also! it would be a fantastic wy of ending my PhD!
 
well, your results are fantastic too, so... :P
 
I hope I can convince reviewers! :P
 
haha:D
 
6:57 PM
This is weird:
>> x = [10 20 30 40 50];
>> x(0.4)
Subscript indices must either be real positive integers or logicals.
>> x(0.6)
Subscript indices must either be real positive integers or logicals.
>> x(0.4:3)
ans =
    10    10    20
>> x(0.6:3)
ans =
    10    20    30
Some kind of rounding kicks in when the colon is used in an index
Apparently is rounding to nearest integer, except that 0 is then transformed into 1
 
Umm...colon isn't used as an index, an array is. Right?
what does [0.4 1.4 2.4] do as index?
 
@AndrasDeak It seems there is some distinction when the colon is used. Compare
>> x([0.6 1.6 2.6])
Subscript indices must either be real positive integers or logicals.
>> x([0.6:3])
Subscript indices must either be real positive integers or logicals.
>> x(0.6:3)
ans =
    10    20    30
@AndrasDeak (That errors, like [0.6 1.6 2.6] above)
 
very weird... but of course, it shouldn't just evaluate the colon first: end would stop working
Guess it works with negative indices too, right? It truncates to the relevant index range. (guess #2 if you will)
 
@AndrasDeak Good point. Probably that's the reason why : is treated differently here
I expected Octave to do it differently, but curiously it does the same, only with a warning here
>> x(0.6:3)
warning: non-integer range used as index
ans =
   10   20   30
 
what about x(-2.1:10)?
does that error?
or give you x?
 
7:06 PM
@AndrasDeak See:
>> x(-2:3)
Subscript indices must either be real positive integers or logicals.
>> x(-0.4:3)
ans =
    10    10    20    30
>> x(-0.6:3)
Subscript indices must either be real positive integers or logicals.
Sort of makese sense in view of the above: rounds to nearest integer, if 0 transforms into 1. If negative it just errors
 
but that's...oddly specific:/
thanks for the feedback:)
 
@AndrasDeak Error:
>> x(-2.1:3)
Subscript indices must either be real positive integers or logicals.
Deep in Matlab's Jave code for dealing with colon indexing there's probably a round followed by if gives 0 then make it 1
 
but that's just plain silly
so many subtle errors uncaught...wonder what the motivation is
especially since this can hide 0-instead-of-1-based-indexing porting problems
 
@AndrasDeak Perhaps to deal with results that should be integer but are not due to numerical precision
:33898929 >> x(0.1:4)
ans =
    10    10    20    30
>> x(0:4)
Subscript indices must either be real positive integers or logicals.
 
doesn't explain why 0 should be different
no, this is even worse!
 
7:10 PM
Hehe
 
if your 0 is not 0 but 1e-15, it will behave differently (not throw an error)
 
They round the interval (0,1) to 1, and any (k,k+1) to k or k+1, whichever is closest
@AndrasDeak You are right:
>> x(1e-15:4)
ans =
    10    10    20    30    40
 
Although this warning appears:
`Warning: Integer operands are required for colon operator when used as index`
and this, in editor,: The operation or expression '(' has no evident effect.
but it is interesting although
 
@Sardar_Usama I don't get that warning? With what code and Matlab version do you get it?
 
7:27 PM
MATLAB R2016a. and here is the copy paste from my command window:
>> x = [10 20 30 40 50];
x(0.1:3)
Warning: Integer operands are required for colon operator when used as index

ans =

10 10 20
 
@Sardar_Usama Thanks for the info. No warning in my 15b
 
@AndrasDeak There are different zeros???
 
They probably realized it after 15b
but then they should've removed it in 16a
or it is probably an unknown feature!
 
@flawr for indexing, yes, as Luis has just discovered
the problem is treating 0 differently for some obscure reason
 
35 mins ago, by Luis Mendo
This is weird:
@flawr Read from here onwards
 
7:34 PM
Really strange
 
You have an older Matlab version (was it 2010?). Can you check?
 
brb with 2012b
 
end without : doesn't trigger that behaviour. The colon is needed for that
>> x = [10 20 30 40 50];
>> x(end/6)
Subscript indices must either be real positive integers or logicals.
>> x(end/6:end/2)
ans =
    10    20
 
>> x(end/6:end/2)
Warning: Integer operands are required for colon operator when used as index

ans =

    10    20
I can has warning
>> x(-0.4:3)
Warning: Integer operands are required for colon operator when used as index
Subscript indices must either be real positive integers or logicals.
so your bug is a new feature
 
So the warning is in 12b and in 16a but not in my 15b? Hm maybe I deactivated warnings
 
7:39 PM
>> x(0.4:3)
Warning: Integer operands are required for colon operator when
used as index
??? Subscript indices must either be real positive integers or
logicals.
^2010b
x(0.5:3) ersults in just a warning, but no error
 
Yep. With warning on I now get the warning
 
x(0.4:3) results in an error
 
@flawr Same as us then
 
I need to remember that, in order to abuse it someday.
Too bad it does not work in e.g. A(1.6,6.2)
that way many image processing things would be way easier.
 
@flawr Heh. In fact, I just found this because MATL does round indices. I was trying to port my answer to Matlab, inadvertently used the non-integer indices in Matlab, and realized it wasn't giving any error
@flawr Use MATL :-P
 
7:43 PM
For image processing, right.
 
IMG PRC
also, A(1.6:1.6,6.2:6.2)
 
@AndrasDeak :-DD
 
that's almost fortran pseudocode if you ask me
 
@flawr And with Suever's online compiler you get graphical ouput
 
it does not "exactly" **round off**. See this:

`>> x = [10 20 30 40 50];
>> x(0.49:4)
Warning: Integer operands are required for colon operator when used as index

ans =

10 10 20 30

>> x(0.5:4)
Warning: Integer operands are required for colon operator when used as index

ans =

10 20 30 40`
 
7:47 PM
@Sardar_Usama Yup. See above. We concluded that it rounds to nearest integer except that the whole interval (0,1) is rounded to 1
 
"We" = the best bounty hunter in the galaxy
 
@LuisMendo oh cool=)
@AndrasDeak I hope you mean this, but I never got any other bounty=)
 
round(0.49) =0
If it rounds off, shouldn't my above code be throwing an error? :/
 
@AndrasDeak with a lot of help from their scum friends here
@Sardar_Usama My hypothesis is that all numbers between 0 and 1 are special-cased and rounded up
Something like
special_case = (indices>0) & (indices<1);
rounded_indices(~special_case) = round(indices(~special_case))
rounded_indices(special_case) = 1;
 
I'm just saying that:
x(0.49:4) is actually equal to x([1 1 2 3])
and x(0.5:4) is actually equal to x([1 2 3 4])
 
7:55 PM
See my code above, it would do exactly that
There probably is something like that in Matlab's Java code for colon indices
 
 
1 hour later…
9:06 PM
On second thought, it seems numbers between -0.5 and 1 all get rounded to 1
>> x(-0.4:2)
ans =
    10    10    20
 
9:37 PM
x = [10 20 30 40 50];

N̲ᴜ̲ᴍ̲ʙ̲ᴇ̲ʀ̲ ̲ᴏ̲ғ̲ ̲ᴇ̲ʟ̲ᴇ̲ᴍ̲ᴇ̲ɴ̲ᴛ̲s̲:

C̲a̲s̲e̲-̲1̲: if indexes ∈ (-0.5,0)
no. of elements = last index +1
e.g; x(-0.49:4) has 5 elements

C̲a̲s̲e̲-̲2̲: if indexes ∈ (0,inf)
no. of elements = last index
e.g; x(0.49:4) has 4 elements

E̲ʟ̲ᴇ̲ᴍ̲ᴇ̲ɴ̲ᴛ̲s̲:

C̲a̲s̲e̲-̲1̲: if indexes ∈(-0.5,0)
e.g; x(-0.49:4) gives x([1 1 2 3 4])

C̲a̲s̲e̲-̲2̲: if indexes ∈ (0,0.5)
e.g; x(0.49:4) gives x([1 1 2 3])

C̲a̲s̲e̲-̲3̲: (exactly round off)
if indexes ∈ [0.5, inf)
e.g; x(0.5:4) gives x([1 2 3 4])
 
wtf
 
lol :D
 
10:34 PM
@AndrasDeak Octave seems to do normal rounding, without special-casing the numbers between -0.5 and 0.5. I think this deserves a question, and I've just posted it. Maybe some Matlab / Octave developer can offer some light
@Sardar_Usama I think the rule "round to nearest integer, but numbers between -0.5 and 0.5 are rounded to 1 instead of 0" explains all those cases
 
I guess gnu guys weren't paying enough attention to silly mathworks:P
 
:-D Maybe Mathworks do it on purpose. It has happened so many times. Like disp('') giving a blank line on Octave and nothing in Matlab
 
11:12 PM
@LuisMendo It had to be done on purpose, but it still seems stupid
they might have had a good reason for it, but I doubt that it's good enough
 
@AndrasDeak By "on purpose" I meant trying to confuse GNU people :-) not just this specific special-casing of the interval (-0.5, 0.5)
 
oooooh, I see:D sorry
 
Hehe. I don't think I was clear enough
 
yes:P
 
Perhaps I'll bounty my question in a few days if no developer or experienced user gives a pointer to some doc. There should to be some documentation of this
It's intriguing
It would be nice to be able to see the source code for this
 
11:20 PM
"should be some documentation", yeah right:P
mathworks is all about revealing system internals
 
True :-) But this is not only internal, it has effects externally
 
well, yeah, but pretty deep in the implementation, probably
much higher-level functions have been closed-source for a long time
 

« first day (494 days earlier)      last day (2724 days later) »