How to add zero points in a function
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Yian Chen
el 23 de Oct. de 2021
Comentada: Image Analyst
el 24 de Oct. de 2021
Right now I have a function h = sin(2*pi*50*t) with 27 samples, and I want to add 500 zeros to the end of the 27-signal-long signal. How can I mke it?
fs = 250;
t = (0:1/fs:(0.108-.5/fs)); % [0, 0.108)
h = sin(2*pi*50*t);
L = 27;
f = fs*(0:L-1)/L;
0 comentarios
Respuesta aceptada
Image Analyst
el 23 de Oct. de 2021
If h is your signal, assign the last element to be zero
h(527) = 0;
The in between values will be automatically filled with zeros.
2 comentarios
Image Analyst
el 24 de Oct. de 2021
clc
clear all
close all
fs = 250;
t = (0:1/fs:(0.108-.5/fs)); % [0, 0.108)
h = sin(2*pi*50*t);
L = 27;
f = fs*(0:L-1)/L;
h(527) = 0;
Más respuestas (0)
Ver también
Categorías
Más información sobre Discrete Fourier and Cosine Transforms en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!