Change of set function in the future
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I've read the release notes of Matlab 2012a and found this: ReleaseNotes: Change of set functions. This does not concern 2012a! Then the output of unique etc. will contain the index of the first occurence and the indices are column instead of row vectors.
Does this change affect your work? Will it be a benefit for you? How many lines of code do you have to check to see, if you old programs will be compatible with this midification of standard functions?
0 comentarios
Respuesta aceptada
Penny Anderson
el 2 de Mzo. de 2012
Hi Jan,
The good news is that you have quite some time - several releases - in which to evaluate the impact of this change on your large code base. It need not be as complicated as you outline above.
1. Simply add a trailing 'R2012a' flag to all occurrences of the set functions in you code and run your test suite. 2. Any tests that fail - go back and change the 'R2012a' flag to 'legacy'. Re-run and those tests should now pass.
We understand large MATLAB codes exercising some of our oldest and most powerful features exist, and make it difficult to change those functions, even if the change is really a bug fix. Our hope is that by offering this phased approach to evaluate and buy into the new behavior will give customers a comfortable window in which to adopt it.
Please be in touch if you have other comments. They are always welcome!
Penny Anderson MathWorks, Inc.
3 comentarios
Mike Hosea
el 28 de Ag. de 2012
I am not aware of any significant bugs, but I am aware of several silly edge cases, such as union(zeros(0,1),zeros(0,1)) returning zeros(1,0). A collection of such bugs provided the impetus to examine the set functions thoroughly and holistically. The new versions enforce clear rules about output shapes, even in degenerate cases. Some useful functionality/flexibility was added in addition to fixing the bugs. Backward incompatibilities were a foregone conclusion with or without the added functionality, so once it was decided to have the 'R2012a' and 'legacy' flags to ameliorate that problem (with apologies to Jan, who understandably may not have felt adequately accommodated by it), I guess some liberty was taken to make the new default behavior what it arguably should have been all along vis-a-vis 'first' and 'last'.
Más respuestas (1)
Ver también
Categorías
Más información sobre Introduction to Installation and Licensing en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!