Help creating and manipulating grids

Hello everybody,
I need the expertise of the Matlab community for a problem concerning grid creation and manipulation.
I have 2 vectors, featuring X and Y data, and anothe one, which contains values of the data for the X-Y pairs. I obtained a grid using meshgrid, so to be able to plot and visualize the data.
Here comes the first question, are the interpolated values calculated at the nodes of this grid?
Going on with the task, at this point I need to visualize (plot) the grid I generated, how can I do that?
As well, I would need a way to create cells from the information I have about the nodes (if my guess about my first question is correct).
After, I need to be able to identify each cell, to identify the neighbor cells of each cell, and then to extract the values of the data at the boundary between each cell. How do I do it?
I am having a look around since some time, but still haven't found an answer to my questions.
Any help is highly appreciated.
Best regards.

Réponses (1)

Walter Roberson
Walter Roberson le 8 Mai 2018

0 votes

"are the interpolated values calculated at the nodes of this grid?"
To that point, you have not done any interpolation, so we do not know.
"Going on with the task, at this point I need to visualize (plot) the grid I generated, how can I do that?"
Typically with surf(), but more generally it depends on the kind of plot you need and the number of dimensions you are working with.
"I would need a way to create cells from the information I have about the nodes"
What kind of cells?
Is your X and Y and resulting data scattered information, or do you have data that can be reshaped into a rectangular grid?
When I look at your questions I have to wonder if perhaps you have scattered data, and if you are perhaps talking about veroni cells ?

3 commentaires

Maria Angela Agizza
Maria Angela Agizza le 14 Mai 2018
Hello and many thanks for your answer.
After a little bit more of digging around and testing, I realize I need to slightly modify my question. I write it here a comment, I don't know if I should modify my question as well. I hope you and someone else can take the time to read this and answer.
I applied a grid to the data using the command "griddata". Here There is a first problem, as my data has no clear shape, and I get interpolation outside the domain. Is there a way to avoid that?
Now, that I applied the interpolation, I can imagine my domain mapped with a certain number of cells.
Next task I need to fulfill, is to extract fluxes for one cell to all the adjacent cells, so a way each cell gets a sort of a number, and recognizes the cells it is in direct contact with. Is there, to your knowledge, a to do that?
Many thanks and best regards.
How do you know which points are "outside the domain" as compare to points that are inside the domain but do not happen to have any data?
For example,
1+++
++2+
++++
the 2 is clearly inside the domain, but is the 1 outside the domain or is it inside the domain but does not happen to have data?
Does direct contact include diagonal?
Maria Angela Agizza
Maria Angela Agizza le 15 Mai 2018
Modifié(e) : Walter Roberson le 15 Mai 2018
Hello, thanks for replying again.
About the interpolation outside the boundary, I posted another question here https://de.mathworks.com/matlabcentral/answers/400688-interpolation-outside-the-domain-meshgrid-and-griddata . I supposed that splitting the question and providing images would have been easier. Of course, any help is appreciated there as well.
About my question here, how would you accomplish the task about the fluxes from one grid cell to the other?
Many thanks and best regards.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Interpolation dans Centre d'aide et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by