Mesh the square with triangles - MATLAB Cody - MATLAB Central

Problem 60982. Mesh the square with triangles

Difficulty:Rate
Problem statement
An square is a regular polygon with 4 vertices and 4 edges.
A triangulated mesh T (stands for triangles here) -or a triangulation- is simply a N x 3 matrix of positive integers where each row contains the vertex indices of a triangle, and where N is the number of triangles.
Your task here is to mesh, that is to say give one triangulation T of, this square.To do so, you will list the triangles/rows in a matrix of triangles, T.The row order of the triangles in the list doesn't matter.
Example
The first triangle here can be [1, 2, 3] if counterclockwise oriented.
Forbidden functions / expressions
  • regexp
  • assignin
  • str2num
  • echo
See also

Solution Stats

100.0% Correct | 0.0% Incorrect
Last Solution submitted on Aug 07, 2025

Problem Comments

Solution Comments

Show comments

Problem Recent Solvers9

Suggested Problems

More from this Author42

Community Treasure Hunt

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

Start Hunting!