How do I modify my x data to be a specific length?
Mostrar comentarios más antiguos
I have some x data and y data which I want to plot.
My x data looks like this: [326,406,406,449,491,491,1353,1353,2379,2379, ...]
the corrosponding y data looks like this: [3.46,3.48,3.48,3.48,3.49,3.49,3.49,3.49,3.49,3.49, ...]
Imagine I want to modify my x data in such a way that it is of fixed length.
But simply slicing like this for exmaple: x = x(1:100) would not be good, because then I would also loose the data after the 100th x data point.
I need it to be this way: Having x data as an array of fixed length but also modifying y data in such a way that I don't see a difference when I plot y vs x (except for the fact that x now has a different length and different values, e.g. from 1:100).
I hope you understand what I'm trying to do. I was playing around with interp1 but sadly I did not achieve anything useful.
Thanks in advance!
1 comentario
Luca Tatas
el 20 de Ag. de 2022
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Multirate Signal Processing 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!

