Matlab 2016b Matrix Dimensions for addition and subtraction?
조회 수: 1 (최근 30일)
이전 댓글 표시
In previous version of Matlab if I type:
>> a = [1 2; 3 4]; >> b = [1;3];
and then attempt to execute:
>> a - b
I get an error (as I should) because the matrix dimensions don't agree.
However, if I attempt this in 2016b I get:
>> a-b
ans =
0 1
0 1
Is this a new feature? Is this seen as an improvement? If so, can I turn this off? I feel this is dangerous.
Thanks,
-mcd
댓글 수: 0
채택된 답변
James Tursa
2016년 10월 10일
편집: James Tursa
2016년 10월 10일
Yes, this is a new feature and is intentional. See this link under Implicit Expansion:
I don't see anything in the release notes that indicates you can shut this off. It is basically bsxfun that has now been implemented directly into the language.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!