Function rmfield - structure, MATLAB in Engineering

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 structure (except the returned structure is assigned to that variable). For illustration, the below would eliminate the code field from the newpack structure, however store the resulting structure in the default variable ans. The value of the newpack remains unaffected.

>> rmfield(newpack, 'code')

ans =

item_no: 111

cost: 19.9900

price: 34.9500

>> newpack

newpack =

item_no: 111

cost: 19.9000

price: 34.9500

code: 'g'

 

To change the value of newpack, the structure which results from calling rmfield should be assigned to newpack.

>> newpack = rmfield(newpack, 'code')

newpack =

item_no: 111

cost: 19.9000

price: 34.9500

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







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

Write discussion on Function rmfield - structure
Your posts are moderated
Related Questions
Function call: In the function call, not any arguments are passed so there are no input arguments in the function header. The function returns an output argument, therefore th

Reading from a Mat-File: The load function is used to read from various types of files. As with save function, by default the file will be supposed to be a MAT-file, and load

Function iscellstr - string function: The function iscellstr will return the logical true when a cell array is a cell array of all the strings, or logical false if not. >>

Displaying expressions: The good-looking function will show such expressions by using exponents; for illustration, >> b = sym('x^2') b = x^2 >> pretty(b)

Basic mathematical operations: All the basic mathematical operations can be executed on symbolic expressions and variables (example, add, raise to a power, multiply, subtract,

Reading from a File in a While Loop: Though in most languages the combination of a loop and an if statement would be essential to determine whether or not the elements in a ve

How can I use the weighted moving average formula in matlab to smooth a column data of 404 values?

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

Technique to creating this structure: An alternative technique of creating this structure, that is not as efficient, includes using the dot operator to refer to fields in the

Forward elimination: In forward elimination, we want to obtain a 0 in the a 21 position. To accomplish this, we can alter the second line in the matrix by subtracting from it