필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

need help in iteration.

조회 수: 4 (최근 30일)
ker fang fang
ker fang fang 2015년 1월 13일
마감: MATLAB Answer Bot 2021년 8월 20일
hi, can someone show me how to do a more complicated iteration process? i really need some examples.
  댓글 수: 2
Geoff Hayes
Geoff Hayes 2015년 1월 13일
ker - what type of iteration process are you interested in? while loops, inner for loops, or something else? Please be more specific as your question is much too general.
ker fang fang
ker fang fang 2015년 1월 13일
편집: Geoff Hayes 2015년 1월 13일
xrange = 0:24;
a= [ 1 5 15 18 10 9 6 4 12 11];
b = (a+2*a); %function
b;
best = min (b);
N=100;
v = 0;
x = a;
for i = 1:N
v = velocity(i);
velocity(i+1) = 0.9*velocity(i) + 2*(0.5)*(b-a)+2*(0.5)*(best - a);
xnew = a + velocity(i+1);
d = xnew + 2*xnew;
d;
b1 = sum (b);
d1 = sum(d);
if d1>b1;
result = a;
else if b1>=d1;
result = xnew;
end
end
this is the example of my code, how do i replace the new velocity value into the velocity equation?

답변 (0개)

이 질문은 마감되었습니다.

태그

Community Treasure Hunt

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

Start Hunting!

Translated by