MATLAB: Error: In an assignment A(:) = B, the number of elements in A and B must be the same.

MATLABmatlab function

I have problem at this line of the code
u(ii+1)=(P_hat/K_hat);
Where u is a vector of 1×1560 and p and k are vector of 1560×1
Please help me to solve this.

Best Answer

u(ii+1)=(P_hat/K_hat).';