Help with "Matrix Dimensions Must Agree"
Show older comments


I kept on getting an error saying "Matrix dimensions must agree. Error in LakeOntarioVolume (line 44) Y(i) = sum(c.*Z(i,:))*Dx/3;". The first loop works, but the second one doesn't even though I copied and pasted it. Any help would be appreciated, thank you.
1 Comment
Jan
on 29 Mar 2018
Posting code as text is much more convenient for answering, because in opposite to a screenshot the code can be copied and pasted.
Accepted Answer
More Answers (1)
Adam Zhang
on 29 Mar 2018
0 votes
Categories
Find more on Creating and Concatenating Matrices 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!