Connect 4 nodes with lines and color the created area

3 ビュー (過去 30 日間)
tsaiwu
tsaiwu 2017 年 1 月 7 日
コメント済み: tsaiwu 2017 年 1 月 10 日
I have 2 elements which are based on 4 nodes. How can I connect these nodes to create a rectangle. This rectangle area has a specific value(strain) how can I plot this area with a colorbar, like a typical FEM picuture?
clc; clear all;
%undeformed Node coordinates
N1 = [-1;-1];
N2 = [1;-1];
N3 = [1;1];
N4 = [-1;1];
%deformed Node coordinates
N1d = [2;1];
N2d = [3;1];
N3d = [4;3];
N4d = [1;3];
strainxx = 20;
strainyy = 39;

採用された回答

Jordan Ross
Jordan Ross 2017 年 1 月 10 日
Hello,
As I understand, you are wanting to plot a figure with four nodes and want the area of the polygon to have a different color from a colorbar based on a stress value.
I believe what you are looking for is the "patch" function. Please see the following documentation page which contains an example under the subsection "Different Polygon Face Colors": http://www.mathworks.com/help/matlab/ref/patch.html
  1 件のコメント
tsaiwu
tsaiwu 2017 年 1 月 10 日
thanks for you help, thats what I want.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by