"Matrix dimensions must agree".
not too sure why this is.
The error is pretty simple. You will get this error, when you try to add, multiple two matrices which do not obey the rule of addition and mulitplication.
A = rand(3) ; B = rand(2);
In your case too the same thing is happenin. Try to learn how to run the code in debug mode. Run in debug mode, check the dimensions of each and every array and see why the dimensions are no compatible.
2 Comments
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/664073-error-message-saying-matrix-dimensions-must-agree#comment_1165438
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/664073-error-message-saying-matrix-dimensions-must-agree#comment_1165438
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/664073-error-message-saying-matrix-dimensions-must-agree#comment_1165468
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/664073-error-message-saying-matrix-dimensions-must-agree#comment_1165468
Sign in to comment.