Rank: 2274 based on 63 downloads (last 30 days) and 2 files submitted
photo

Adrian Lara-Quintanilla

E-mail

Personal Profile:

 

Watch this Author's files

 

Files Posted by Adrian Lara-Quintanilla View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
19 Nov 2014 Screenshot Filter - smooth (calculating the moving average along a vector) This function calculates the moving average along that vector. It can be used to smooth a series. Author: Adrian Lara-Quintanilla smooth, filter, timeseries, signal processing, moving average, average 46 3
19 Nov 2014 Screenshot Find values in a vector or function For a function y=f(x), this script looks for all the "x" values for a desired value of "y" (y0). Author: Adrian Lara-Quintanilla mathematics, data exploration, time series, data management, algorithm, find 17 2
  • 3.0
3.0 | 1 rating
Comments and Ratings by Adrian Lara-Quintanilla View all
Updated File Comments Rating
17 Mar 2013 GRABIT Extract (pick out) data points off image files. Author: Jiro Doke

16 Mar 2013 Find values in a vector or function For a function y=f(x), this script looks for all the "x" values for a desired value of "y" (y0). Author: Adrian Lara-Quintanilla

Thanks, I appreciate your feedback. I have solved that just yielding the closest value of those in the vector.

Anyway, this is a very simple function. I am sure it can be optimized a lot, but it works very well for my purposes and I decided to share it with the people. I do not know how the "experts" in Matlab deals with this, but I need to use this function in almost everything I do... :)

Again, thanks for helping me to improve :)

13 Mar 2013 Filter - smooth (calculating the moving average along a vector) This function calculates the moving average along that vector. It can be used to smooth a series. Author: Adrian Lara-Quintanilla

I really appreciate your comment :), thanks!

Comments and Ratings on Adrian Lara-Quintanilla's Files View all
Updated File Comment by Comments Rating
16 Mar 2013 Find values in a vector or function For a function y=f(x), this script looks for all the "x" values for a desired value of "y" (y0). Author: Adrian Lara-Quintanilla Adrian Lara-Quintanilla

Thanks, I appreciate your feedback. I have solved that just yielding the closest value of those in the vector.

Anyway, this is a very simple function. I am sure it can be optimized a lot, but it works very well for my purposes and I decided to share it with the people. I do not know how the "experts" in Matlab deals with this, but I need to use this function in almost everything I do... :)

Again, thanks for helping me to improve :)

16 Mar 2013 Find values in a vector or function For a function y=f(x), this script looks for all the "x" values for a desired value of "y" (y0). Author: Adrian Lara-Quintanilla arnold

If I understand correctly your function can only find anything if there is at least one value <= AND one >= y. This is not necessarily the case for any given function. This is suboptimal. The function should always find at least the nearest value. imho

14 Mar 2013 Filter - smooth (calculating the moving average along a vector) This function calculates the moving average along that vector. It can be used to smooth a series. Author: Adrian Lara-Quintanilla Heinrich Acker

If you want to know what's fast, use this:

http://www.mathworks.de/matlabcentral/fileexchange/12276-movingaverage-v3-1-mar-2008

A moving average does not require to use a for loop at all, and the runtime can be almost independent from window size.

13 Mar 2013 Filter - smooth (calculating the moving average along a vector) This function calculates the moving average along that vector. It can be used to smooth a series. Author: Adrian Lara-Quintanilla Adrian Lara-Quintanilla

I really appreciate your comment :), thanks!

13 Mar 2013 Filter - smooth (calculating the moving average along a vector) This function calculates the moving average along that vector. It can be used to smooth a series. Author: Adrian Lara-Quintanilla Jan Simon

Looping over the elements of the vector is very slow for large vectors. Then looping over the elements of the window to be averaged is much faster:
function Y = movemean(X, N)
% X is filtered along 1st dimension
% Window size is 2*N+1
[d1, d2] = size(X);
M = X;
divV = ones(d1, 1);
for i = 1:N
i2 = i + i; % Slightly faster
Z = zeros(i, d2);
M = M + [Z; X(1:d1 - i2, :) + X(1 + i2:d1, :); Z];
divV(i + 1:d1 - i, :) = divV(i + 1:d1 - i, :) + 2;
end
Y = bsxfun(@rdivide, M, divV);

Contact us