필터 지우기
필터 지우기

Info

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

optimize code in running time

조회 수: 1 (최근 30일)
Sara
Sara 2012년 9월 3일
마감: MATLAB Answer Bot 2021년 8월 20일
Hi, is there any suggestion that how can I optimize the code in running time below. Thanks in advance
lenx=length(x);
int = zeros(1,lenx);
dth2=dt/2;
c=(k-1)/factorial(k-1);
cmn=(lenx:-1:0)*dt;
ft1=cmn.^(c);
ft2 = (cmn+dt).^(c);
for n = 1:lenx-2
y1 = x(2:n+2) ;
t1 = ft1(lenx-n+1:lenx+1) ;
y2 = x(1:n+1) ;
t2 = ft2(lenx-n+1:lenx+1);
int(n+2) = sum (t1.*y1 + t2.*y2)*dth2 ;
end%for

답변 (0개)

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

Community Treasure Hunt

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

Start Hunting!

Translated by