简体   繁体   中英

Stress 3D Surface Plot in Matlab

I wrote a finite element program in Matlab which calculates the stresses of a 3D plate. 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. How can I do a plot like the ones I see in the FE software in Matlab? Currently what I can do is to plot a colour for the XYZ point assigning a colour range to the stresses. My result is a scatter 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 ). Without the C argument, it uses the Z value to color the surface.

[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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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