function pos = get_realpos( v, changed ) % count the original label N = length(changed); pos = 0; while 1, pos = pos+1; if changed(pos) == -1, pos = pos+1; end; if changed(pos) == v, break; end; end;