head

Parent Previous Next

head

y = head ( obj,data )
y = obj.head ( data )

Assign a represented data ("head" data) to a structure object

arg

type

Description

Unit or Value scale

obj

STRUCT

A structure object


data

SCL VCT TXT AUD

The data to assign to the structure object


Outputs

  • y is the structure object

Notes

  • If you make a structure variable out of an existing non-struct object, add a structure statement to the object (example 1)
  • obj can be either a text of the file name (if an extension is not specified, .txt is added by default) or a file identifier, which is the output of fopen
  • When the file name is specified for obj, fprintf opens the file with the mode "at," meaning that the content will be appended to the existing content in the file, writes the content as specified, and closes the file.
  • If a file identifier is used for obj, fprintf writes the content to the file stream opened by a prior call to fopen.

Examples

  • v = 150; v.type="weight" // v, a scalar object of 150, is updated as a struct object (150 becomes the head data)
  • v=[]; v.type="weight"; // v, a structure object, is defined.
    v = 150; // v is overwritten with a scalar assignment of 150

See Also

Created with the Personal Edition of HelpNDoc: Full-featured multi-format Help generator