Hi Sean,
I understand that you want to improve the visualization of T-bar mesh by numbering its nodes and possibly its elements in a systematic way. However, this task is challenging due to the presence of NaN values in the mesh. These NaN values block the display of certain areas, especially the lower left corner of the T-bar structure.
To tackle this challenge, you can iterate through the meshgrid's coordinates (X and Y matrices) and apply text labels to represent node numbers directly on the plot. To do this, you need to iterate through each point in the mesh to determine if it belongs to the T-bar structure (i.e., if its Z value is not NaN), and then assign sequential numbers to these points. Refer to the following example code snippet to see what changes need to be made to number the nodes.
% Assuming the lower left corner (origin) is the first node and counting increases to the right and then upwards
nodeNumber = 1;
[nRows, nCols] = size(X);
for i = 1:nRows
for j = 1:nCols
if ~isnan(Z(i, j)) % Check if the node is part of the T-bar structure
% The text function places a text label at the specified coordinates
% Adjust the offsets (-0.002 in this example) as needed for visibility
text(X(i, j)-0.002, Y(i, j)-0.002, 0, num2str(nodeNumber), 'Color', 'red');
nodeNumber = nodeNumber + 1;
end
end
end
hold off;
This approach ensures that all relevant nodes are numbered and visible on the plot. To learn more about the text function refer to the following documentation
Hope it helps!
Thanks