The error message means, that
and
inv(transpose(A)*A)\transpose(A)*B
do not have matching dimensions. Simply enable the debugger:
and start your code again. When Matlab stops at the error, check the sizes by typing in the command window:
size(inv(transpose(A)*A)\transpose(A)*B)
size(all_nodes.estimated(i,:))
Perhaps another problem: Does this what you expect:
row_neighbor_anchor = 1:M-1;
W = zeros(1, row_neighbor_anchor);
Now W is a multi-dimensional array with M-1 dimensions. Later on:
for j=row_neighbor_anchor
W(j,:) = ...
it looks, like you expect that W is a matrix and you add more rows to it.
Best Answer