regarding 'FOR LOOP' use to plot discrete impulse response

3 visualizaciones (últimos 30 días)
Darshan Manjunathrao Chawan
Darshan Manjunathrao Chawan el 24 de Ag. de 2020
Respondida: Jan el 25 de Ag. de 2020
I have 'n' delay elements and 'n' amplitudes. Suppose I want to fix it all the array elements in 'for loop' instead of writing all the 'n' elements everytime in MATLAB . How can I do it? Thereby I want to plot 'discrete impulse response'.
delay = [1 1 1 1 1 1 1 1 1 1 1 ..................................] - 500 elements
amplitudes = [ 0.1 0.1 0.1 0.1 ....................................] - 500 elemnts
delay vs amplitude for discrete plot.

Respuestas (1)

Jan
Jan el 25 de Ag. de 2020
The question is not clear yet. Do you mean:
delay = repmat(1, 1, 500);
amplitiudes = repmat(0.1, 1, 500);
% Alternatively:
delay = zeros(1, 500);
delay(:) = 1;

Categorías

Más información sobre Loops and Conditional Statements en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by