Function fieldnames - structure functions, MATLAB in Engineering

Function fieldnames - structure functions:

The function fieldnames will return the names of the fields which are contained in the structure variable.

>> pack_fields = fieldnames(package)

pack_fields =






As the name of the fields is of different lengths, the function fieldnames returns a cell array with the names of the fields.

To refer to the elements the curly braces are used, as pack_fields is a cell array.

For illustration, we can refer to the length of one of the strings as shown below:

>> length(pack_fields{2})

ans =


Posted Date: 10/20/2012 6:00:56 AM | Location : United States

Related Discussions:- Function fieldnames - structure functions, Assignment Help, Ask Question on Function fieldnames - structure functions, Get Answer, Expert's Help, Function fieldnames - structure functions Discussions

Write discussion on Function fieldnames - structure functions
Your posts are moderated
Related Questions
Interchange rows : for illustration interchanging rows ri and rj is written as

Finding a sting - function strfind: The function strfind does necessarily similar thing, except that the order of the arguments does make dissimilarity. The common form is str

Changing Case: The MATLAB has two functions which convert strings to all uppercase letters, or all lowercase, known as the upper and lower. >> mystring = 'AbCDEfgh';

Use of Nested if-else statements: By using the nested if-else to select from among the three possibilities, not all the conditions should be tested. In this situation, if x is

Illustration of Matrix solutions: For illustration, consider the three equations below with 3unknowns x 1 ,x 2 , and x 3 : We can write this in the form Ax = b here A

Illustration of Variable scope: Running this function does not add any of variables to the workspace, as elaborated: >> clear >> who >> disp(mysum([5 9 1]))

Function rmfield - structure: The function rmfield eliminates a field from the structure. It returns a new structure with field eliminated, but does not modify the original st

Example Exit modular program: In the illustration below, the user  Chose the Limit; -   Whenever prompted for n, entered the two invalid values before finally ente

Q.1: Consider the transmission of a sinusoid x(t) = cos(2f0t) through a channel a ected by multipath and Doppler. Let there be two paths, and assume the sinusoid is being sent fro

Algorithm for subfunction: The algorithm for subfunction askforn is as shown:  Prompt the user for the positive integer n.  Loop to print an error message and reprom