Error: The expression to the left of the equals sign is not a valid target for an assignment.
2 views (last 30 days)
For some unknown reason I am getting this error on every line past line 14 (deleting the line causes the error to jump to the next line). Any help would be very much appreciated.
%Set two seeds
s1x=130; s1y=150; %Note that seed location is not central to object
seeds = [sub2ind([X Y],s1y,s1x),sub2ind([X Y]);
%Apply the random walker algorithms
rangex = 0:(X-1); %<- where the error is now
rangey = 0:(Y-1);
Jon on 23 Sep 2015
Edited: Jon on 23 Sep 2015
I can't figure out why you're getting an error, but it works if you put square brackets around the expression, like this
rangex = [0:(X-1)];
EDIT: that actually doesn't work. You're not closing your seeds = [stuffhere bracket. Ie, it should read
seeds = [sub2ind([X Y],s1y,s1x),sub2ind([X Y])];