Also, what does a--c mean? That doesn't have meaning in the context you're using it in.
You probably want either the max( of a--c) or sum(). I'm guessing max based on context.
I would suggest finding max and looping up to that value to set G vars to 1.
Array gv(4) g1-G4 (4*0);
max_count = max(a,b,c);
do i=1 max_count;
g(i) = 1;
end;
... View more