Abnormal results using + operator in matlab 2018a

조회 수: 1 (최근 30일)
SandeepKumar R
SandeepKumar R 2018년 7월 27일
댓글: SandeepKumar R 2018년 7월 27일
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.

채택된 답변

Guillaume
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.
  댓글 수: 1
SandeepKumar R
SandeepKumar R 2018년 7월 27일
Thanks for the reply.No complaints here but didn't know what was happening. Thanks a lot.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by