Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: very large array
Replies: 18   Last Post: Jun 26, 2013 2:53 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Lorenzo Quadri

Posts: 8
Registered: 6/24/13
Re: very large array
Posted: Jun 24, 2013 12:27 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

dpb <none@non.net> wrote in message <kq9r5n$21t$1@speranza.aioe.org>...

> Now you're not incrementing i so you'll process the same row over and
> over and over...
>
> While doing it by a loop is _NOT_ the way for large cases, sometimes it
> is handy and time isn't an issue for small array sizes. The way in
> general to do such things is to start at the end and progress
> forwards--that way the lower indices aren't affected by the deleted rows...
>
> for i=length(dat):-1:1
> if((sum(dati(i,:))<355) & range(dati(i,:))>20)
> dati(i,:) = [];
> end
> end
>
> Now it won't run off the end (but it will still run a _loooong_ time,
> methinks...
>
> See other comments on "why" and perhaps a more-quicker way of breaking
> it into chunks if you're causing memory paging w/ it in one full array
> in (virtual) memory.
>


Thanks for your answer :),
I'm actually decreasing the variable i (certainly not in that piece of code that I posted for example excuse me for such example :)) ) Seems to me that in reality it takes a a lot to decrease the array, it seems that every time rebuilds the index or a sort of it.

Thanks a lot



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.