Can MATLAB show the dimensions of matrices when outputting a dimension mismatch error?

1 view (last 30 days)

Accepted Answer

MathWorks Support Team
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.

More Answers (0)

Tags

No tags entered yet.

Products


Release

R2015a

Community Treasure Hunt

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

Start Hunting!