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
Illustrations of Sequential search: The two illustrations of calling such function is as shown below: >> values = [85 70 100 95 80 91]; >> key = 95; >> seqsearch

Illustration of Input in a for loop: In this illustration, the loop variable iv iterates through the values 1 through 3, therefore the action is repeated three times. The acti

Tracing: Sometimes, when a program has loops and/or selection statements and is not running properly, it is helpful in the debugging process to know exactly which statements h

Illustration of Indexing: Though, rather than of creating the index vector manually as shown here, the process to initialize the index vector is use to a sort function. The al

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

Rectangle - graphics objects: The other core graphics object is the rectangle that can have curvature added to it (!!). Merely calling the function rectangle without any argum

Representing Logical true and False: It has been stated that expressions which are theoretically true really have the integer value of 1, and expressions which are theoretical

Indexing: The Indexing is an alternate to sort a vector. With indexing, the vector is left in its original order. An index vector is used to point values in the original vecto

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

Sequential Search: A sequential search is completed by looping through the vector element-by-element starting from the beginning, looking for the key. Usually the index of the