Preventing interpolation between 3 data points in a contourf plot?
5 views (last 30 days)
Show older comments
I'm taking a transport class and I'm working on a modeling heat flow in a system via a finite difference method and then plotting the results in a contour plot. I've worked through the plot to generate the temperatures at the nodes of the system, but the system is not rectangular. It has a corner cut out as seen here:

I'm having difficulty making this display with a blank square in that region. The closest I've come is assigning values of NaN to where nodes 22-24 would occur, but contourf still interpolates data in the triangle made up of nodes 15, 16, and 21, as seen here:

Does anyone have any suggestions for removing that triangle and/or a better method of generating the blank rectangle in the bottom right? My professor says it is ok to leave as is, but I'm curious now and want to try to figure out how to solve the problem.
I've included the matrix that generates the contour below:
P = [ 1525.954138125030 1525.279445653040 1523.596090745226 1521.935746740187 1520.830668474906 1520.450690257122;
1519.666996122022 1518.794954697074 1516.528428923648 1514.535543739916 1513.301345190155 1512.888739649621;
1515.123936968909 1513.704948089585 1509.187126512376 1506.376654105672 1504.950428896174 1504.501577961054;
1513.418855574446 1511.713774179982 1506.026344966314 NaN NaN NaN]
For reference, the block is occupied by a cooling chamber with a gas flowing through at 400 K, but if I just assign values of 400K to those three nodes, there isn't enough resolution because the contour map then ranges from 400 to 1525, instead of 1504 to 1525. It would be fine to also assign it a value of 400 and then readjust the increments of the contours, but I haven't been able to figure that out either.
0 Comments
Answers (0)
See Also
Categories
Find more on Contour Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!