To solve the problem I have changed the colormap to hot and to add a condition that say if the calculated rcart is greater than the acual raduis r set temperature = 26 wich the max an is represented in white. However, it is not physicaly accurate.
So, I simply asssined a NaN to the temperatures of the rcart greater that the actual radius r, so that matlab ignores the NaN values.
figure
for k = 1:20:nodes_t
for i = 1:length(x)
for j = 1:length(y)
r_calcule = sqrt(x(i)^2 + y(j)^2);
indice_r = find(r <= r_calcule, 1, 'last');
if isempty(indice_r)
temperature(j, i) = 0;
elseif r_calcule > r
temperature(j, i) = NaN;
else
temperature(j, i) = T(k,indice_r);
% temperature(j, i) = T(nodes_t,indice_r);
end
end
end
% Displaying the temperature contour
contourf(x, y, temperature, 'linecolor','none');
xlabel('x');
ylabel('y');
title('Temperature Contour');
colormap jet;
colorbar;
axis equal;
set(gca, 'FontName', 'LM Roman 10', 'TickDir', 'out', 'box', 'on');
caxis([4 25])
pause(1e-7)
end