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: Code Optimization
Replies: 2   Last Post: Mar 5, 2013 10:46 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View  
Marc

Posts: 108
Registered: 7/2/10
Re: Code Optimization
Posted: Mar 5, 2013 10:46 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

anyone <jaup@h/WSWLG{nR1³qHe> wrote in message <513512fc$0$64351$c3e8da3$5e5e430d@news.astraweb.com>...
> On Sun, 03 Mar 2013 20:27:08 +0000, Tom Mathews wrote:
>

> > Does any one know a faster way to implement these lines of code...
> >
> > p=172;q=320;
> > for n=1:101376
> > Data_new(n,:)=resample(Data(n,:),p,q);
> > end
> >
> >
> > here Data is 101376x300 matrix...
> >
> >
> > One time run isn't that long but when I using the for loop its taking a
> > lot of time...

>
> 'resample' treats columns of "Data()" as 300 vectors, and will interpolate between points according to your chosen
> ratio. how 'bout you stop repeating that effort 101,375 additional times?


Per Anyone's suggestion, does this give you your desired answer...

DataNew = resample(Data, p, q); % ???

This is taking 0.8 seconds give or take on 64 bit Mac version, 2.6 ghz, 8gb ram...



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.