Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.
|
|
Marc
Posts:
82
Registered:
7/2/10
|
|
Re: Code Optimization
Posted:
Mar 5, 2013 10:46 PM
|
|
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...
|
|
|
|