Generating a square mesh
14 ビュー (過去 30 日間)
古いコメントを表示
I have found a book that teaches the solution of PDEs and plots the results.
I want to change the plot to a square mesh instead of traingular mesh.
This the code they use:
tri = delaunay(x,y);
trisurf(tri,x,y,u_fem);
which generates something like this:

How do I make sure that the mesh generated does not have those diagonal lines between the squares? and then plot that?
*using MATLAB online
Let me know if the entire code is needed, its in multiple bunches
Thanks
1 件のコメント
Bruno Luong
2022 年 11 月 16 日
編集済み: Bruno Luong
2022 年 11 月 16 日
Finite Elements methods (FEM) must work on triangular mesh, so it must have those diagonals to form set of triangles.
This piece of code show exactly the mesh as it is. This is a good visualization.
採用された回答
Askic V
2022 年 11 月 16 日
If you look at the examples in the Matlab documentation for the mesh function, you can find something like this:
[X,Y] = meshgrid(-5:.5:5);
Z = Y.*sin(X) - X.*cos(Y);
s = mesh(X,Y,Z,'FaceAlpha','0.5');
As you can see this division is not triangular nor does it have diagonals.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Geometry and Mesh についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
