Abnormal results using + operator in matlab 2018a
2 次查看(过去 30 天)
显示 更早的评论
Hello every one.Found this problem while using matlab where vectors of different sizes were added and a matrix was given as a result.Can any anyone explain whats happening.

0 个评论
采纳的回答
Guillaume
2018-7-27
"Can any anyone explain whats happening"
That is the behaviour of matlab since R2016b introduced implicit expansion. If you want element wise addition of the vector elements make sure your vectors are in the same direction. What you see now is equivalent to
bsxfun(@plus, A, B)
in versions prior to R2016b.
Much has been written about implicit expansion. No point complaining about it, it's not going to change. In my opinion, your operation should have been an error in <R2016b.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!