Error: The expression to the left of the equals sign is not a valid target for an assignment.

  • Follow


Hi,
i wrote an M file. It works, but has some problems. To work them out I tried with an easier version of the problem so that I can understand where things start going wrong.

The new program is identical to the first but for the parameters and other minor stuff.
But now I get an assignment error for this part (related to n_plus):

%compute neighborhoods
n_plus=zeros(T);
for i=1:T-1
g_r=G(:,(i-1)*3+1:(i-1)*3+3);	
	for j=i+1:T %i+N(i)
	g_c=G(:,(j-1)*4+1:(j-1)*4+4);	
		dif_g=g_c-g_r;
        if sum(sum(abs(dif_g)))==2
		n_plus(i,j)=1;
		end;
	end;
end;

The strange thing is that if I tape
n_plus=zeros(T);
in the command window, it works!
Can somebody help me?
Thanks
Marco
0
Reply marco 3/3/2010 5:11:04 PM


0 Replies
1098 Views

(page loaded in 0.006 seconds)

Similiar Articles:









7/22/2012 3:10:10 PM


Reply: