Skip to content

"chain" setBatch functions to create a list of batches to then be executed in one single workflow. #184

@marcobarilari

Description

@marcobarilari

Something we might have to decide for all functions that create batches.

That they simply "extend" a previous batch that is passed to them as argument:

matlabbatchOUT = setBatchFoo(matlabbatchIN, arg1)

where numel(matlabbatchOUT) = numel(matlabbatchIN) + 1

The reason why this default way of setting up is that it makes easy to "chain" setBatch functions to create a list of batches to then be executed in one single workflow.

The template could look like that.

function matlabbatch = setBatchFoo(matlabbatch, argin2, argin3)
  %
  % Short description of what the function does goes here.
  %
  % USAGE::
  %
  %   [argout1, argout2] = setBatchFoo([matlabbatch] [, argin2 == default] [, argin3])
  %
  % :param matlabbatch: 
  % :type matlabbatch: structure
  % :param argin2: optional argument and its default value. And some of the
  %               options can be shown in litteral like ``this`` or ``that``.
  % :type argin2: string
  % :param argin3: (dimension) optional argument
  %
  % :returns:
  % 
  %           - :matlabbatch: (structure)
  %

  printBatchName('nameOfThisBatch');

  if nargin<1
   matlabbatch = [];
  end

  matlabbatch{end + 1}. %
  matlabbatch{end}. % 

end

Originally posted by @Remi-Gau in #179 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions