Contents     Functions         Previous Next     PDF Index

stack_get,stack_set,stack_rm

Purpose

Stack handling functions.

Syntax

[StackRows,index]=stack_get(model,typ);
[StackRows,index]=stack_get(model,typ,name);
Up=stack_set(model,typ,name,val)
Up=stack_rm(model,typ,name);
Up=stack_rm(model,typ);
Up=stack_rm(model,'',name);

Description

The .Stack field is used to store a variety of information, in a N by 3 cell array with each row of the form {'type','name',val} (see section 7.6 or section 7.7 for example). The purpose of this cell array is to deal with an unordered set of data entries which can be classified by type and name.

Since sorting can be done by name only, names should all be distinct. If the types are different, this is not an obligation, just good practice. In get and remove calls, typ and name can start by # to use a regular expression based on matching (use doc regexp to access detailed documentation on regular expressions).

Syntax

Case.Stack={'DofSet','Point accel',[4.03;55.03];
            'DofLoad','Force',[2.03];
            'SensDof','Sensors',[4 55 30]'+.03};
% Replace first entry
Case=stack_set(Case,'DofSet','Point accel',[4.03;55.03;2.03]);
Case.Stack
% Add new entry
Case=stack_set(Case,'DofSet','P2',[4.03]);
Case.Stack
% Remove entry
Case=stack_rm(Case,'','Sensors');Case.Stack
% Get DofSet entries and access
[Val,ind]=stack_get(Case,'DofSet')
Case.Stack{ind(1),3} % same as Val{1,3}
% Regular expression match of entries starting with a P
stack_get(Case,'','#P*')

SDT provides simplified access to stacks in feplot (see section 4.4.3) and iiplot figures (see section 2.1.2). cf.Stack{'Name'} can be used for direct access to the stack, and cf.CStack{'Name'} for access to FEM model case stacks.


©1991-2014 by SDTools
Previous Up Next