The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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  

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$>...
> 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]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.