From: Steven_Lord on


"Matt J " <mattjacREMOVE(a)THISieee.spam> wrote in message
news:i447c2$ga4$1(a)fred.mathworks.com...
> "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

Remember that LENGTH returns the largest size in any dimension (or 0 if the
matrix is empty), which may not be the number of rows. Instead call SIZE
with the appropriate dimension (for the number of rows, that would be
dimension 1) input.

--
Steve Lord
slord(a)mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

From: Peter Smith on
Thanks for all your helpful mesages