Print from the structure, MATLAB in Engineering

Print from the structure:

To print from the structure, a disp function will show either the whole structure or a field.

>> disp(package)

item_no: 123

cost: 19.9900

price: 39.9500

code: 'g'

>> disp(package.cost)

19.9900

Though, using fprintf, only the individual fields can be printed; the whole structure cannot be printed.

>> fprintf('%d %c\n', package.item_no, package.code)

123  g

Posted Date: 10/20/2012 5:57:03 AM | Location : United States







Related Discussions:- Print from the structure, Assignment Help, Ask Question on Print from the structure, Get Answer, Expert's Help, Print from the structure Discussions

Write discussion on Print from the structure
Your posts are moderated
Related Questions
Polyhedron - graphics objects: The field polyhedron.vertices is a matrix in which each row presents (x,y,z) points. The field polyhedron.faces defines the faces: for illustrat

Function issorted - set operations: The function issorted will return 1 for logical true when the argument is sorted in ascending order (minimum to maximum), or 0 for false wh

Illustration of Set operations: For illustration, given the vectors as shown below: >> v1 = 2:6 v1 = 2  3  4  5  6 >> v2 = 1:2:7 v2 = 1  3  5  7

Example of file ploting data: As the other example, a data file called 'compsales.dat' stores the sales figures (in millions) for divisions in a company. Each line in the f

Replacing, Finding, and separating strings: There are numerous functions which find and replace the strings, or parts of strings, within the other strings and functions which


Algorithm for the function explaine: The algorithm for the function explaine is as shown:  Print a description of e, the exp function, and how to find the approximate va

Gauss, Gauss-Jordan elimination: For 2 × 2 systems of equations, there are well-defined, easy solution techniques. Though, for the larger systems of equations, finding solutio

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,

Text graphic function - Graphics objects: The text graphic function permits text to be printed in a Figure Window, involving special characters which are printed by using \spe