When using interp3, do the input grids need to have evenly spaced values?
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Blenndrman
el 7 de En. de 2020
Comentada: Blenndrman
el 7 de En. de 2020
When using interp3, do the input grids need to have evenly spaced values? In other words, I need to know how to avoid the "Input grid is not a valid MESHGRID" error, despite the requirement that I use a specific set of input grids upon which I need to interpolate.
0 comentarios
Respuesta aceptada
John D'Errico
el 7 de En. de 2020
No. They do not need to be EVENLY spaced. So a grid spacing of [1 2 4 8 15 17 23 100] is entirely valid. Though depending on the shape of your function, it may produce good or bad interpolation results. Long stretches where the function is highly nonlinear are a problem.
You do need a grid however. Something, for example, that meshgrid would have produced. If you don't understand that, then you need to read the help for meshgrid carefully. Such a grid will be aligned with the axes of your coordinate system, though, again, they need not be purely linear and uniform along those axes.
You CANNOT have scattered data, so data where the points do not lie on a cartesian grid.
Be careful, as there is a difference between ndgrid and meshgrid. meshgrid produces the ordering you will need, and only meshgrid.
Más respuestas (0)
Ver también
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!