How can I determine conditions and interpolate where necessary?

3 visualizaciones (últimos 30 días)
Stelios Fanourakis
Stelios Fanourakis el 31 de Oct. de 2019
Comentada: Stelios Fanourakis el 1 de Nov. de 2019
Hello
Assumingly we have a conditional state for most of the y values on axis and need to interpolate where necessary or where there are no conditions.
For example if we say that, while y = 3 then var = 5, what if y = 2.5, var = ??
We have information that for every y value equals to 3 the var is equal to 5 but we don't have information for y equals to 2.5 regarding the corresponding var value. In this case, an interpolation should come.
Can you please provide some code ideas?
Thank you
  2 comentarios
Dimitris Kalogiros
Dimitris Kalogiros el 31 de Oct. de 2019
If you want to "interpolate" or "extrapolate", you should have more than one pair (y, var).
You must have a set of (y, var) pairs, and you would be able to find a missing pair , lets say (y1, var1), by means of an interpolation method.
So, what data exactly do you have?
Stelios Fanourakis
Stelios Fanourakis el 31 de Oct. de 2019
Editada: Stelios Fanourakis el 31 de Oct. de 2019
I have x data which is the length of an object. Y data which is the height or the object's thickness. X data is same for both sets. Y axis data are different among sets. There is a third variable that is linked to y values. Y values are strain, 3rd variable is force and X is length of the object. Based on y values the force is changing. So different y values need to interpolate force values.

Iniciar sesión para comentar.

Respuestas (1)

Dimitris Kalogiros
Dimitris Kalogiros el 31 de Oct. de 2019
Stelio
A good solution for you problem is to use polynomial interpolation.
  1 comentario
Stelios Fanourakis
Stelios Fanourakis el 1 de Nov. de 2019
I know polynomial interpolation as I have used it before for other of my tasks. It doesn't explain me how it will interpolate the force for every different y value. Even if there are 2 variables force/thickness (y values) how can this be linked with the stationary x values. X values do not change. They are the same. Only y values and forces are changing. But I think generally polynomials is a good idea. It just needs a small modification to suit my needs

Iniciar sesión para comentar.

Categorías

Más información sobre Interpolation 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!

Translated by