Info

Questa domanda è chiusa. Riaprila per modificarla o per rispondere.

optimize code regarding for loop

1 visualizzazione (ultimi 30 giorni)
Sara
Sara il 11 Lug 2012
Chiuso: MATLAB Answer Bot il 20 Ago 2021
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 Commento
Doug Hull
Doug Hull il 11 Lug 2012
Why would you want to? what is the goal of doing this?

Risposte (0)

Questa domanda è chiusa.

Community Treasure Hunt

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

Start Hunting!

Translated by