Why does the ISEQUAL function return "1" (true) on FINTS objects when they are not actually equal?

1 view (last 30 days)
The following code returns "true" even though the FINTS objects "fts" and "fts2" have different values:
dates = [today:today+9]';
reihe1 = [1:10]';
fts = fints(dates, reihe1);
fts2 = fts * 2;
isequal (fts, fts2)
ans = 1

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
This bug has been fixed for Release 14 (R14). For previous releases, please read below for any possible workarounds:
This is a bug in the Financial Series Toolbox in the way that the ISEQUAL function compares FINTS objects.
As a workaround, you can edit the ISEQUAL function in order to have it compare the FINTS objects correctly. To edit the ISEQUAL function,
1) Type
edit fints/isequal
2) Save this as "isequal.m.old".
3) At line 41, remove the word "end". At line 51, add the word "end". The last part of the ISEQUAL function should then look as follows:
elseif (arg1Time == 1) & (arg2Time == 1)
if any((arg1.data{5} - arg2.data{5}) > (0.001/60/60/24))
% Check times. tolerance of .001 of a sec
iseq(oidx) = 0;
end
else % Check data series names.
eval('iseq(oidx) = ~any(any(char(sort(arg1.names(4:end)))-char(sort(arg2.names(4:end)))));', ...
'iseq(oidx) = 0;');
if iseq % Check values.
eval('iseq(oidx) = ~any(any(arg1.data{4}-arg2.data{4}));', ...
'iseq(oidx) = 0;');
end
end
end
end
iseq = all(iseq);
% [EOF]
4) Save this as isequal.m

More Answers (0)

Categories

Find more on MATLAB in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!