Contour from mesh or grid

조회 수: 1 (최근 30일)
Mortis
Mortis 2016년 5월 9일
댓글: Yamina chbak 2023년 11월 24일
I'm doing some work using FEM (Finite Element Method) with triangular elements.
Questions will remain simple for those who have no clue what FEM is.
I got a m*2 matrix "Nodes" with x,y (for each point/node), a n*3 matrix "Elements" each line representing a triangle (element) referencing 3 points from previous matrix and finally i got a m*1 vector "U" that refers to z index of each node.
With "Nodes" and "Elements" i triplot the mesh, adding "U" i can trisurf it and i'd like to show that data with contour() too. But i get an error saying that Z must be a m*2. Any way arround this?
  댓글 수: 2
KSSV
KSSV 2016년 5월 10일
Attach the data in a mat file.....
Mortis
Mortis 2016년 5월 10일
Data may vary in number depending on user input but its always stored in this matrices structure. WS.mat file attached to original post.
Thank you

댓글을 달려면 로그인하십시오.

채택된 답변

KSSV
KSSV 2016년 5월 11일
  댓글 수: 2
Mortis
Mortis 2016년 5월 11일
I'll accept this answer as it pointed me in the right direction although the similar approach by Duane Hanselman is working better. At least for my data structure.
Thank you
Yamina chbak
Yamina chbak 2023년 11월 24일
@KSSV If I have function z defined on quadrilateral element meshes, what I do ?. Thank you

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Contour Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by