Inner Matrix Dimension must agree

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

Answers (2)

madhan ravi
madhan ravi on 9 Oct 2018
Edited: madhan ravi on 9 Oct 2018
K5 = 0.09.*(L2/0.115).* (B.^4/(1-B.^4));
Remark: Make sure the sizes of L2 and B are the same

2 Comments

the size of L2 and B is 88x1.
Didn’t it solve the problem?
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 Comments

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.
the size of all the variables is 88x1.

This question is closed.

Products

Release

R2016a

Asked:

on 9 Oct 2018

Closed:

on 20 Aug 2021

Community Treasure Hunt

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

Start Hunting!