Changes with array operations in 2016a prerelease vs 2016a?

1 vue (au cours des 30 derniers jours)
T
T le 16 Mar 2016
Commenté : Steve Eddins le 16 Mar 2016
Anyone notice or find documentation on changes to matrix operations functionality between 2016a pre-release and full version, specifically for element-by-element binary operations (versus having to use the bsxfun)? I wrote some code in the 2016a prerelease which required a lot of computations involving multiplying row and column vectors with arrays of varying dimensions, and was somehow able to do this in the prerelease with just element wise notation (I thought maybe this was a now built in for arrays of size m by 1, or 1 by n??). I'm now having to revert back to using bsxfun() for array multiply, plus, etc. Did I miss something in the documentation or am I (hopefully not) going crazy?
Cheers,
  3 commentaires
John D'Errico
John D'Errico le 16 Mar 2016
Yes. If you did write code that operated differently/successfully in 2016a(pre) please show an example or two.
T
T le 16 Mar 2016
Simplest example:
>> ones(1,4).*ones(20,1)
2016a prerelease:
ans =
% 20 by 4 array of ones
2016a full:
% Gives error
And for reference, an example line of my code that had to be changed from pre to work in full.
2016a prerelease:
V_R = sqrt((Vrp_a+vi).^2+(Vaz_perp + omega_r_mid - ui).^2);
2016a full:
(had to modify slightly to work)
V_R = sqrt((Vrp_a+vi).^2+(bsxfun(@plus,Vaz_perp,bsxfun(@times,omega_r_mid,ones(1,azm)))-ui).^2);
(Vector sum of velocities along rotor blade section, omega_r_mid is a column vector, vi and ui are arrays that have the same height as omega_r_mid but change in length depending on other user input parameters, the rest of the variables are 1x1's).
Thanks for the quick responses!

Connectez-vous pour commenter.

Réponse acceptée

Steve Eddins
Steve Eddins le 16 Mar 2016
No, you are not going crazy. We were trying some new behavior in the prerelease for some operators and functions. Testing revealed some issues we needed to address, so we pulled the change from the final R2016a release. The prerelease documentation did not include information about the change.
  2 commentaires
T
T le 16 Mar 2016
Thanks Steve. Any chance that some of these changes will be included in future releases or there being some sort of toggle to enable this behavior for simple operations? Avoiding using the bsxfun() (shown in the example I pasted in the comments) was really helpful.
Steve Eddins
Steve Eddins le 16 Mar 2016
I like your code without the bsxfun calls a lot better. Stay tuned.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Matrix Indexing dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by