Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000452ODTBX - Matlab Codepublic2013-04-26 22:332014-03-07 18:37
Assigned Toravidavi 
PlatformOSOS Version
Summary0000452: Several Matlab utility functions now return column instead of row vectors.
DescriptionIn Matlab R2013a (v8.1), several utility functions return column vectors where they used to return row vectors. This causes many errors within ODTBX functions that rely on these utilities returning row vectors.

The affected Matlab utilities include: union(), intersect(), ismember(), and potentially others.

Each of the affected utilities now include an optional argument, 'legacy', that will revert the utility to the R2012b behavior. The use of 'legacy' must be investigated.
Steps To ReproduceRun any of the following regression tests:
restartrecord_test (with or without 'SRIF' argument)
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
ravidavi (administrator)
2013-04-26 23:44

The 'legacy' option will be added to function calls where needed. However, a long term solution should be found for the affected ODTBX functions.

For example, ominusc() contains the code:

    ig = [];
    for k = 1:m

which effectively gets a list of column indices for each column in dy that contains at least one number. This could potentially be replaced with:

    ig = find(any(~isnan(dy)));

These types of code changes avoid expensive utilities such as union(). We should see where else in ODTBX we can use these types of code changes.
ravidavi (administrator)
2013-04-29 20:23

The 'legacy' option was added as needed to pass all regression tests.

See public repo commit 9d0bd5d.
ravidavi (administrator)
2013-05-10 18:15

Fixed pending CCB approval.
ravidavi (administrator)
2013-05-13 14:05

Closed per CCB approval.
carpente (manager)
2014-03-07 18:06

The additional change to ominusc mentioned in [^] appears to have been made at some point after this issue was closed. That change is not correct, because introducing "any" into the logic results in a single pass/fail outcome, rather than a list of indices of the valid measurements. The correct change should have been:

ig = find(~isnan(dy);
carpente (manager)
2014-03-07 18:25

There is another problem. I don't know how long Matlab has worked this way, but if you use a column vector as the value array for a for loop, it doesn't assign the index to each element of the array, as it it does for a row array. This is described in the Mathworks documentation. The for loop in ominusc just after the creation of the ig array has this problem since ig is a column array.
carpente (manager)
2014-03-07 18:37


ig = find(~isnan(dy);

doesn't work if dy is a matrix, so the originally intended change in 3347 should have been the one to get implemented (or something functionally equivalent if union is too slow).

- Issue History
Date Modified Username Field Change
2013-04-26 22:33 ravidavi New Issue
2013-04-26 22:33 ravidavi Status new => assigned
2013-04-26 22:33 ravidavi Assigned To => ravidavi
2013-04-26 23:44 ravidavi Note Added: 0003347
2013-04-29 20:23 ravidavi Note Added: 0003348
2013-04-29 20:43 ravidavi Steps to Reproduce Updated View Revisions
2013-05-10 18:15 ravidavi Note Added: 0003359
2013-05-10 18:15 ravidavi Status assigned => resolved
2013-05-10 18:15 ravidavi Resolution open => fixed
2013-05-13 14:05 ravidavi Note Added: 0003365
2013-05-13 14:05 ravidavi Status resolved => closed
2014-03-07 18:06 carpente Note Added: 0003407
2014-03-07 18:06 carpente Status closed => feedback
2014-03-07 18:06 carpente Resolution fixed => reopened
2014-03-07 18:25 carpente Note Added: 0003408
2014-03-07 18:37 carpente Note Added: 0003409

Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker