简体   繁体   English

应力 3D 表面 Plot 在 Matlab

[英]Stress 3D Surface Plot in Matlab

I wrote a finite element program in Matlab which calculates the stresses of a 3D plate.我在 Matlab 中编写了一个有限元程序,它计算了 3D 板的应力。 Now I would like to print these stresses but it is really hard to do for me.现在我想打印这些压力,但这对我来说真的很难。 For each gauss point I can have the XYZ associated coordinate with its stress.对于每个高斯点,我可以将 XYZ 坐标与其应力相关联。 How can I do a plot like the ones I see in the FE software in Matlab?如何像我在 Matlab 的 FE 软件中看到的那样做 plot? Currently what I can do is to plot a colour for the XYZ point assigning a colour range to the stresses.目前我能做的是 plot XYZ 点的颜色,为应力分配颜色范围。 My result is a scatter plot.我的结果是分散的 plot。 I would like to have something like this我想要这样的东西在此处输入图像描述

Thank you for your help!谢谢您的帮助!

Matlab has a surf(X, Y, Z, C) function that can take a color argument ( C ). Matlab 有一个可以接受颜色参数的surf(X, Y, Z, C) function ( C )。 Without the C argument, it uses the Z value to color the surface.如果没有C参数,它使用Z值对表面着色。

[X,Y] = meshgrid(1:0.5:10,1:20);
Z = sin(X) + cos(Y);
C = X.*Y;
surf(X,Y,Z,C)

The color is set using your active colormap.颜色是使用您的活动颜色图设置的。

If you want more control over the colors, C can also be a MxNx3 array where the C(M, N, :) gives the RGB value of the color at the MxN th point.如果您想对 colors 进行更多控制, C也可以是MxNx3数组,其中C(M, N, :)在第MxN点给出颜色的 RGB 值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM