MATLAB: Error using vertcat Dimensions of arrays being concatenated are not consistent.

consistent dimemensions

High everyone, I am unsuccessful in getting consistent dimensions for t and y in this code:
https://www.dropbox.com/s/7sz6gli891k0u4l/simultaneousEquations1.m?dl=0
What can I do?

Best Answer

I prefer spaces around each operator and keeping the parentheses only, where they improve the readability. Compare:
1.7e-3 -(y(12))*(y(14))/(y(10))
6.55e-8 -(y(12))*(y(15))/(y(14))
6.24-(y(12))*(y(13))/(y(8))
5.68e-5-(y(12))*(y(11))/(y(13))
5.3e-8 - (y(12))*(y(16))
(y(3))-(y(8))-(y(13))-(y(11))
(y(4))-(y(10))-(y(14))-(y(15))
(y(5))-(y(10))-(y(14))-(y(15))];
with
1.7e-3 - y(12) * y(14)) / y(10); ...
6.55e-8 - y(12) * y(15)) / y(14); ...
6.24 - y(12) * y(13) / y(8); ...
5.68e-5 - y(12) * y(11) / y(13); ...
5.3e-8 - y(12) * y(16); ...
y(3) - y(8) - y(13) - y(11); ...
y(4) - y(10) - y(14) - y(15); ...
y(5) - y(10) - y(14) - y(15)];
Consider Stephen's advice to avoid ambiguities in the code. The less readable the code is, the harder is it to debug. Splitting the calculations into separate lines is a good idea.
Related Question