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
Logical errors: The Logical errors are more complicated to locate, as they do not result in any error message. The logical error is a mistake in reasoning by the programmer, b

Logical Built-In Functions: There are built-in functions in the MATLAB which are useful in conjunction with vectors or matrices of all logical true or false values; two of the

Illustration of Binary search: An illustration to search for the key of 91 in the vector is as shown below: The table below shows what will happen in each iteration of

Illustration of Median When the vector is not in sorted order to start with, the median function will still return the right answer (it will sort the vector automatically). For

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

Lower Level File I/O Functions: Whenever reading from data file, as long as the data in the file is "regular" the load function works-in another words, the similar type of dat

Opening and Closing a File: The Files are opened with the fopen function. By the default, fopen function opens a file for reading. If the other mode is preferred, a permission

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

Illustration of tracing a error: The one way of following the flow of function, or tracing it, is to use the echo function. The echo function, that is a toggle, will show each

Graphics objects: The objects involve graphics primitives like lines and text, and also the axes used to orient the objects. These objects are organized hierarchically, and the