Info

This question is closed. Reopen it to edit or answer.

matrix dimensions must agree error

1 view (last 30 days)
Roslyn Hurry
Roslyn Hurry on 20 Apr 2020
Closed: MATLAB Answer Bot on 20 Aug 2021
getting matrix dimensions must agree error with this line of code:
k = A.*(p.^2);
  1 Comment
Sriram Tadavarty
Sriram Tadavarty on 20 Apr 2020
Edited: Sriram Tadavarty on 20 Apr 2020
What are the values of A and p?

Answers (1)

Sriram Tadavarty
Sriram Tadavarty on 20 Apr 2020
Hi Roslyn,
I assume you provided an incompatible matrix size for the operation to be performed. You can look over this page for more insights of what might went wrong and will solve the issue. https://www.mathworks.com/help/matlab/matlab_prog/compatible-array-sizes-for-basic-operations.html
You can even go through the documentation of times function.
Hope this helps. Regards, Sriram

This question is closed.

Community Treasure Hunt

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

Start Hunting!