DSPRelated.com
Forums

Array indexing in Matlab finally corrected after 30 years!

Started by Max April 1, 2015
  [Snipped by Lyons]
> > >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
Hi Les, the line: x2 - y^2 = xy - y^2. is 0 = 0. Any follow-on multiplications or divisions can lead to trouble. [-Rick-] --------------------------------------- Posted through http://www.DSPRelated.com
14446@DSPRelated wrote:
> [Snipped by Lyons] >> >> >> 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 > > Hi Les, > the line: > > x2 - y^2 = xy - y^2. > > is > > 0 = 0. > > Any follow-on multiplications or divisions > can lead to trouble. >
Yes. Happy belated April Fools.
> [-Rick-] > > --------------------------------------- > Posted through http://www.DSPRelated.com >
-- Les Cargill
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. > >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 :-)
Hello Max, Thanks for the good news. I wonder, how does this affect users of older versions of Matlab? That is, is there any way older versions of Matlab can take advantage of the updated zero-indexing capabilities? Thanks, [-Rick-]
On Mon, 06 Apr 2015 17:18:16 -0700, Rick Lyons
<R.Lyons@_BOGUS_ieee.org> 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. >> >>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 :-) > >Hello Max, > Thanks for the good news. > >I wonder, how does this affect users of older >versions of Matlab? That is, is there any >way older versions of Matlab can take advantage >of the updated zero-indexing capabilities? > >Thanks, >[-Rick-]
You might want to go back and look at the date of the original post. ;) Eric Jacobsen Anchor Hill Communications http://www.anchorhill.com --- This email has been checked for viruses by Avast antivirus software. http://www.avast.com
Rick Lyons <R.Lyons@_bogus_ieee.org> 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.
(snip)
>>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 :-)
(snip)
> I wonder, how does this affect users of older > versions of Matlab? That is, is there any > way older versions of Matlab can take advantage > of the updated zero-indexing capabilities?
Only on April 0th. -- glen
>> 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. > > (snip) > >>> 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 :-) >
Rick Lyons<R.Lyons@_bogus_ieee.org> wrote:
>> I wonder, how does this affect users of older >> versions of Matlab? That is, is there any >> way older versions of Matlab can take advantage >> of the updated zero-indexing capabilities?
On 4/6/15 11:40 PM, glen herrmannsfeldt wrote:
> > Only on April 0th.
On 4/6/15 8:38 PM, Eric Jacobsen wrote:
> > You might want to go back and look at the date of the original post.
but still, oh how i wish Cleve Moler would notice. even 15 or 20 years later, it isn't too late to correct a mistake. -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."
On Tue, 07 Apr 2015 00:38:27 GMT, eric.jacobsen@ieee.org (Eric
Jacobsen) wrote:

>On Mon, 06 Apr 2015 17:18:16 -0700, Rick Lyons ><R.Lyons@_BOGUS_ieee.org> 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. >>> >>>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 :-) >> >>Hello Max, >> Thanks for the good news. >> >>I wonder, how does this affect users of older >>versions of Matlab? That is, is there any >>way older versions of Matlab can take advantage >>of the updated zero-indexing capabilities? >> >>Thanks, >>[-Rick-] > >You might want to go back and look at the date of the original post. > >;)
Hi Eric, To quote Homer Simpson, "DOH." [-Rick-]
On Tue, 07 Apr 2015 05:35:50 -0700, Rick Lyons
<R.Lyons@_BOGUS_ieee.org> wrote:

>> >>You might want to go back and look at the date of the original post. >> >>;) > >Hi Eric, > > To quote Homer Simpson, "DOH."
Oops, sorry. I should have made the date of that post more obvious. I really do wish that they hadn't started with 1 though. Gotta wonder why they thought that was a good idea.
Max <Max@sorrynope.com> writes:

> On Tue, 07 Apr 2015 05:35:50 -0700, Rick Lyons > <R.Lyons@_BOGUS_ieee.org> wrote: > >>> >>>You might want to go back and look at the date of the original post. >>> >>>;) >> >>Hi Eric, >> >> To quote Homer Simpson, "DOH." > > Oops, sorry. I should have made the date of that post more obvious. > I really do wish that they hadn't started with 1 though. Gotta wonder > why they thought that was a good idea.
MATLAB = MATRIX Laboratory. So the same reason mathematicians number their elements a_11, a_12, ..., a_21, a_22, etc. Blame the mathematician who started THAT convention! -- Randy Yates Digital Signal Labs http://www.digitalsignallabs.com
On 4/8/15 8:30 AM, Randy Yates wrote:
> Max<Max@sorrynope.com> writes: > >> On Tue, 07 Apr 2015 05:35:50 -0700, Rick Lyons >> <R.Lyons@_BOGUS_ieee.org> wrote: >> >>>> >>>> You might want to go back and look at the date of the original post. >>>> >>>> ;) >>> >>> Hi Eric, >>> >>> To quote Homer Simpson, "DOH." >> >> Oops, sorry. I should have made the date of that post more obvious. >> I really do wish that they hadn't started with 1 though. Gotta wonder >> why they thought that was a good idea. > > MATLAB = MATRIX Laboratory. So the same reason mathematicians > number their elements a_11, a_12, ..., a_21, a_22, etc. Blame > the mathematician who started THAT convention!
yeah, but they're not always matrices. in fact, the largest-selling MATLAB toolbox is the Signal Processing Toolbox. i might venture a guess that the largest portion of MATLAB users are EE's doing signal processing. for EE's doing signal processing, i'm sure the vast majority of the time, they are "mere" *arrays* not matrices where we are doing matrix arithmetic. probably most other users of MATLAB use it for general math use and matrix math is used, maybe, 30% of the time. and those matrix elements *could* be numbered a_00, a_01, ..., a_10, a_11, etc. wouldn't hurt anything. AND, (this is the reason the refusal to fix is inexcusable), what MATLAB needs to be is have the array origin for each dimension USER SPECIFIED with the default value being 1. there would need to be two new functions, comparable to size() and reshape() that i would call "origin()" and "reorigin()" (or maybe "base()" and "rebase()") that makes it perfectly backward compatible and no one's existing code breaks. AND, with that, we might have origins that are negative so that we can cleanly represent negative frequency in the Fourier transform and negative time for non-causal impulse responses. it's without excuse. -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."