Borrar filtros
Borrar filtros

How to fill the discontinuities in this plot??

3 visualizaciones (últimos 30 días)
Rizwana
Rizwana el 4 de Feb. de 2014
Comentada: Rizwana el 4 de Feb. de 2014
Why iam not able to get contours throughout the region??
Set of commands
a = new;
r = linspace(24.94,27.30,264);
x =r';
y =a(:,1);
z =a(:,2);
X = 24.94:0.1:27.30;
Y = 0:0.1:9;
[X,Y] = meshgrid(X,Y);
Z = griddata(x.*cos(a(:,1)*pi/180),...
x.*sin(a(:,1)*pi/180),a(:,2),X,Y);
contourf(Y,X,Z,1.25:0.025:max(a(:,2)),'b')
axis off

Respuesta aceptada

Walter Roberson
Walter Roberson el 4 de Feb. de 2014
We need more information about the value of "new".
One thing to watch out for is that the default 'linear' method does not extrapolate: only points interior to your "a" can be interpolated and points outside what "a" defines are going to be NaN. You could try specifying a different method but it is not clear that it will help.
If this is the problem then you could switch to the relatively new griddedinterpolant. But watch out for your MATLAB version:
The behavior of griddedInterpolant has changed. All interpolation methods now support extrapolation by default. Set F.ExtrapolationMethod to 'none' to preserve the pre-R2013a behavior when F.Method is 'linear', 'cubic' or 'nearest'. Before R2013a, evaluation returned NaN values at query points outside the domain when F.Method was set to 'linear', 'cubic' or 'nearest'.

Más respuestas (0)

Categorías

Más información sobre Contour Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by