Can MATLAB show the dimensions of matrices when outputting a dimension mismatch error?
1 view (last 30 days)
Show older comments
MathWorks Support Team
on 10 Mar 2015
Answered: MathWorks Support Team
on 25 Mar 2015
Can MATLAB show the dimensions of matrices when outputting a dimension mismatch error?
Accepted Answer
MathWorks Support Team
on 25 Mar 2015
MATLAB currently has no feature to output the dimensions of incompatible matrices whose operator triggers a dimension mismatch error. The following error message cannot be generated by MATLAB:
>> A = ones(88, 32);
>> B = ones(33, 99);
>> X = A*B;
Error using *
Inner matrix dimensions must agree.
A has a dimension of (r1, c1) = (88, 32)
B has a dimension of (r2, c2) = (33, 99)
c1 must be equal to r2
Instead, the following error message is standard:
>> A = ones(88, 32);
>> B = ones(33, 99);
>> X = A*B;
Error using *
Inner matrix dimensions must agree.
0 Comments
More Answers (0)
See Also
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!