From: Peter Smith on 13 Aug 2010 15:38 Hi all, i posted this message moments ago i am looping through a number of matrices, they all contain a vector tmptime I want to tell matlab to delete all rows of tmptime after row 800 The length of rows vary between matrices. How can i tell matlab to just delete after 800 rows without specifying the final row. Please could someone help i am very stuck Someone kindly replied tmpTime(800:end)=[] However, some matrices do not have 800 rows, whilst some have significantly more. I get an error message due to some not having 800 rows. Is it possible to tell matlab, something like, if they exist, delete after 800 rows? Please could someone help?
From: Walter Roberson on 13 Aug 2010 15:41 Peter Smith wrote: > Someone kindly replied tmpTime(800:end)=[] I believe they used 801 not 800, as you wanted to delete the ones *after* 800. > However, some matrices do not have 800 rows, whilst some have > significantly more. > I get an error message due to some not having 800 rows. > > Is it possible to tell matlab, something like, if they exist, delete > after 800 rows? tmpTime(min(800,end)+1:end) = [];
From: Matt J on 13 Aug 2010 15:45 "Peter Smith" <fe09ae(a)mail.wbs.ac.uk> wrote in message <i446us$k4q$1(a)fred.mathworks.com>... > However, some matrices do not have 800 rows, whilst some have significantly more. > I get an error message due to some not having 800 rows. > > Is it possible to tell matlab, something like, if they exist, delete after 800 rows? ====== if length(tmpTime)>=800, tmpTime=tmpTime(1:800); end
From: Sean on 13 Aug 2010 15:46 "Peter Smith" <fe09ae(a)mail.wbs.ac.uk> wrote in message <i446us$k4q$1(a)fred.mathworks.com>... > Hi all, i posted this message moments ago > > i am looping through a number of matrices, they all contain a vector tmptime > > I want to tell matlab to delete all rows of tmptime after row 800 > The length of rows vary between matrices. > > How can i tell matlab to just delete after 800 rows without specifying the final row. > > Please could someone help i am very stuck > > Someone kindly replied tmpTime(800:end)=[] > However, some matrices do not have 800 rows, whilst some have significantly more. > I get an error message due to some not having 800 rows. > > Is it possible to tell matlab, something like, if they exist, delete after 800 rows? > > Please could someone help? if size(matrix,1) >=800 %size of the matrix first dimension (i.e. number of rows) delete... end
From: Peter Smith on 13 Aug 2010 15:46 Walter i am very greatful.
|
Next
|
Last
Pages: 1 2 Prev: Image fusion using pca Next: Sparse matrix and ill defined linear equation |