clc; close all; clear all; x=[1 0 1 1 0 1]; nx=size(x,2); sign=1; i=1; while i