Info

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

optimize code regarding for loop

조회 수: 1 (최근 30일)
Sara
Sara 2012년 7월 11일
마감: MATLAB Answer Bot 2021년 8월 20일
Hallo :
if k <= 0
int = x ;
return
end
int = zeros(1,length(x));
c=(k-1)/factorial(k-1);
dth2=dt/2;
lenx=length(x);
ft1=((lenx:-1:0)*dt).^(c);
for n = 3:lenx
y1 = x(2:n) ;
t1 = ft1(lenx-n+3:lenx+1) ;
y2 = x(1:n-1) ;
t2 = t1 +dt;
int(n) = sum (t1.*y1 + (t2.^c).*y2)*dth2 ;
end
How can I compute .^c for the line contains t2.^c , out and before the for loop?
  댓글 수: 1
Doug Hull
Doug Hull 2012년 7월 11일
Why would you want to? what is the goal of doing this?

답변 (0개)

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

Community Treasure Hunt

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

Start Hunting!

Translated by