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:
Is this a bug?

Subject: Is this a bug?

From: Oleg Komarov

Date: 23 Jan, 2011 22:34:03

Message: 1 of 2

Hi to everybody,
I get a wrong answer from yearfrac.m (Financial Toolbox) when calculatin in actual / actual (0) convention.

Here's an example:

% The dates
strDate = datenum('08/01/1999','mm/dd/yyyy');
endDate = datenum('12/31/1999','mm/dd/yyyy');

% Right result: 152 / 365 = 0.4164 (1 Aug 99 - 31 Dec 99)
daysdif (strDate, endDate,0) / yeardays(1999,0)

% Wrong result: BUG on line 86-90? (gives 366 days for 1999)--> 0.4153
yearfrac(strDate, endDate,0)

Should I submit it?

Cheers

Oleg

Subject: Is this a bug?

From: Oleg Komarov

Date: 23 Jan, 2011 23:00:05

Message: 2 of 2

Forgot to mention - R2010a Win32 Vista

Tags for 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