Home > other >  Calling matlab great god can't help to see why this section of the program to run
Calling matlab great god can't help to see why this section of the program to run

Time:09-26

The function facedemo (n)

% * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 80
%
% FACEDEMO: Example polygonal geometries' for MESHFACES.
%
% Author:
%
% Darren Engwirda
%
If (nargin <1)
Fprintf (1, '\ n');
Fprintf (1, 'The usual call is to FACEDEMO (N), with N=1 or 2. \ N ");
Fprintf (1, 'Since N was not specified, the value will be 1 feature. \ N ");
N=1;
End

The switch n

Case 1

Node=[0.0, 0.0, 1.0, 0.0, 1.0, 1.0, 0.0, 1.0, 1.01, 0.0, 1.01, 1.0, 3.0, 0.0, 3.0, 1.0].
Edge=[1, 2, 2, 3, 3, 4, 4, 1, 2, 5, 5, 6, 6, 3, 5, 7, 7, 8, 8, 6].
Face {1}=[1, 2, 3, 4];
Face={2} [5,6,7,2];
Face={3},9,10,6 [8];

Meshfaces (the node, edge, face);

Case 2

% Geometry
Dtheta=PI/36;
Theta=(- PI: dtheta: (PI - dtheta)) ';
Node1=[cos (theta), sin (theta)];
2=[2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0].
Edge1=[(1: size (node1, 1)), '[(2: size (node1, 1))'; 1]];
Edge2=[1, 2, 2, 3, 3, 4, 4, 1);

Edge=[edge1 and edge2 + size (node1, 1));
The node=[node1; 2];

Face {1}=1: size (edge1, 1);
Face {2}=1: size (edge, 1);

Meshfaces (the node, edge, face);

Otherwise
Error (' gave the demo N must be between 1-2 ');

End

Return
end
  • Related