Contents   Functions      PDF Index |
Purpose
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.
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. Note that istrue is output in format double and not logical. See also strncmp.
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.
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.
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.
Return the standard date string. Used by ufwrite, naswrite, etc. See also date, datenum.
Fills the string CAM with blanks up to nc characters.
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').
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.
This is used to generate tabular output of the cell array tt to various supported types : tab (opens a java tab containing the table), excel (Microsoft Excel only available on windows), html, csv (comma separated values, readable by excel), tex (latex formatting), text printout to the command window.
% A sample table tab=num2cell(reshape(1:10,[],2));tab(1,:)={'c1','c2'}; tname=nas2up('tempname o.html'); % RO option structure to format a table for HTML or java output RO=struct('fmt',{{'%3i','%.1f'}}, ... % Formatting for each column 'HasHead',1); % a header is provided as strings RO.fopen={tname,'a+'}; % Opening information RO.OpenOnExit=0; RO.Legend=sprintf('<p>%s</p>','My HTML legend'); % comstr(tab,-17,[],RO.fmt) comstr(tab,-17,'html',RO); sdtweb('_link',sprintf('web(''%s'')',tname)) % Show the table in JAVA tab comstr(tab,-17,'tab',RO); % Generate tex output of java tabs comstr(struct('FigTag','SDT Root'),-17,'tex'); comstr(gcf,-17,'tex');
Accepted fields for the options structure are
Fields specific for HTML generation are
Fields specific for JAVA tabs are
See also