Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
On "fixing" MATLAB source code

Subject: On "fixing" MATLAB source code

From: kj

Date: 11 Jun, 2013 19:56:24

Message: 1 of 4




OK, I found a bug in toolbox/finance/calendar/x2mdate.m[1]. This
bug is easy to fix, but I don't want to hack away at my MATLAB
source code, so I copied the original file to somewhere else in my
path, and fixed the problem there. Now the code works fine.

The problem is that I want to include the fixed source file with
the rest of my code. Now, this source file is 99.99% MathWorks
code.

I cannot wait for MathWorks to fix this bug (assuming that they
are even willing to classify it as a bug; hey, maybe it's a feature!).

What should I do?


[1] When the function tests that its argument is numeric (line 44),
it fails to test that it is not NaN. Hilarity ensues.

Subject: On "fixing" MATLAB source code

From: dpb

Date: 11 Jun, 2013 20:10:32

Message: 2 of 4

On 6/11/2013 2:56 PM, kj wrote:
> OK, I found a bug in toolbox/finance/calendar/x2mdate.m[1]. This
> bug is easy to fix, but I don't want to hack away at my MATLAB
> source code, so I copied the original file to somewhere else in my
> path, and fixed the problem there. Now the code works fine.
>
> The problem is that I want to include the fixed source file with
> the rest of my code. Now, this source file is 99.99% MathWorks
> code.
>
> I cannot wait for MathWorks to fix this bug (assuming that they
> are even willing to classify it as a bug; hey, maybe it's a feature!).
>
> What should I do?
>
>
> [1] When the function tests that its argument is numeric (line 44),
> it fails to test that it is not NaN. Hilarity ensues.

Are you distributing the code or is this just on a single workstation?
In the latter case I have actually made a patch or two in the TMW
distributions (well documented, of course).

If distributing, I would make the patched routine a different name to
not have aliasing of distributions--who knows, someone else may be
counting on that behavior in _their_ code so you don't want to risk
breaking something else.

--


--

Subject: On "fixing" MATLAB source code

From: kj

Date: 12 Jun, 2013 14:55:37

Message: 3 of 4

In <kp807k$v37$1@speranza.aioe.org> dpb <none@non.net> writes:

>On 6/11/2013 2:56 PM, kj wrote:
>> OK, I found a bug in toolbox/finance/calendar/x2mdate.m[1]. This
>> bug is easy to fix, but I don't want to hack away at my MATLAB
>> source code, so I copied the original file to somewhere else in my
>> path, and fixed the problem there. Now the code works fine.
>>
>> The problem is that I want to include the fixed source file with
>> the rest of my code. Now, this source file is 99.99% MathWorks
>> code.
>>
>> I cannot wait for MathWorks to fix this bug (assuming that they
>> are even willing to classify it as a bug; hey, maybe it's a feature!).
>>
>> What should I do?
>>
>>
>> [1] When the function tests that its argument is numeric (line 44),
>> it fails to test that it is not NaN. Hilarity ensues.

>Are you distributing the code or is this just on a single workstation?
>In the latter case I have actually made a patch or two in the TMW
>distributions (well documented, of course).

>If distributing, I would make the patched routine a different name to
>not have aliasing of distributions--who knows, someone else may be
>counting on that behavior in _their_ code so you don't want to risk
>breaking something else.

Thanks, especially for the suggestion of using a different name
for the patched function.

Subject: On "fixing" MATLAB source code

From: Steven_Lord

Date: 13 Jun, 2013 14:31:05

Message: 4 of 4



"dpb" <none@non.net> wrote in message news:kp807k$v37$1@speranza.aioe.org...
> On 6/11/2013 2:56 PM, kj wrote:
>> OK, I found a bug in toolbox/finance/calendar/x2mdate.m[1]. This
>> bug is easy to fix, but I don't want to hack away at my MATLAB
>> source code, so I copied the original file to somewhere else in my
>> path, and fixed the problem there. Now the code works fine.
>>
>> The problem is that I want to include the fixed source file with
>> the rest of my code. Now, this source file is 99.99% MathWorks
>> code.
>>
>> I cannot wait for MathWorks to fix this bug (assuming that they
>> are even willing to classify it as a bug; hey, maybe it's a feature!).
>>
>> What should I do?
>>
>>
>> [1] When the function tests that its argument is numeric (line 44),
>> it fails to test that it is not NaN. Hilarity ensues.
>
> Are you distributing the code or is this just on a single workstation? In
> the latter case I have actually made a patch or two in the TMW
> distributions (well documented, of course).
>
> If distributing, I would make the patched routine a different name to not
> have aliasing of distributions--who knows, someone else may be counting on
> that behavior in _their_ code so you don't want to risk breaking something
> else.

And of course, please let Technical Support know so they can enter it into
the bug database (and potentially send you a corrected copy of the function,
if this has already been reported and the developers have determined a more
robust fix.) This does look like a bug to me.

--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us