Mapping x values and dimensions

Hi all,
I have two sets of data (both containing columns for x, f(x), and g(x)) which I'll need to do some matrix multiplication and plotting with. The issue is that neither the dimensions of the two data sets nor the x values themselves are the same.
I've attached small subsets of the files to illustrate the problem. For the full range of values (200-1100), the test1 data would obviously have many, many more data points.
So I essentially need to rebuild the tests file to contain as many data points as the test1 file, with the same test1 x ("wave") values, and f(x) ("n") and g(x) ("k") values interpolated using the behaviors from the tests data. I suppose I'll also need to delete the real x, f(x), and g(x) values in tests to preserve the dimensions, ultimately leaving me with an entire data set of interpolated data. Does anyone have any elegant or inelegant solutions for this?
Bonus question: I have a third file which I will have to apply the same fix for, but which has one additional problem. The x ("wave") range starts around 250 and ends at 1000 rather than 200-1100. How do I interpolate values at the beginning or end of a data set?
Thanks for the help!

2 comentarios

KSSV
KSSV el 1 de Ag. de 2018
Read about interp1
jonas
jonas el 1 de Ag. de 2018
For your bonus question, interp1 has an option for extrapolation

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Interpolation en Centro de ayuda y File Exchange.

Preguntada:

J N
el 31 de Jul. de 2018

Comentada:

el 1 de Ag. de 2018

Community Treasure Hunt

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

Start Hunting!

Translated by