Difference: DocsSectionsSmartGetPut (1 vs. 11)

Revision 1110 Jun 2015 - Main.PhilipVanDenBroek

Line: 1 to 1
 
META TOPICPARENT name="WebHome"
-- PhilipVanDenBroek - 03 Feb 2014
Line: 69 to 69
 
  • queue
  • stack
  • array
Changed:
<
<
  • shift register
>
>
  • shiftreg (shift register)
  These data structures are default available to the user and are modifiable via the functions:
Line: 83 to 83
  Note: The format below is how users should specify it in their experiment definition tables.
Changed:
<
<
put_new(type, dims, len, returnascell [, field]) for: array, shiftreg
>
>
put_new(type, dims, len, returnascell [, field]) for: array, shiftreg
 
Changed:
<
<
put_new(type, dims, returnascell [, field]) for: queue, buffer, stack
>
>
put_new(type, dims, returnascell [, field]) for: queue, buffer, stack
 
  • dims: dimensions of added content (empty if not known) <numeric>
  • len: length of array or shift register <numeric>
  • returnascell: set to zero if entire content can and should be returned as numeric matrix <1,0>
  • field: assign update to structure field of global variable <char>
Changed:
<
<
put_clear([field])
>
>
put_clear([field])
 
  • field: assign update to structure field of global variable <char>
Changed:
<
<
put_item(update, idx [, field])
>
>
put_item(update, idx [, field])
 
  • update: the content to be updated (either constant value or a field of the event structure, literally specified and prefixed with a dot <any type>
  • idx: index position of entry to be updated <number>
  • field: assign update to structure field of global variable <char>
Changed:
<
<
push_item(update [, field])
>
>
push_item(update [, field])
 
  • update: the content to be updated (either constant value or a field of the event structure, literally specified and prefixed with a dot <any type>
  • field: assign update to structure field of global variable <char>
Changed:
<
<
pop_item(.event_field [, field])
>
>
pop_item(.event_field [, field])
 
  • .event_field: BrainStream assigns returned result to event.event_field <char>
  • field: retrieved from global variables structure field <char>
Changed:
<
<
get_item(.event_field [,idx, field])
>
>
get_item(.event_field [,idx, field])
 
  • .event_field: BrainStream assigns returned result to event.event_field <char>
  • idx: index position of entry to retrieve <number>
  • field: retrieved from global variables structure field <char>
Changed:
<
<
get_whole(.event_field [, field])
>
>
get_whole(.event_field [, field])
 
  • .event_field: BrainStream assigns returned result to event.event_field <char>
  • field: retrieved from global variables structure field <char>

Some other examples:

Changed:
<
<
put_field(update, field)
>
>
put_field(update, field)
 
  • update: the content to be updated (either constant value or a field of the event structure, literally specified and prefixed with a dot <any type>
  • field: assign update to structure field of global variable <char>
Changed:
<
<
get_field(.event_field, field)
>
>
get_field(.event_field, field)
 
  • .event_field: BrainStream assigns returned result to event.event_field <char>
  • field: retrieved from global variables structure field <char>
Changed:
<
<
save_var(update, name [, option]) % Note: it also incorporates a put action, i.e., it updates the global variable and saves it to a user-specified file.
>
>
save_var(update, name [, option]) % Note: it also incorporates a put action, i.e., it updates the global variable and saves it to a user-specified file.
 
  • update: the content to be updated (also updates global variable!) <any type>
  • name: name of the file (Note: folder is determlined by blocksettings for OutFolder? ) <char>
  • option: Matlab has different options on how to compress the variable before saving it. <char>
Changed:
<
<
load_var(.event_field, name)
>
>
load_var(.event_field, name)
 
  • .event_field: BrainStream assigns returned result to event.event_field <char>
  • name: name of the file to load from <char>
Line: 153 to 153
 
Example dedicated put: stack
marker
time
function
trials
sequence
BS_INIT EVENT   [],put_new('stack')
Changed:
<
<
trial DATA process_data push_item(.trial)
>
>
trial DATA process_data push_item(data)
 
BS_END EVENT   get_whole(.sequence) save
Changed:
<
<

The BS_INIT event initialises a new stack (put_new('stack')), configured to collect items in a cell-array (omitted input argument returnascell defaults to cell-type). For every incoming trial event, event.trial is pushed (push_item(.trial)) to the stack (no pops so we are just collecting all data here). At the BS_END event the information on the stack is merged into a cell-array (get_whole(.sequence)) as field of the event structure (event.sequence), which is then saved to disk via the save keyword for the sequence variable.
>
>

The BS_INIT event initialises a new stack ( put_new('stack')), configured to collect items in a cell-array (omitted input argument returnascell defaults to cell-type). For every incoming trial event, event.data is pushed ( push_item(.data)) to the stack (no pops so we are just collecting all data here). At the BS_END event the information on the stack is merged into a cell-array ( get_whole(.sequence)) as field of the event structure ( event.sequence), which is then saved to disk via the save keyword for the sequence variable.

Revision 1014 Nov 2014 - Main.PhilipVanDenBroek

Line: 1 to 1
 
META TOPICPARENT name="WebHome"
-- PhilipVanDenBroek - 03 Feb 2014
Line: 83 to 83
  Note: The format below is how users should specify it in their experiment definition tables.
Changed:
<
<
put_new(type, dims, len, returnascell [, field]) for: array, shiftreg
>
>
put_new(type, dims, len, returnascell [, field]) for: array, shiftreg
 
Changed:
<
<
put_new(type, dims, returnascell [, field]) for: queue, buffer, stack
>
>
put_new(type, dims, returnascell [, field]) for: queue, buffer, stack
 
  • dims: dimensions of added content (empty if not known) <numeric>
  • len: length of array or shift register <numeric>
  • returnascell: set to zero if entire content can and should be returned as numeric matrix <1,0>
  • field: assign update to structure field of global variable <char>
Changed:
<
<
put_clear([field])
>
>
put_clear([field])
 
  • field: assign update to structure field of global variable <char>
Changed:
<
<
put_item(update, idx [, field])
>
>
put_item(update, idx [, field])
 
  • update: the content to be updated (either constant value or a field of the event structure, literally specified and prefixed with a dot <any type>
  • idx: index position of entry to be updated <number>
  • field: assign update to structure field of global variable <char>
Changed:
<
<
push_item(update [, field])
>
>
push_item(update [, field])
 
  • update: the content to be updated (either constant value or a field of the event structure, literally specified and prefixed with a dot <any type>
  • field: assign update to structure field of global variable <char>
Changed:
<
<
pop_item(.event_field [, field])
>
>
pop_item(.event_field [, field])
 
  • .event_field: BrainStream assigns returned result to event.event_field <char>
  • field: retrieved from global variables structure field <char>
Changed:
<
<
get_item(.event_field [,idx, field])
>
>
get_item(.event_field [,idx, field])
 
  • .event_field: BrainStream assigns returned result to event.event_field <char>
  • idx: index position of entry to retrieve <number>
  • field: retrieved from global variables structure field <char>
Changed:
<
<
get_whole(.event_field [, field])
>
>
get_whole(.event_field [, field])
 
  • .event_field: BrainStream assigns returned result to event.event_field <char>
  • field: retrieved from global variables structure field <char>

Some other examples:

Changed:
<
<
put_field(update, field)
>
>
put_field(update, field)
 
  • update: the content to be updated (either constant value or a field of the event structure, literally specified and prefixed with a dot <any type>
  • field: assign update to structure field of global variable <char>
Changed:
<
<
get_field(.event_field, field)
>
>
get_field(.event_field, field)
 
  • .event_field: BrainStream assigns returned result to event.event_field <char>
  • field: retrieved from global variables structure field <char>
Changed:
<
<
save_var(update, name [, option]) % Note: it also incorporates a put action, i.e., it updates the global variable and saves it to a user-specified file.
>
>
save_var(update, name [, option]) % Note: it also incorporates a put action, i.e., it updates the global variable and saves it to a user-specified file.
 
  • update: the content to be updated (also updates global variable!) <any type>
  • name: name of the file (Note: folder is determlined by blocksettings for OutFolder? ) <char>
  • option: Matlab has different options on how to compress the variable before saving it. <char>
Changed:
<
<
load_var(.event_field, name)
>
>
load_var(.event_field, name)
 
  • .event_field: BrainStream assigns returned result to event.event_field <char>
  • name: name of the file to load from <char>

Todo: Add example table to demonstarte how this can be used in an experiment

Added:
>
>

Examples of dedicated get and put actions

Example dedicated put: stack
marker
time
function
trials
sequence
BS_INIT EVENT   [],put_new('stack')
trial DATA process_data push_item(.trial)
BS_END EVENT   get_whole(.sequence) save


The BS_INIT event initialises a new stack (put_new('stack')), configured to collect items in a cell-array (omitted input argument returnascell defaults to cell-type). For every incoming trial event, event.trial is pushed (push_item(.trial)) to the stack (no pops so we are just collecting all data here). At the BS_END event the information on the stack is merged into a cell-array (get_whole(.sequence)) as field of the event structure (event.sequence), which is then saved to disk via the save keyword for the sequence variable.

Revision 910 Feb 2014 - Main.PhilipVanDenBroek

Line: 1 to 1
 
META TOPICPARENT name="WebHome"
-- PhilipVanDenBroek - 03 Feb 2014
Line: 83 to 83
  Note: The format below is how users should specify it in their experiment definition tables.
Changed:
<
<
put_new(type, dims, len, returnascell [, field]) for: array, shiftreg
>
>
put_new(type, dims, len, returnascell [, field]) for: array, shiftreg
 
Changed:
<
<
put_new(type, dims, returnascell [, field]) for: queue, buffer, stack
>
>
put_new(type, dims, returnascell [, field]) for: queue, buffer, stack
 
  • dims: dimensions of added content (empty if not known) <numeric>
  • len: length of array or shift register <numeric>
  • returnascell: set to zero if entire content can and should be returned as numeric matrix <1,0>
  • field: assign update to structure field of global variable <char>
Changed:
<
<
put_clear([field])
>
>
put_clear([field])
 
  • field: assign update to structure field of global variable <char>
Changed:
<
<
put_item(update, idx [, field])
>
>
put_item(update, idx [, field])
 
  • update: the content to be updated (either constant value or a field of the event structure, literally specified and prefixed with a dot <any type>
  • idx: index position of entry to be updated <number>
  • field: assign update to structure field of global variable <char>
Changed:
<
<
push_item(update [, field])
>
>
push_item(update [, field])
 
  • update: the content to be updated (either constant value or a field of the event structure, literally specified and prefixed with a dot <any type>
  • field: assign update to structure field of global variable <char>
Changed:
<
<
pop_item(.event_field [, field])
>
>
pop_item(.event_field [, field])
 
  • .event_field: BrainStream assigns returned result to event.event_field <char>
  • field: retrieved from global variables structure field <char>
Changed:
<
<
get_item(.event_field [,idx, field])
>
>
get_item(.event_field [,idx, field])
 
  • .event_field: BrainStream assigns returned result to event.event_field <char>
  • idx: index position of entry to retrieve <number>
  • field: retrieved from global variables structure field <char>
Changed:
<
<
get_whole(.event_field [, field])
>
>
get_whole(.event_field [, field])
 
  • .event_field: BrainStream assigns returned result to event.event_field <char>
  • field: retrieved from global variables structure field <char>

Some other examples:

Changed:
<
<
put_field(update, field)
>
>
put_field(update, field)
 
  • update: the content to be updated (either constant value or a field of the event structure, literally specified and prefixed with a dot <any type>
  • field: assign update to structure field of global variable <char>
Changed:
<
<
get_field(.event_field, field)
>
>
get_field(.event_field, field)
 
  • .event_field: BrainStream assigns returned result to event.event_field <char>
  • field: retrieved from global variables structure field <char>
Changed:
<
<
save_var(update, name [, option]) % Note: it also incorporates a put action, i.e., it updates the global variable and saves it to a user-specified file.
>
>
save_var(update, name [, option]) % Note: it also incorporates a put action, i.e., it updates the global variable and saves it to a user-specified file.
 
  • update: the content to be updated (also updates global variable!) <any type>
  • name: name of the file (Note: folder is determlined by blocksettings for OutFolder? ) <char>
  • option: Matlab has different options on how to compress the variable before saving it. <char>
Changed:
<
<
load_var(.event_field, name)
>
>
load_var(.event_field, name)
 
  • .event_field: BrainStream assigns returned result to event.event_field <char>
  • name: name of the file to load from <char>

Revision 806 Feb 2014 - Main.PhilipVanDenBroek

Line: 1 to 1
 
META TOPICPARENT name="WebHome"
-- PhilipVanDenBroek - 03 Feb 2014
Line: 9 to 9
 If you have plans to implement such custom-made functions, you should read following paragraph that explains how this can be done. Otherwise, jump directly to the next paragraph that demonstrates some examples that come standardly with BrainStream and demonstrate dedicated get/put actions to implement four data structures and direct update/retrieval from structure fields.

Building custom-made dedicated get and put actions

Changed:
<
<
Those functions should obey to a fixed format, where each format is different for get, put and a new get+mod actions:
>
>
Those functions should obey to a fixed format, where each format is different for get, put and a new get+mod actions. Also, function names should always be prefixed with either of the following options: 'get_', 'pop_', 'put_', 'push_', 'load_' or 'save_' in order to be recognized by BrainStream as a dedicated get/put action. The functions should be copied to the BrainStream $BRAINSTREAM_FOLDER/core/getput/ folder.
  get:
Line: 57 to 57
 examples:
      pop_item (data structures: stack, queue) 
NOTE: this is a special newly introduced operation since it combines both a get- and a mod-operation. This combined action is necessary to implement data structures with pop behaviour, where a get operation not only retrieves some content from the data structure, but also modifies the content and thus implicitly also involves a mod operation to update the corresponding global variables content.
Changed:
<
<
Important: Function names should always be prefixed with either of the following options: 'get_', 'pop_', 'put_', 'push_', 'load_' or 'save_' in order to be recognized by BrainStream as a dedicated get/put action. The functions should be copied to the BrainStream $BRAINSTREAM_FOLDER/core/getput/ folder.
>
>
Important: Function names should always be prefixed with either of the following options: 'get_', 'pop_', 'put_', 'push_', 'load_' or 'save_' in order to be recognized by BrainStream as a dedicated get/put action. The functions should be copied to the BrainStream $BRAINSTREAM_FOLDER/core/getput/ folder.
 
Line: 81 to 81
 
  • get_item: get item from data structure ( array, shiftreg )
  • get_whole: get entire data returned (all four data structures)
Added:
>
>
Note: The format below is how users should specify it in their experiment definition tables.
  put_new(type, dims, len, returnascell [, field]) for: array, shiftreg

put_new(type, dims, returnascell [, field]) for: queue, buffer, stack

  • dims: dimensions of added content (empty if not known) <numeric>
  • len: length of array or shift register <numeric>
Changed:
<
<
  • returnascell: set to zero if entire content can be returned as numeric matrix <1,0>
  • field: assign result as structure field of global variable <char>
>
>
  • returnascell: set to zero if entire content can and should be returned as numeric matrix <1,0>
  • field: assign update to structure field of global variable <char>
  put_clear([field])
Changed:
<
<
  • field: assign result as structure field of global variable <char>
>
>
  • field: assign update to structure field of global variable <char>
  put_item(update, idx [, field])

  • update: the content to be updated (either constant value or a field of the event structure, literally specified and prefixed with a dot <any type>
  • idx: index position of entry to be updated <number>
Changed:
<
<
  • field: assign result as structure field of global variable <char>
>
>
  • field: assign update to structure field of global variable <char>
  push_item(update [, field])

  • update: the content to be updated (either constant value or a field of the event structure, literally specified and prefixed with a dot <any type>
Changed:
<
<
  • field: assign result as structure field of global variable <char>
>
>
  • field: assign update to structure field of global variable <char>
  pop_item(.event_field [, field])
Added:
>
>
  • .event_field: BrainStream assigns returned result to event.event_field <char>
 
  • field: retrieved from global variables structure field <char>
Changed:
<
<
get_item(idx [.event_field [, field])
>
>
get_item(.event_field [,idx, field])
 
Added:
>
>
  • .event_field: BrainStream assigns returned result to event.event_field <char>
 
  • idx: index position of entry to retrieve <number>
  • field: retrieved from global variables structure field <char>

get_whole(.event_field [, field])

Changed:
<
<
  • .event_field: BS stores returned result in event.event_field
>
>
  • .event_field: BrainStream assigns returned result to event.event_field <char>
 
  • field: retrieved from global variables structure field <char>
Added:
>
>
Some other examples:

put_field(update, field)

  • update: the content to be updated (either constant value or a field of the event structure, literally specified and prefixed with a dot <any type>
  • field: assign update to structure field of global variable <char>

get_field(.event_field, field)

  • .event_field: BrainStream assigns returned result to event.event_field <char>
  • field: retrieved from global variables structure field <char>

save_var(update, name [, option]) % Note: it also incorporates a put action, i.e., it updates the global variable and saves it to a user-specified file.

  • update: the content to be updated (also updates global variable!) <any type>
  • name: name of the file (Note: folder is determlined by blocksettings for OutFolder? ) <char>
  • option: Matlab has different options on how to compress the variable before saving it. <char>

load_var(.event_field, name)

  • .event_field: BrainStream assigns returned result to event.event_field <char>
  • name: name of the file to load from <char>
 Todo: Add example table to demonstarte how this can be used in an experiment

Revision 704 Feb 2014 - Main.PhilipVanDenBroek

Line: 1 to 1
 
META TOPICPARENT name="WebHome"
-- PhilipVanDenBroek - 03 Feb 2014

Dedicated get and put actions

Changed:
<
<
There are cases in your experiment design where it would be handy to update information to the global variables in a user definable way, for instance to partially update or retrieve a variables structure field or to collect data in specific data structures. Such a feature can be implemented through dedicated get or put actions. Those functions should obey to a fixed format, where each format is different for get, put and a new get+mod actions:
>
>
There are cases in your experiment design where it would be handy to update information to the global variables in a user definable way, for instance to partially update or retrieve a variables structure field or to collect data in specific data structures. Such a feature can be implemented through dedicated get or put actions.

If you have plans to implement such custom-made functions, you should read following paragraph that explains how this can be done. Otherwise, jump directly to the next paragraph that demonstrates some examples that come standardly with BrainStream and demonstrate dedicated get/put actions to implement four data structures and direct update/retrieval from structure fields.

Building custom-made dedicated get and put actions

Those functions should obey to a fixed format, where each format is different for get, put and a new get+mod actions:

  get:
Line: 42 to 47
 

general format implementation func:

Changed:
<
<
      function [ret, var] = getmod_fun(var, varargin) 
         getmod_fun: the function name of your dedicated combined _get+mod_ action 
         var: the global variable 
         varargin: any additional user input arguments 
>
>
      function [ret, var] = get_fun(var, varargin) 
         get_fun: the function name of your dedicated combined _get+mod_ action 
         var: the global variable 
         varargin: any additional user input arguments 
  specification table:
      getmod_fun(content,varargin)        
         content: constant, function or name of field for event structure 
         varargin: any additional user input arguments  
Line: 52 to 57
 examples:
      pop_item (data structures: stack, queue) 
NOTE: this is a special newly introduced operation since it combines both a get- and a mod-operation. This combined action is necessary to implement data structures with pop behaviour, where a get operation not only retrieves some content from the data structure, but also modifies the content and thus implicitly also involves a mod operation to update the corresponding global variables content.
Added:
>
>
Important: Function names should always be prefixed with either of the following options: 'get_', 'pop_', 'put_', 'push_', 'load_' or 'save_' in order to be recognized by BrainStream as a dedicated get/put action. The functions should be copied to the BrainStream $BRAINSTREAM_FOLDER/core/getput/ folder.

Examples of custom-made get/put actions

 From abovementioned smart get/put general function formats, users can derive their own custom made function to achieve dedicated get/put retrieval/updating functionality. BrainStream comes standardly with an implementation of the four data structures:

  • queue
Line: 61 to 73
  These data structures are default available to the user and are modifiable via the functions:
Changed:
<
<
  • put_new: initiate a new data structure (all four data structures)
>
>
  • put_new: initiate a new data structure (all four data structures)
 
  • put_clear: clear previously initiated data structure (all four data structures)
  • put_item: put new content to data structure ( array )
  • push_item: push new content to data structure ( stack, shiftreg, queue )
Line: 69 to 81
 
  • get_item: get item from data structure ( array, shiftreg )
  • get_whole: get entire data returned (all four data structures)
Changed:
<
<
put_new(type, dims, len, returnascell [, field]) for: array, shiftreg
>
>
put_new(type, dims, len, returnascell [, field]) for: array, shiftreg
 
Changed:
<
<
put_new(type, dims, returnascell [, field]) for: queue, buffer, stack
>
>
put_new(type, dims, returnascell [, field]) for: queue, buffer, stack
 
  • dims: dimensions of added content (empty if not known) <numeric>
  • len: length of array or shift register <numeric>
  • returnascell: set to zero if entire content can be returned as numeric matrix <1,0>
  • field: assign result as structure field of global variable <char>
Changed:
<
<
put_clear([field])
>
>
put_clear([field])
 
  • field: assign result as structure field of global variable <char>
Changed:
<
<
put_item(update, idx [, field])
>
>
put_item(update, idx [, field])
 
  • update: the content to be updated (either constant value or a field of the event structure, literally specified and prefixed with a dot <any type>
  • idx: index position of entry to be updated <number>
  • field: assign result as structure field of global variable <char>
Changed:
<
<
push_item(update [, field])
>
>
push_item(update [, field])
 
  • update: the content to be updated (either constant value or a field of the event structure, literally specified and prefixed with a dot <any type>
  • field: assign result as structure field of global variable <char>
Changed:
<
<
pop_item(.event_field [, field])
>
>
pop_item(.event_field [, field])
 
  • field: retrieved from global variables structure field <char>
Changed:
<
<
get_item(idx [.event_field [, field])
>
>
get_item(idx [.event_field [, field])
 
  • idx: index position of entry to retrieve <number>
  • field: retrieved from global variables structure field <char>
Changed:
<
<
get_whole(.event_field [, field])
>
>
get_whole(.event_field [, field])
 
  • .event_field: BS stores returned result in event.event_field
  • field: retrieved from global variables structure field <char>
Added:
>
>
Todo: Add example table to demonstarte how this can be used in an experiment

Revision 604 Feb 2014 - Main.PhilipVanDenBroek

Line: 1 to 1
 
META TOPICPARENT name="WebHome"
-- PhilipVanDenBroek - 03 Feb 2014
Changed:
<
<

Dedicated get and put actions

>
>

Dedicated get and put actions

 
Changed:
<
<
There are cases in your experiment design where it would be handy to update information to the global variables in a user definable way, for instance to partially update or retrieve a variables structure field or to collect data in specific data structures. Such a feature can be implemented through dedicated get or put actions. Those functions should obey to a fixed format, where each format is different for get, put and a new get+mod actions:
>
>
There are cases in your experiment design where it would be handy to update information to the global variables in a user definable way, for instance to partially update or retrieve a variables structure field or to collect data in specific data structures. Such a feature can be implemented through dedicated get or put actions. Those functions should obey to a fixed format, where each format is different for get, put and a new get+mod actions:
  get:

general format implementation func:

Changed:
<
<
      function ret = get_fun(var, varargin)
specification in the table:
      get_fun(field,varargin)
notice the difference between function format and what is specified in your experiment definition table. In the tab 
      get_fun: the function name of your dedicated _get_ action 
      field: content is stored in this field of local event structure 
>
>
      function ret = get_fun(var, varargin)
         get_fun: the function name of your dedicated _get_ action  
         var: the global variable
         varargin: any additional user input arguments 
         ret: returned content derived from global variable  
specification in the table:
      get_fun(field,varargin)
Notice the difference between function format and what is specified in your experiment definition table. In the table, the first argument field is the name of the event structure field that gets the content assigned. Also, the global variable var is automatically added as input argument by BrainStream, like this is also happening in the table for functions and the first event input argument.
         field: content is stored in this field of local event structure 
 
varargin
any additional user input arguments

Line: 23 to 26
 

general format implementation func:

Changed:
<
<
function var = put_fun(var, update, varargin) 
specification table:
      put_fun(content,varargin)
      put_fun: the function name of your dedicated _put_ action
      content: constant, function or name of field for event structure 
>
>
function var = put_fun(var, update, varargin)
      put_fun: the function name of your dedicated _put_ action 
         var: the global variable
         update: content to update the global variable 
         varargin: any additional user input arguments 
specification table:
      put_fun(content,varargin)
         update: content to update the global variable, i.e., a constant, function or name of event structure field (prefix name with a dot) 
 
varargin
any additional user input arguments

Line: 37 to 42
 

general format implementation func:

Changed:
<
<
      function [ret, var] = getmod_fun(var, varargin) 
>
>
      function [ret, var] = getmod_fun(var, varargin) 
         getmod_fun: the function name of your dedicated combined _get+mod_ action 
         var: the global variable 
         varargin: any additional user input arguments 
  specification table:
Changed:
<
<
      getmod_fun(content,varargin)        
      getmod_fun: the function name of your dedicated combined _get+mod_ action 
      content: constant, function or name of field for event structure 
      varargin: any additional user input arguments  
>
>
      getmod_fun(content,varargin)        
         content: constant, function or name of field for event structure 
         varargin: any additional user input arguments  
 
Line: 56 to 61
  These data structures are default available to the user and are modifiable via the functions:
Changed:
<
<
  • put_new: initiate a new data structure (all four data structures)
>
>
  • put_new: initiate a new data structure (all four data structures)
 
  • put_clear: clear previously initiated data structure (all four data structures)
  • put_item: put new content to data structure ( array )
  • push_item: push new content to data structure ( stack, shiftreg, queue )
Line: 64 to 69
 
  • get_item: get item from data structure ( array, shiftreg )
  • get_whole: get entire data returned (all four data structures)
Changed:
<
<
put_new(type, dims, len, returnascell [, field]) % for: array, shiftreg
>
>
put_new(type, dims, len, returnascell [, field]) for: array, shiftreg
 
Changed:
<
<
put_new(type, dims, returnascell [, field]) % for: queue, buffer, stack
>
>
put_new(type, dims, returnascell [, field]) for: queue, buffer, stack
 
  • dims: dimensions of added content (empty if not known) <numeric>
  • len: length of array or shift register <numeric>
  • returnascell: set to zero if entire content can be returned as numeric matrix <1,0>
  • field: assign result as structure field of global variable <char>
Changed:
<
<
put_clear([field])
>
>
put_clear([field])
 
  • field: assign result as structure field of global variable <char>
Changed:
<
<
put_item(update, idx [, field])
>
>
put_item(update, idx [, field])
 
  • update: the content to be updated (either constant value or a field of the event structure, literally specified and prefixed with a dot <any type>
  • idx: index position of entry to be updated <number>
  • field: assign result as structure field of global variable <char>
Changed:
<
<
push_item(update [, field])
>
>
push_item(update [, field])
 
  • update: the content to be updated (either constant value or a field of the event structure, literally specified and prefixed with a dot <any type>
  • field: assign result as structure field of global variable <char>
Changed:
<
<
pop_item(.event_field [, field])
>
>
pop_item(.event_field [, field])
 
  • field: retrieved from global variables structure field <char>
Changed:
<
<
get_item(idx [.event_field [, field])
>
>
get_item(idx [.event_field [, field])
 
  • idx: index position of entry to retrieve <number>
  • field: retrieved from global variables structure field <char>
Changed:
<
<
get_whole(.event_field [, field])
>
>
get_whole(.event_field [, field])
 
  • .event_field: BS stores returned result in event.event_field
  • field: retrieved from global variables structure field <char>
\ No newline at end of file

Revision 504 Feb 2014 - Main.PhilipVanDenBroek

Line: 1 to 1
 
META TOPICPARENT name="WebHome"
-- PhilipVanDenBroek - 03 Feb 2014
Changed:
<
<
There are cases in your experiment design where it would be handy to update information to the global variables in a user definable way, for instance to partially update or retrieve a variables structure field or to collect data in specific data structures. Such a feature can be implemented through a 'smart' get or put operation. Those functions should obey to a fixed format, where each format is different for get, put and a new get+mod operations:
>
>

Dedicated get and put actions

There are cases in your experiment design where it would be handy to update information to the global variables in a user definable way, for instance to partially update or retrieve a variables structure field or to collect data in specific data structures. Such a feature can be implemented through dedicated get or put actions. Those functions should obey to a fixed format, where each format is different for get, put and a new get+mod actions:

  get:

general format implementation func:

Changed:
<
<
      function ret = get_fun(var, varargin)
specification table:
      get_fun(field,varargin)
      field: content is stored in this field of local event structure 
>
>
      function ret = get_fun(var, varargin)
specification in the table:
      get_fun(field,varargin)
notice the difference between function format and what is specified in your experiment definition table. In the tab 
      get_fun: the function name of your dedicated _get_ action 
      field: content is stored in this field of local event structure 
      varargin: any additional user input arguments  
 
Line: 21 to 24
  general format implementation func:
function var = put_fun(var, update, varargin) 
specification table:
      put_fun(content,varargin)
Changed:
<
<
content
constant, function or name of field for event structure
>
>
put_fun
the function name of your dedicated put action
content
constant, function or name of field for event structure
varargin
any additional user input arguments
 
Line: 35 to 40
 
      function [ret, var] = getmod_fun(var, varargin) 

specification table:

Changed:
<
<
      getmod_fun(content,varargin)        
      content: constant, function or name of field for event structure 
>
>
      getmod_fun(content,varargin)        
      getmod_fun: the function name of your dedicated combined _get+mod_ action 
      content: constant, function or name of field for event structure 
      varargin: any additional user input arguments  
 
Line: 59 to 64
 
  • get_item: get item from data structure ( array, shiftreg )
  • get_whole: get entire data returned (all four data structures)
Changed:
<
<
put_new(type, dims, len, returnascell [, field]) % for: array, shiftreg
>
>
put_new(type, dims, len, returnascell [, field]) % for: array, shiftreg
 
Changed:
<
<
put_new(type, dims, returnascell [, field]) % for: queue, buffer, stack
>
>
put_new(type, dims, returnascell [, field]) % for: queue, buffer, stack
 
  • dims: dimensions of added content (empty if not known) <numeric>
  • len: length of array or shift register <numeric>
  • returnascell: set to zero if entire content can be returned as numeric matrix <1,0>
  • field: assign result as structure field of global variable <char>
Changed:
<
<
put_clear([field])
>
>
put_clear([field])
 
  • field: assign result as structure field of global variable <char>
Changed:
<
<
put_item(update, idx [, field])
>
>
put_item(update, idx [, field])
 
  • update: the content to be updated (either constant value or a field of the event structure, literally specified and prefixed with a dot <any type>
  • idx: index position of entry to be updated <number>
  • field: assign result as structure field of global variable <char>
Changed:
<
<
push_item(update [, field])
>
>
push_item(update [, field])
 
  • update: the content to be updated (either constant value or a field of the event structure, literally specified and prefixed with a dot <any type>
  • field: assign result as structure field of global variable <char>
Changed:
<
<
pop_item(.event_field [, field])
>
>
pop_item(.event_field [, field])
 
  • field: retrieved from global variables structure field <char>
Changed:
<
<
get_item(idx [.event_field [, field])
>
>
get_item(idx [.event_field [, field])
 
  • idx: index position of entry to retrieve <number>
  • field: retrieved from global variables structure field <char>
Changed:
<
<
get_whole(.event_field [, field])
>
>
get_whole(.event_field [, field])
 
  • .event_field: BS stores returned result in event.event_field
  • field: retrieved from global variables structure field <char>

Revision 403 Feb 2014 - Main.PhilipVanDenBroek

Line: 1 to 1
 
META TOPICPARENT name="WebHome"
-- PhilipVanDenBroek - 03 Feb 2014
Changed:
<
<
There are cases in your experiment design where it would be handy to update information to the global variables in a user definable way, for instance to partially update or retrieve a variables structure field or to collect data. Such feature can be implemented through a 'smart' get or put operation. Those functions should obey to a fixed format, where each format is different for get, put and a new get+mod operations:
>
>
There are cases in your experiment design where it would be handy to update information to the global variables in a user definable way, for instance to partially update or retrieve a variables structure field or to collect data in specific data structures. Such a feature can be implemented through a 'smart' get or put operation. Those functions should obey to a fixed format, where each format is different for get, put and a new get+mod operations:
  get:
Line: 14 to 14
 

examples:

Changed:
<
<
get_item (data structures: array, shiftreg)  load_var 
>
>
get_item (data structures: array, shiftreg)  
load_var 
 
Changed:
<
<
put:
>
>
put:
 

general format implementation func:

Line: 26 to 26
 

examples:

Changed:
<
<
      put_item, push_item, put_new, put_clear (data structures: array, shiftreg, stack, queue)       save_var 
>
>
      put_item, push_item, put_new, put_clear (data structures: array, shiftreg, stack, queue)       
      save_var 
 
Changed:
<
<
get+mod:
>
>
get+mod:
  general format implementation func:
Added:
>
>
      function [ret, var] = getmod_fun(var, varargin) 
 
Changed:
<
<
function [ret, var] = get_fun(var, varargin)

specification table: put_fun(content,varargin)

content: constant, function or name of field for event structure

>
>
specification table:
      getmod_fun(content,varargin)        
      content: constant, function or name of field for event structure 
 
Changed:
<
<
: examples: :: pop_item (data structures: stack, queue)
>
>
 
Changed:
<
<
;The following data structures are available: # queue # stack # array # shift register
>
>
examples:
      pop_item (data structures: stack, queue) 
NOTE: this is a special newly introduced operation since it combines both a get- and a mod-operation. This combined action is necessary to implement data structures with pop behaviour, where a get operation not only retrieves some content from the data structure, but also modifies the content and thus implicitly also involves a mod operation to update the corresponding global variables content.
 
Changed:
<
<
;
>
>
From abovementioned smart get/put general function formats, users can derive their own custom made function to achieve dedicated get/put retrieval/updating functionality. BrainStream comes standardly with an implementation of the four data structures:
 
Changed:
<
<
Smart get and puts enabled the implementation of the four data structures: array, stack, shift register and queue and are modifiable via the functions:
>
>
  • queue
  • stack
  • array
  • shift register
 
Changed:
<
<
Smart get and puts enabled the implementation of the four data structures: array, stack, shift register and queue and are modifiable via the functions:
>
>
These data structures are default available to the user and are modifiable via the functions:
 
Changed:
<
<
  • put_new: initiate a new data structure (all four data structures)
  • put_clear: clear previously initiated data structure (all four data structures)
  • put_item: put new content to data structure ( array )
  • push_item: push new content to data structure ( stack, shiftreg, queue )
  • pop_item: pop item from data structure ( stack, queue )
  • get_item: get item from data structure ( array, shiftreg )
  • get_whole: get entire data returned (all four data structures)
>
>
  • put_new: initiate a new data structure (all four data structures)
  • put_clear: clear previously initiated data structure (all four data structures)
  • put_item: put new content to data structure ( array )
  • push_item: push new content to data structure ( stack, shiftreg, queue )
  • pop_item: pop item from data structure ( stack, queue )
  • get_item: get item from data structure ( array, shiftreg )
  • get_whole: get entire data returned (all four data structures)
 
Changed:
<
<
put_new(type, dims, len, returnascell [, field]) % for: array, shiftreg
>
>
put_new(type, dims, len, returnascell [, field]) % for: array, shiftreg
 
Changed:
<
<
put_new(type, dims, returnascell [, field]) % for: queue, buffer, stack
>
>
put_new(type, dims, returnascell [, field]) % for: queue, buffer, stack
 
Changed:
<
<
  • % dims: dimensions of added content (empty if not known) <numeric>
  • % len: length of array or shift register <numeric>
  • % returnascell: set to zero if entire content can be returned as numeric matrix <1,0>
  • % field: assign result as structure field of global variable <char>
>
>
  • dims: dimensions of added content (empty if not known) <numeric>
  • len: length of array or shift register <numeric>
  • returnascell: set to zero if entire content can be returned as numeric matrix <1,0>
  • field: assign result as structure field of global variable <char>
 
Changed:
<
<
put_clear([field])
>
>
put_clear([field])
 
Changed:
<
<
  • % field: assign result as structure field of global variable <char>
>
>
  • field: assign result as structure field of global variable <char>
 
Changed:
<
<
put_item(update, idx [, field])
>
>
put_item(update, idx [, field])
 
Changed:
<
<
  • % update: the content to be updated (either constant value or a field of the event
  • % structure, literally specified and prefixed with a dot <any type>
  • % idx: index position of entry to be updated <number>
  • % field: assign result as structure field of global variable <char>
>
>
  • update: the content to be updated (either constant value or a field of the event structure, literally specified and prefixed with a dot <any type>
  • idx: index position of entry to be updated <number>
  • field: assign result as structure field of global variable <char>
 
Changed:
<
<
push_item(update [, field])
>
>
push_item(update [, field])
 
Changed:
<
<
  • % update: the content to be updated (either constant value or a field of the event
  • % structure, literally specified and prefixed with a dot <any type>
  • % field: assign result as structure field of global variable <char>
>
>
  • update: the content to be updated (either constant value or a field of the event structure, literally specified and prefixed with a dot <any type>
  • field: assign result as structure field of global variable <char>
 
Changed:
<
<
pop_item(.event_field [, field])
>
>
pop_item(.event_field [, field])
 
Changed:
<
<
  • % field: retrieved from global variables structure field <char>
>
>
  • field: retrieved from global variables structure field <char>
 
Changed:
<
<
get_item(idx [.event_field [, field])
>
>
get_item(idx [.event_field [, field])
 
Changed:
<
<
  • % idx: index position of entry to retrieve <number>
  • % field: retrieved from global variables structure field <char>
>
>
  • idx: index position of entry to retrieve <number>
  • field: retrieved from global variables structure field <char>
 
Changed:
<
<
get_whole(.event_field [, field])
>
>
get_whole(.event_field [, field])
 
Changed:
<
<
  • % .event_field: BS stores returned result in event.event_field
  • % field: retrieved from global variables structure field <char>
>
>
  • .event_field: BS stores returned result in event.event_field
  • field: retrieved from global variables structure field <char>

Revision 303 Feb 2014 - Main.PhilipVanDenBroek

Line: 1 to 1
 
META TOPICPARENT name="WebHome"
-- PhilipVanDenBroek - 03 Feb 2014

There are cases in your experiment design where it would be handy to update information to the global variables in a user definable way, for instance to partially update or retrieve a variables structure field or to collect data. Such feature can be implemented through a 'smart' get or put operation. Those functions should obey to a fixed format, where each format is different for get, put and a new get+mod operations:

Added:
>
>
get:
 
Changed:
<
<
doorgehaald # hallo # hooi

;get: : general format: :: implementation func: function ret = get_fun(var, varargin) :: specification table: get_fun(field,varargin) :: field: content is stored in this field of local event structure

: examples: :: get_item (data structures: array, shiftreg) :: load_var

;put: : general format: :: implementation func: function var = put_fun(var, update, varargin) :: specification table: put_fun(content,varargin) :: content: constant, function or name of field for event structure

: examples: :: put_item, push_item, put_new, put_clear (data structures: array, shiftreg, stack, queue) :: save_var

;get+mod: :general format: ::implementation func: function [ret, var] = get_fun(var, varargin) ::specification table: put_fun(content,varargin) ::content: constant, function or name of field for event structure

: examples: :: pop_item (data structures: stack, queue)

;The following data structures are available: # queue # stack # array # shift register

>
>
general format implementation func:
      function ret = get_fun(var, varargin)
specification table:
      get_fun(field,varargin)
      field: content is stored in this field of local event structure 

examples:

get_item (data structures: array, shiftreg)  load_var 

put:

general format implementation func:

function var = put_fun(var, update, varargin) 
specification table:
      put_fun(content,varargin)
      content: constant, function or name of field for event structure 

examples:

      put_item, push_item, put_new, put_clear (data structures: array, shiftreg, stack, queue)       save_var 

get+mod:

general format implementation func:

function [ret, var] = get_fun(var, varargin)

specification table: put_fun(content,varargin)

content: constant, function or name of field for event structure

: examples: :: pop_item (data structures: stack, queue)

;The following data structures are available: # queue # stack # array # shift register

  ;

Revision 203 Feb 2014 - Main.PhilipVanDenBroek

Line: 1 to 1
 
META TOPICPARENT name="WebHome"
-- PhilipVanDenBroek - 03 Feb 2014
Changed:
<
<
There are cases in your experiment design where it would be handy to update information to the global variables in a user definable way, for instance to partially update or retrieve a variables structure field or to collect data. Such feature can be implemented through a smart get or put operation. The functions that implement such operation should obey to the following format:
>
>
There are cases in your experiment design where it would be handy to update information to the global variables in a user definable way, for instance to partially update or retrieve a variables structure field or to collect data. Such feature can be implemented through a 'smart' get or put operation. Those functions should obey to a fixed format, where each format is different for get, put and a new get+mod operations:

doorgehaald # hallo # hooi

;get: : general format: :: implementation func: function ret = get_fun(var, varargin) :: specification table: get_fun(field,varargin) :: field: content is stored in this field of local event structure

: examples: :: get_item (data structures: array, shiftreg) :: load_var

;put: : general format: :: implementation func: function var = put_fun(var, update, varargin) :: specification table: put_fun(content,varargin) :: content: constant, function or name of field for event structure

: examples: :: put_item, push_item, put_new, put_clear (data structures: array, shiftreg, stack, queue) :: save_var

;get+mod: :general format: ::implementation func: function [ret, var] = get_fun(var, varargin) ::specification table: put_fun(content,varargin) ::content: constant, function or name of field for event structure

: examples: :: pop_item (data structures: stack, queue)

;The following data structures are available: # queue # stack # array # shift register

;

  Smart get and puts enabled the implementation of the four data structures: array, stack, shift register and queue and are modifiable via the functions:
Changed:
<
<
put_new: initiate a new data structure (all four data structures) put_clear: clear previously initiated data structure (all four data structures) put_item: put new content to data structure ( _array_) push_item: push new content to data structure ( _stack, shiftreg, queue_) pop_item: pop item from data structure ( _stack, queue_) get_item: get item from data structure ( _array, shiftreg_) get_whole: get entire data returned (all four data structures)
>
>
Smart get and puts enabled the implementation of the four data structures: array, stack, shift register and queue and are modifiable via the functions:

  • put_new: initiate a new data structure (all four data structures)
  • put_clear: clear previously initiated data structure (all four data structures)
  • put_item: put new content to data structure ( array )
  • push_item: push new content to data structure ( stack, shiftreg, queue )
  • pop_item: pop item from data structure ( stack, queue )
  • get_item: get item from data structure ( array, shiftreg )
  • get_whole: get entire data returned (all four data structures)
  put_new(type, dims, len, returnascell [, field]) % for: array, shiftreg
Added:
>
>
 put_new(type, dims, returnascell [, field]) % for: queue, buffer, stack
Changed:
<
<
% dims: dimensions of added content (empty if not known) <numeric> % len: length of array or shift register <numeric> % returnascell: set to zero if entire content can be returned as numeric matrix <1,0> % field: assign result as structure field of global variable <char>
>
>
  • % dims: dimensions of added content (empty if not known) <numeric>
  • % len: length of array or shift register <numeric>
  • % returnascell: set to zero if entire content can be returned as numeric matrix <1,0>
  • % field: assign result as structure field of global variable <char>
  put_clear([field])
Changed:
<
<
% field: assign result as structure field of global variable <char>
>
>
  • % field: assign result as structure field of global variable <char>
  put_item(update, idx [, field])
Changed:
<
<
% update: the content to be updated (either constant value or a field of the event % structure, literally specified and prefixed with a dot <any type> % idx: index position of entry to be updated <number> % field: assign result as structure field of global variable <char>
>
>
  • % update: the content to be updated (either constant value or a field of the event
  • % structure, literally specified and prefixed with a dot <any type>
  • % idx: index position of entry to be updated <number>
  • % field: assign result as structure field of global variable <char>
  push_item(update [, field])
Changed:
<
<
% update: the content to be updated (either constant value or a field of the event % structure, literally specified and prefixed with a dot <any type> % field: assign result as structure field of global variable <char>
>
>
  • % update: the content to be updated (either constant value or a field of the event
  • % structure, literally specified and prefixed with a dot <any type>
  • % field: assign result as structure field of global variable <char>
  pop_item(.event_field [, field])
Changed:
<
<
% field: retrieved from global variables structure field <char>
>
>
  • % field: retrieved from global variables structure field <char>
  get_item(idx [.event_field [, field])
Changed:
<
<
% idx: index position of entry to retrieve <number> % field: retrieved from global variables structure field <char>
>
>
  • % idx: index position of entry to retrieve <number>
  • % field: retrieved from global variables structure field <char>
  get_whole(.event_field [, field])
Changed:
<
<
% .event_field: BS stores returned result in event.event_field % field: retrieved from global variables structure field <char>
>
>
  • % .event_field: BS stores returned result in event.event_field
  • % field: retrieved from global variables structure field <char>

Revision 103 Feb 2014 - Main.PhilipVanDenBroek

Line: 1 to 1
Added:
>
>
META TOPICPARENT name="WebHome"
-- PhilipVanDenBroek - 03 Feb 2014

There are cases in your experiment design where it would be handy to update information to the global variables in a user definable way, for instance to partially update or retrieve a variables structure field or to collect data. Such feature can be implemented through a smart get or put operation. The functions that implement such operation should obey to the following format:

Smart get and puts enabled the implementation of the four data structures: array, stack, shift register and queue and are modifiable via the functions:

put_new: initiate a new data structure (all four data structures) put_clear: clear previously initiated data structure (all four data structures) put_item: put new content to data structure ( _array_) push_item: push new content to data structure ( _stack, shiftreg, queue_) pop_item: pop item from data structure ( _stack, queue_) get_item: get item from data structure ( _array, shiftreg_) get_whole: get entire data returned (all four data structures) put_new(type, dims, len, returnascell [, field]) % for: array, shiftreg put_new(type, dims, returnascell [, field]) % for: queue, buffer, stack % dims: dimensions of added content (empty if not known) <numeric> % len: length of array or shift register <numeric> % returnascell: set to zero if entire content can be returned as numeric matrix <1,0> % field: assign result as structure field of global variable <char> put_clear([field]) % field: assign result as structure field of global variable <char> put_item(update, idx [, field]) % update: the content to be updated (either constant value or a field of the event % structure, literally specified and prefixed with a dot <any type> % idx: index position of entry to be updated <number> % field: assign result as structure field of global variable <char> push_item(update [, field]) % update: the content to be updated (either constant value or a field of the event % structure, literally specified and prefixed with a dot <any type> % field: assign result as structure field of global variable <char> pop_item(.event_field [, field]) % field: retrieved from global variables structure field <char> get_item(idx [.event_field [, field]) % idx: index position of entry to retrieve <number> % field: retrieved from global variables structure field <char> get_whole(.event_field [, field]) % .event_field: BS stores returned result in event.event_field % field: retrieved from global variables structure field <char>

 
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback