필터 지우기
필터 지우기

Need help/suggestions finding optimization parameters

조회 수: 1 (최근 30일)
Trader
Trader 2012년 5월 3일
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.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by