Building matrices with [ ] can be picky when it comes to spaces. E.g.,
>> [1;5-3;4]
ans =
1
2
4
>> [1;5 -3;4]
??? Error using ==> vertcat
CAT arguments dimensions are not consistent.
>> [1;(5 -3);4]
ans =
1
2
4
In the second case above, because of that extra space the parser interpreted the "5 -3" as a 1x2 vector and not as a single scalar. To fix this, either get rid of all of your spaces, or use parentheses as shown.
Side Note: Your line 10 seems to be missing some E's and M's when compared to your posted equations. You might check that.
Best Answer