String handling functions for the Structural Dynamics Toolbox.
Syntax
See details below
Description
The user interfaces of the Structural Dynamics Toolbox have a
number of string handling needs which have been grouped in the
comstr function. The appropriate formats and usual place of use are
indicated below.
istrue=comstr(Cam,'string')
String comparison. 1 is returned if the first
characters of Cam contain the complete 'string'. 0
is returned otherwise. This call is used extensively for command
parsing. See also strncmp.
[opt,CAM,Cam]=comstr(CAM,'string','format')
Next string match and parameter extraction. comstr finds
the first character where lower(CAM) differs from string. Reads the remaining string using the sscanf specified
format. Returns opt the result of sscanf and CAM the remaining characters that could not be read with the given
format.
[opt,CAM,Cam]=comstr(CAM,'string','%c') is used to eliminate the matching part of string.
[CAM,Cam] = comstr(CAM,ind)
Command segmentation with removal of front and tail
blanks. The first ind characters of the string command in
capitals CAM are eliminated. The front and tail blanks are
eliminated. Cam is a lowercase version of CAM. This call
to comstr is used in all UI command functions for command
segmentation.
opt = comstr(CAM,[-1 default])
Option parameter evaluation. The string CAM is evaluated for numerical values which are output in the row vector opt. If a set of default values default is given any unspecified value in opt will be set to the default.
date = comstr(CAM,[-3])
Return the standard date string. Used by ufwrite, naswrite, etc. See also date, datenum.
CAM = comstr(CAM,[-4 nc ])
Fills the string CAM with blanks up to nc characters.
comstr(Matrix,[-5 fid],'format')
Formatted output of Matrix, the format is repeated as many times as Matrix has columns and a formatted output to
fid (default is 1 standard output). For example you might use comstr(ii_mac(md1,md2)*100,[-5 1],'%6.0f').
st1=comstr(st1,-7,'string')
Used for dynamic messaging on the command line. On UNIX platforms (the backspace does not work properly on Windows), the string st1 is erased before 'string' is displayed.
comstr(tt,-17,'type')
This is used to generate tabular output of the cell array tt to
various supported types : excel (Microsoft Excel only available
on windows), html, csv (comma separated values, readable
by excel), tex.