User Tools

Site Tools


en:software:matlab:trepr:dev:gui:datastructure

Additional Fields in the Data Structure

The data structure of the toolbox is defined in one central place, namely the routine named trEPRdataStructure. For a definition of all those fields, see the data format of the trEPR toolbox page.

Whereas it is quite easy and highly recommended to use trEPRdataStructure whenever you need to create a new dataset, e.g. by using a line of code similar to the following:

s = trEPRdataStructure();

a structure like that, though necessary, is not sufficient for use inside the GUI. That is due to the fact that the handling of datasets inside the GUI needs a few additional fields, defined by the routine trEPRguiDataStructure. Similarly to the above, you can get hold of those additional fields by calling:

ss = trEPRdataStructure();

To get both sets of fields in one structure without too much of a hassle, simply use a line of code like the following:

s = structcopy(trEPRdataStructure(),trEPRguiDataStructure())

The function structcopy used here is part of the toolbox and therefore available throughout the entire toolbox. It is exactly designed for such cases as the one described here.

Add own additional fields

Especially in case that you want to write your own modules, it might sometimes necessary to add a set of own additional fields to the dataset structure. It is a good idea to do that comparable to the way it is done in the toolbox:

  • One routine defining both fields and their types
  • Calling this routine whenever you need to add those fields to datasets.

Please note: There is a clear difference between fields and structures needed inside a particular GUI to perform a task and to temporarily store information and those fields that get (permanently) added to a dataset that was operated on in such particular GUI/module. Whereas fields added permanently to the data structure of a dataset should be ideally defined by a function similar to trEPRdataStucture, the fields for storing data and information internally in a GUI are a different thing and are normally initialised inside the respective GUI function.

en/software/matlab/trepr/dev/gui/datastructure.txt · Last modified: 2020/09/30 21:35 by 127.0.0.1