Nested structures, MATLAB in Statistics

Nested Structures:

The nested structure is a structure in which at least one of the members is itself a structure.

For illustration, a structure for the line segment may consist of fields presenting the two points at the ends of the line segment. Each of these points would be presented as a structure consisting of the x- and y-coordinates.

1269_Nested Structures.png

This represents a structure variable known as lineseg which has two fields, end-point1 and endpoint2. Each of these is a structure having two fields, x & y.

The one method of defining this is to nest calls to the function struct:

>> lineseg = struct('endpoint1',struct('x',2,'y',4), .  .  .

'endpoint2',struct('x',1,'y',6))

 

Posted Date: 10/20/2012 6:07:31 AM | Location : United States







Related Discussions:- Nested structures, Assignment Help, Ask Question on Nested structures, Get Answer, Expert's Help, Nested structures Discussions

Write discussion on Nested structures
Your posts are moderated
Related Questions
Index vector: The index vector is then used as the indices for original vector. To get grades vector in ascending order, the indices used would be grades (2), grades (5), and

Location of a rectangle - graphics objects: The location of a rectangle is [x y w h], where x and y are the coordinates of the lower left point, here w is the width, and h is

fscanf function - file function: The fscanf reads matrix variable mat columnwise from the file specified by fid. The 'format' involves conversion characters much similar to th

Illustration of reading from files: For illustration, suppose that there is a data file 'subjexp.dat' that has on each line a number followed by thecharacter code. The type fu

Core Objects: The Core Objects in MATLAB are the very fundamental graphics primitives. The description can be found under the MATLAB Help: Under the Contents tab, click the Ha

Need of a nested loop: How would we sum each individual column, rather than getting an overall sum? Answer: The programming technique would need a nested loop in whi

Polynomials: Simple curves are polynomials of various degrees, or orders. The degree is the integer of the highest exponent in the expression. The illustrations are as follows

Example of Functions which return values: Calling this function prints the circumference, since there is no way to store the value, hence, it can be used in following computat

Illustration of Mode When there is more than one value with similar (highest) frequency, then the smaller value is mode. In the case below, as 3 and 8 appear twice in the vecto

Example of Median For the vector [1 4 5 9 12 33], the median is the average of the 5 & 9 in the middle: >> median([1 4 5 9 12 33]) ans =     7