DSPRelated.com
Forums

Array indexing in Matlab finally corrected after 30 years!

Started by Max April 1, 2015
I was glad to hear that Mathworks has finally corrected their array
indexing scheme to start with 0 instead of 1, so they're now
compatible with all the other languages out in the real world.

Apparently they knew all along that array indexes actually start at
zero, but a bug in the initial release of the code caused the 'off by
one' problem.  An admission of such a glaring math error would have 
been disastrous, so they claimed that they meant to do it. 

Mark this day on your calendar as the day when corresponding source
code needs to be corrected.  And perhaps the day that I get hunted
down by some humorless Mathworks salesman :-)
On Wednesday, April 1, 2015 at 5:24:54 AM UTC-5, Max wrote:
> I was glad to hear that Mathworks has finally corrected their array > indexing scheme to start with 0 instead of 1, so they're now > compatible with all the other languages out in the real world. > > Apparently they knew all along that array indexes actually start at > zero, but a bug in the initial release of the code caused the 'off by > one' problem. An admission of such a glaring math error would have > been disastrous, so they claimed that they meant to do it. > > Mark this day on your calendar as the day when corresponding source > code needs to be corrected. And perhaps the day that I get hunted > down by some humorless Mathworks salesman :-)
Oooops, my calendar has changed from what it showed yesterday (presumably it uses some MATLAB code internally) and so today's date shows as April 0. Post your information tomorrow and it will be a lot funnier. Ah, where is rb-j when we need him?
On Wed, 01 Apr 2015 06:24:47 -0400, Max <Max@sorrynope.com> wrote:

>I was glad to hear that Mathworks has finally corrected their array >indexing scheme to start with 0 instead of 1, so they're now >compatible with all the other languages out in the real world.
A side-effect of this modification is that all divide-by-zero situations in Matlab, which previously returned "NaN", now simply return the dividend: A/0 = A because, of course, 0 = 1.
On 4/1/15 8:56 AM, dvsarwate wrote:
> On Wednesday, April 1, 2015 at 5:24:54 AM UTC-5, Max wrote: >> I was glad to hear that Mathworks has finally corrected their array >> indexing scheme to start with 0 instead of 1, so they're now >> compatible with all the other languages out in the real world. >> >> Apparently they knew all along that array indexes actually start at >> zero, but a bug in the initial release of the code caused the 'off by >> one' problem. An admission of such a glaring math error would have >> been disastrous, so they claimed that they meant to do it. >> >> Mark this day on your calendar as the day when corresponding source >> code needs to be corrected. And perhaps the day that I get hunted >> down by some humorless Mathworks salesman :-) > > Oooops, my calendar has changed from what it showed yesterday (presumably > it uses some MATLAB code internally) and so today's date shows as April 0. > Post your information tomorrow and it will be a lot funnier. > > Ah, where is rb-j when we need him?
i'm here. wasn't fooled for a second. (well, maybe a second.) perfect application of the holiday. should post this at comp.soft-sys.matlab -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."
Max <Max@sorrynope.com> writes:

> I was glad to hear that Mathworks has finally corrected their array > indexing scheme to start with 0 instead of 1, so they're now > compatible with all the other languages out in the real world. > > Apparently they knew all along that array indexes actually start at > zero, but a bug in the initial release of the code caused the 'off by > one' problem. An admission of such a glaring math error would have > been disastrous, so they claimed that they meant to do it.
Hahahaha!! Good one! -- Randy Yates Digital Signal Labs http://www.digitalsignallabs.com
Greg Berchin wrote:
> On Wed, 01 Apr 2015 06:24:47 -0400, Max <Max@sorrynope.com> wrote: > >> I was glad to hear that Mathworks has finally corrected their array >> indexing scheme to start with 0 instead of 1, so they're now >> compatible with all the other languages out in the real world. > > A side-effect of this modification is that all divide-by-zero situations > in Matlab, which previously returned "NaN", now simply return the > dividend: > > A/0 = A > > because, of course, 0 = 1. >
Of course. x = y. Then x2 = xy. Subtract the same thing from both sides: x2 - y^2 = xy - y^2. Dividing by (x-y), obtain x + y = y. Since x = y, we see that 2 y = y. Thus 2 = 1, since we started with y nonzero. Subtracting 1 from both sides, 1 = 0. https://www.math.hmc.edu/funfacts/ffiles/10001.1-8.shtml -- Les Cargill
On Wed, 01 Apr 2015 12:06:32 -0500, Les Cargill <lcargill99@comcast.com>
wrote:

>Thus 2 = 1, since we started with y nonzero. >Subtracting 1 from both sides, >1 = 0.
But 1 already equals -1 (I first posted this back in August, 2002): Given: -1 = -1 And: -1/1 = 1/-1 Then: sqrt(-1) = sqrt(-1) sqrt(-1/1) = sqrt(1/-1) sqrt(-1)/sqrt(1) = sqrt(1)/sqrt(-1) But: sqrt(1) = 1 Therefore: sqrt(-1)/1 = 1/sqrt(-1) sqrt(-1) = 1/sqrt(-1) Cross-multiply: sqrt(-1)*sqrt(-1) = 1 [sqrt(-1)]^2 = 1 But: [sqrt(-1)]^2 = -1 Therefore: -1 = 1
On 4/1/15 1:46 PM, Greg Berchin wrote:
> On Wed, 01 Apr 2015 12:06:32 -0500, Les Cargill<lcargill99@comcast.com> > wrote: > >> Thus 2 = 1, since we started with y nonzero. >> Subtracting 1 from both sides, >> 1 = 0. > > But 1 already equals -1 (I first posted this back in August, 2002): > > Given: > > -1 = -1 > > And: > > -1/1 = 1/-1 > > Then: > > sqrt(-1) = sqrt(-1) >
not all sqrt(-1)'s (or any "sqrt(z)") are created equal. -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."
Greg Berchin wrote:
> On Wed, 01 Apr 2015 12:06:32 -0500, Les Cargill <lcargill99@comcast.com> > wrote: > >> Thus 2 = 1, since we started with y nonzero. >> Subtracting 1 from both sides, >> 1 = 0. > > But 1 already equals -1 (I first posted this back in August, 2002): > > Given: > > -1 = -1 > > And: > > -1/1 = 1/-1 > > Then: > > sqrt(-1) = sqrt(-1) > > sqrt(-1/1) = sqrt(1/-1) > > sqrt(-1)/sqrt(1) = sqrt(1)/sqrt(-1) > > But: > > sqrt(1) = 1 > > Therefore: > > sqrt(-1)/1 = 1/sqrt(-1) > > sqrt(-1) = 1/sqrt(-1) > > Cross-multiply: > > sqrt(-1)*sqrt(-1) = 1 > > [sqrt(-1)]^2 = 1 > > But: > > [sqrt(-1)]^2 = -1 > > Therefore: > > -1 = 1 >
And the absent minded member of forum said that *I* had a screw loose ;/
Haha, nice.

Mark