Trouble with for-loop and fft
Mostrar comentarios más antiguos
So the error I
get in my code i am not understanding see attached code and error
get in my code i am not understanding see attached code and errorRespuesta aceptada
Más respuestas (1)
dpb
el 13 de Ag. de 2021
What's the purpose of the loop over k?
You have the time history apparently as variable x_0_003 in the table which one presumes will be the third column.
If you want the FFT() of it, just write
xdft=fft(signal.x_0_003,n)/L;
There doesn't seem any point in the for...end loop at all.
NOTA BENE:
There's also no need to create copies of the table data into local variables time and volts; use the table variables directly. You could fix up the names in the table to be more meaningful either on input or later --
signal.Properties.VariableNames(2:3)={'Time','Volts'};
and then use
plot(signal.Time,signal.Volts)
Categorías
Más información sobre Transforms en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!