Inner Matrix Dimension must agree

Error using * Inner matrix dimensions must agree.
K5 = 0.09*(L2/0.115) * (B.^4/(1-B.^4));

답변 (2개)

madhan ravi
madhan ravi 2018년 10월 9일
편집: madhan ravi 2018년 10월 9일

0 개 추천

K5 = 0.09.*(L2/0.115).* (B.^4/(1-B.^4));
Remark: Make sure the sizes of L2 and B are the same

댓글 수: 2

Shikhar
Shikhar 2018년 10월 10일
the size of L2 and B is 88x1.
madhan ravi
madhan ravi 2018년 10월 10일
Didn’t it solve the problem?
Jan
Jan 2018년 10월 9일

0 개 추천

It is not clear what you want to achieve.
C1 = 0.09 * (L2 / 0.115); % More efficient: (0.09 / 0.115) * L2
C2 = B.^4 / (1 - B .^ 4); % Or:
C2 = B.^4 ./ (1 - B .^ 4); % ??? More efficient: 1 / (1 / B .^4 - 1)
K5 = C1 .* C2;
If this does not help, post the dimensions of the inputs and explain, what you want to calculate and expect as result.

댓글 수: 2

Shikhar
Shikhar 2018년 10월 10일
The equation is Stolz eqn to find the coefficient of discharge, as a whole my eqn looks like this,
C = (0.5959*B.^0)+(0.0132*B.^2.1)-(0.1840*B.^8)+(((10^6)/(Re)).^0.75)*((0.0029*B.^2.5))+0.09*((L2.*1000)/115).*(B.^4./(1-B.^4))+0.0337*(L1/B).*B.^3
Earlier I was taking individual parts of the algebraic sum as K1, K2, K3, K4, K5 and finally substituting the values to form the same thing I mentioned above, but that too yields the same error.
B is the ratio of diameter, L1 is the distance of station from upstream and L2 is same from downstream. Re is the reynolds number.
Shikhar
Shikhar 2018년 10월 10일
the size of all the variables is 88x1.

이 질문은 마감되었습니다.

제품

릴리스

R2016a

질문:

2018년 10월 9일

마감:

2021년 8월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by