I have 20 data points in 3D space. Here you can see them plotted:
clear all
close all
clc
Data = [97.4993 104.3297 0.7500 196.7021
100.0000 105.0000 0.7500 290.9164
100.0000 107.5000 0.7500 142.1626
96.2569 106.4992 0.7500 143.3605
97.5028 104.3317 1.0000 197.1111
100.0000 105.0000 1.0000 290.4210
100.0000 107.5000 1.0000 144.0155
96.2530 106.4969 1.0000 144.0969
98.7055 104.8295 0.7500 239.7734
100.0000 106.2500 0.7500 214.6557
98.0627 107.2455 0.7500 145.4154
96.8781 105.4144 0.7500 161.7000
97.5010 104.3307 0.8750 196.8880
100.0000 105.0000 0.8750 290.6686
100.0000 107.5000 0.8750 141.5008
96.2549 106.4980 0.8750 144.0253
98.7075 104.8300 1.0000 239.3455
100.0000 106.2500 1.0000 215.2104
98.0605 107.2449 1.0000 144.9653
96.8779 105.4143 1.0000 161.4253];
x = Data(:,1); % x coordinates
y = Data(:,2); % y coordinates
z = Data(:,3); % z coordinates
sigma = Data(:,4); % stress value at that point
for ii = 1:length(x)
plot3(x(ii,1),y(ii,1),z(ii,1),'r*')
hold on
grid on
text(x(ii,1),y(ii,1),z(ii,1),[' ' num2str(ii) ' '...
num2str(sigma(ii))],'HorizontalAlignment','left','FontSize',12);
end
This data represents one HEX20 element (FEM) and its 20 nodes. Each node has its Stress value (sigma) written next to it. The numbering of the nodes follows the standard procedure:

I would like to plot the surfaces of that element like it is shown in the picture. Then (if possible) I would like the surfaces to be coloured based on the stress value of the nodes (colour mapping). The end result should be something like this:


