0
$\begingroup$

I'm trying to use this method Plot 2D piecewise constant in matlab in a finite elements mesh for my data. However, I have problems with the values of n1, n2 and n3. I guess this is why it doesn't show a figure for what I have written.

What values would be appropriate for n1, n2, n3?

$\endgroup$
4
  • $\begingroup$ If you have a mesh of triangles $T_1 = (P_{i_1}, P_{j_1}, P_{k_1})$, $T_2 = (P_{i_2}, P_{j_2}, P_{k_2})$ and so on, you fill the matrix N with those indices: $N = [i_1, j_1, k_1 ; i_2, j_2, k_2; ...]$ with a different line for each triangle. $\endgroup$ Commented May 29, 2023 at 13:52
  • $\begingroup$ @Sardine So you mean that n1, n2, n3 are the indices of the triangles? $\endgroup$ Commented May 29, 2023 at 15:57
  • $\begingroup$ Maybe that's what you mean, but to be pedantic, they are the indices of the vertices in the triangles, not of the triangles. Imagine you have 4 points forming two triangles: triangle 1 is points 2, 3, 1 and triangle 2 is points 1, 4, 2. Then the matrix is [2 3 1; 1 4 2]. $\endgroup$ Commented May 29, 2023 at 19:31
  • $\begingroup$ @Sardine You're right! I finally got it! Thank you! $\endgroup$ Commented May 31, 2023 at 14:15

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.