Patch function - graphics objects, MATLAB in Engineering

Assignment Help:

Patch function - graphics objects:

The patch function is used to generate a patch graphics object, which is made from 2-dimensional polygons. The patch is defined by its vertices and faces. For illustration, consider a patch which has four vertices in 3-dimensional space, given by the coordinates:

(0, 0, 0)

(1, 0, 0)

(0, 1, 0)

(0.5, 0.5, 1)

 

Just to visualize these points first, the plot3 function is used, as shown in figure:

>> x = [0 1 0 0.5];

>> y = [0 0 1 0.5];

>> z = [0 0 0 1];

>> plot3(x,y,z,'ko')

837_Patch function.png

Rotating the figure shows all four points, as shown in figure.

2127_Patch function1.png

Generating and showing these points is not essential to generate a patch object; this was just complete to visualize at first the vertices . A patch object is defined by both the vertices and the faces of the polygon which connect these vertices. The one way of calling this function is patch(fv),here fv is a structure variable with fields known as vertices and faces.

polyhedron.vertices = [.  .  .

0 0 0

1 0 0

0 1 0

0.5 0.5 1];

polyhedron.faces = [.  .  .

1 2 3

1 2 4

1 3 4

2 3 4];

pobj = patch(polyhedron, .  .  .

'FaceColor',[0.8, 0.8, 0.8],.  .  .

'EdgeColor','black');


Related Discussions:- Patch function - graphics objects

Displaying the cell arrays, Displaying the cell arrays: There are seve...

Displaying the cell arrays: There are several techniques of displaying the cell arrays. The celldisp function shows all elements of the cell array:   >> celldisp(cellro

Simplification functions, Simplification Functions: There are numerous...

Simplification Functions: There are numerous functions which work with expressions, and simplify the terms. Not all the expressions can be simplified, but the simplify functio

Ischar function - string, ischar function: The ischar function return ...

ischar function: The ischar function return the logical true if an array is a character array, or logical false if not. >> vec = 'EK127'; >> ischar(vec) ans =

Related structure functions, Related Structure Functions: There are ma...

Related Structure Functions: There are many functions which can be used with structures in a MATLAB. The function isstruct will return 1 for logical true when the variable arg

Tracing of square matrices, Tracing of Square matrices: The trace of a...

Tracing of Square matrices: The trace of a square matrix is the addition of all the elements on the diagonal. For illustration, for the preceding matrix it is 1 + 6 + 11 + 16,

Variable scope, Variable Scope: The scope of any of variable is the wo...

Variable Scope: The scope of any of variable is the workspace in which it is valid. The workspace generated in the Command Window is known as the base workspace. As we know

Inverse of square matrix, Inverse of square matrix: The inverse is, he...

Inverse of square matrix: The inverse is, hence the result of multiplying the scalar 1/D by each and every element in the preceding matrix. Note that this is not the matrix A,

Subfunctions, Subfunctions: Though, it is possible to have more than o...

Subfunctions: Though, it is possible to have more than one function in a given M-file. For illustration, if one function calls the other, the first function would be the prima

Creating the structure variables, Creating the structure Variables: Cr...

Creating the structure Variables: Creating a structure variable can be accomplished by simply storing the values in fields by using assignment statements, or by using the stru

Illustration of symbolic variable, Illustration of symbolic variable: ...

Illustration of symbolic variable: When, on the other hand, z is a symbolic variable to start with, quotes are not required around the expression, and the words are automatica

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd