Matrices must agree error
이전 댓글 표시
I need help on why it's not solving this problem for me. I trying to solve this problem. A horizontal trough 18 ft long has ends in the shape of an isosceles right triangle (see the figure below). If water is poured into it at the rate of 4.00 ft3/min, at what rate is the surface of the water rising when the water is 5.00 ft deep? It keeps on saying that matrices aren't agreeing. I'm not sure why it's saying that

댓글 수: 3
Matt J
2020년 12월 5일
Please post code in code wells like below, rather than as images. It makes it easier for us to copy and manipulate. Also please copy/paste full error messages into your post, rather than summarizing them in your own words, so that we have all the information.
h=5
v = 1/2*3*h*18
t=linspace(0,5)
4 == diff(v)./diff(t)
Avery Frick
2020년 12월 5일
Walter Roberson
2020년 12월 5일
Your v is scalar because your h is scalar. diff() of a scalar is empty. diff(t) is not empty but empty divided by not-empty is empty. So the right hand side is empty, but the left side of the == is not empty and you have a problem.
Reminder: v/t would be a rate and you are comparing the rate to a depth, which does not match.
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!