MATLAB: Help me please i am not understanding the problem with this matrix….

horzcatmatrix manipulation

Error using ==> horzcat
CAT arguments dimensions are not consistent.
Error in ==> case1 at 40
N= [z w -u 0; -E*z' -E*w' E*u' 0];

Best Answer

You have
[z w -u 0]
That is going to fail if any of z, w, or -u have more than one row, because the constant 0 only has one row. If you want to add on a column of 0 values, then you need to provide a value which is a column of zeros, such as you might get from zeros(size(z,1),1)
Related Question