Note: What I wrote above assumes that you have exactly 1 million rows. If not, you need to either modify the number of rows and columns in the command (for example, if you have 1200000 rows, use reshape(A,600000,2) or reshape(A,400000,3) and so on) or "pad" the vector (e.g., add zeroes until the vector has 1 million rows)
Main Topics
Browse All Topics





by: Eyal-fPosted on 2008-12-04 at 23:55:20ID: 23103112
I'm not sure exatcly what you want to do. Do you want to just cut off the last 500,000 lines? If so, use (if A is your matrix)
1000000,1) ]
A=A(1:500000)
or
A(500001:1000000)=[]
or whatever other indices you want to keep (in the first case) or discard (in the second).
If you want to keep all the data, you can use reshape. I don't have Matlab in front of me at the moment, but it should be something like A=reshape(A,500000,2)
Alternatively, a clunkier version would be
A=[A(1:500000,1),A(500001: