Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

Arrayfun - for conversion

1 Ansicht (letzte 30 Tage)
Damiano Capocci
Damiano Capocci am 2 Jan. 2018
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
I want to replace for loop with arrayfun but i don't have idea. In this case there is a particular dependence the two foor's. Every element X(k+1) dependes from X(k), X(k-1),.....X(k-limit). The presence of min() function makes the index k-p always positive.
X(1)= first_step;
for k=1:length_1
for p=0:min(k-1,length_2)
X(k+1)=X(k+1)+j(p+1)*X(k-p)
end
end
My aim is to fit this code for GPU computing

Antworten (0)

Diese Frage ist geschlossen.

Community Treasure Hunt

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

Start Hunting!

Translated by