Azzera filtri
Azzera filtri

Need help/suggestions finding optimization parameters

1 visualizzazione (ultimi 30 giorni)
I have a large vector of data that I'm performing calculations on. My calculation is dependent on the state of a leading and lagging moving average. I'm trying to find a maximum value based on moving average periods. A very simple example:
data = [big vector];
[lead,lag] = movavg(data,M,N,'e');
for M = 1:1000
for N = 1:1000
[lead,lag] = movavg(data,M,N,'e');
for i = 1:size(data)
if lead(i) > lag(i)
data(i) = data(i)-1;
else
data(i) = data(i)+1;
end
end % end N
end % end M
Instead of the 2 M,N 'for' loops I've converted the values to a matrix (trying to avoid 'for' loops). I'm interested in using an algorithm to find the best M,N combination. I would appreciate any suggestions or examples that might be able to help me out.
Thank you!
I would like to expand my M/N parameters but the # of iterations takes a long time.

Risposte (0)

Categorie

Scopri di più su Loops and Conditional Statements in Help Center e File Exchange

Tag

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by