interpolation of scattered Datas with concave boundary. contourf plot of scattered datas
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hello.
I want to plot my surface Solutions from Ansys Fluent in a contourf-Plot with Matlab. The Solution is a table in the ASCII-Format with scattered points (x,y,z) which decribe a plane and a temperature is given at each of those points.
On the first picture you can see a Scattered Plot with all Points and temperature-colored. Here you can see the correct geometry of the boundary.

But if I want a contourplot, I need to interpolate the scattered points. On the next picture you can see the result. The Problem is, that matlab interpolate "through" the boundary for example at the bottom. I think the problem has something to do with the "concave" boundary and the Delauney-Triangulation.

My Code
clear all
close all
clc
data_txt = importdata('file'); % 5Columns: NodeNumber, x,y,z,temperature
data_int = scatteredInterpolant(data_txt.data(:,3),data_txt.data(:,4),data_txt.data(:,5),'natural','none');
x_min=min(data_txt.data(:,2));
x_max=max(data_txt.data(:,2));
y_min=min(data_txt.data(:,3));
y_max=max(data_txt.data(:,3));
z_min=min(data_txt.data(:,4));
z_max=max(data_txt.data(:,4));
x = x_min:0.0001:x_max;
y = y_min:0.0001:y_max;
z = z_min:0.0001:z_max;
[Y, Z] = meshgrid(y, z);
data_int_ = data_int(Y,Z);
figure_handle=figure;
contourf(Y,Z,data_int_,100,'Edgecolor','none');
In this case, the x-Coodinate is constant. I can do this with every coordiante by using a Rotation-Matrix. Than I have a x,y,data problem.
Is there a way to interpoalte my scattered points, but to get my correct boundary shape? How can i stop Matlab to interpolate in regions, where no datas available?
Please help me!
1 Kommentar
Arvind Narayanan
am 5 Mär. 2018
Can you share the input data? Will help understand the behavior of the plot.
Antworten (0)
Siehe auch
Kategorien
Mehr zu Scatter Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!