Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
NCTM or The Math Forum.



Re: truncation problem
Posted:
Jan 9, 2014 11:36 PM


On 1/9/2014 8:27 PM, Mohammad Sayeed wrote: > Hello I need to truncate my data base like following: > Say, I have a vector like this: > 1 > 2 > 3 > 4 > 1 > 2 > 3 > 4 > 1 > 2 > 3 > 4 > from 1 to 4 the numbers are repeating. I need to remove 1st and 4th row from >each repeated 4 rows. so that the data will look like > 2 > 3 > 2 > 3 > 2 > 3 > I tried but failed to do that with MATLAB as I am a new MATLAB user. >If any one can help me it will be much appreciated. >
If the data is just as gives, you can simply repmat the section of interest:
 N=length(A); repmat(A(2:3),N/4,1)
2 3 2 3 2 3 
if you have a more general case, then you'd need a more general solution.
Nasser



