Inner Matrix Dimension must agree

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

Respuestas (2)

madhan ravi
madhan ravi el 9 de Oct. de 2018
Editada: madhan ravi el 9 de Oct. de 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 comentarios

Shikhar
Shikhar el 10 de Oct. de 2018
the size of L2 and B is 88x1.
madhan ravi
madhan ravi el 10 de Oct. de 2018
Didn’t it solve the problem?
Jan
Jan el 9 de Oct. de 2018
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 comentarios

Shikhar
Shikhar el 10 de Oct. de 2018
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 el 10 de Oct. de 2018
the size of all the variables is 88x1.

La pregunta está cerrada.

Productos

Versión

R2016a

Preguntada:

el 9 de Oct. de 2018

Cerrada:

el 20 de Ag. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by