Hello Mike. One question. What is the difference of using jj = jj+1 every other iteration and using w(end + 1) to reference the new element of w. Thanks
You could use a for loop and check every element or use this es.mathworks.com/help/matlab/ref/find.html k = find(X,n) returns the first n indices corresponding to the nonzero elements in X. As an example: a = 2*rand(16,1)-1 indexes = find(a > 0)