How to create a 3D-strain map?
3 次查看(过去 30 天)
显示 更早的评论
Hi everybody!
I have the following question:
I have four column vectors which are: coordinate x, coordinate y, coordinate z and the equivalent strain at each point. The sizes of the vectors are 20500x1. What I need is a plot of the volume with the coordinates like a mesh coloured based on the equivalent strain values. I have used the following lines:
figure
[xi,yi]= meshgrid(linspace(min(eqstrainx),max(eqstrainx),150), ...
linspace(min(eqstrainy),max(eqstrainy),150));
% [xi,yi] = meshgrid(min(t_nodex):0.1:max(t_nodex), min(t_nodey):0.1:max(t_nodey));
zi = griddata(eqstrainx,eqstrainy,eqstrainz,xi,yi);
surf(xi,yi,zi);
Tin=scatteredInterpolant(eqstrainx,eqstrainy,eqstrainz,eqstrain,'linear');
[xq,yq,zq] = meshgrid(linspace(min(eqstrainx),max(eqstrainx),150), ...
linspace(min(eqstrainy),max(eqstrainy),150), ...
linspace(min(eqstrainz),max(eqstrainz),150));
t=Tin(xi,yi,zi);
s=contour3(xi,yi,zi)
colormap('jet')
s.CData=t;
colorbar
The problem with scatteredInterpolant is that the elements of the grid are distorted. What do you think? Have you got some ideas? Thank you very much.
3 个评论
回答(1 个)
Sara
2021-6-21
Hi,
If I understand your question that you need to group the data based on its relevant strain.
I have done a similar thing but group the data based on its kind. So I had element1 and element2, and I wanted to color them based on their positions. Here is the MATLAB function that you may need to solve your problem
[Atoms, symboleS] = findgroups(symbole);
element1 = Atoms ==1;
element2 = Atoms ==2;
best of luck
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Triangulation Representation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!