Info

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

how to put iterations from a foor loop in a vector

3 Ansichten (letzte 30 Tage)
Christopher
Christopher am 5 Mär. 2013
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
What i want to achieve is my own DFT alogrithm. I want to start off by sampling the signal, x(t)=x(n(delta)T). I want to be able to run this in a for loop then take every sample value and place it in a vector Xk=[ ] which will have those sample values. Thanks.

Antworten (1)

Sean de Wolski
Sean de Wolski am 5 Mär. 2013
v = zeros(10,1);
for ii = 1:10
v(ii) = rand;
end
  1 Kommentar
Jan
Jan am 5 Mär. 2013
I would work without the pre-allocation in the 1st line, but this is essential for the performance.

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