Wiki Markup |
\\
{info}
This article is devoted to *MatLab* application using the SAP2000 *API*.
{info}
h1. Single-cell arrays
MatLab default settings store all numeric values within the double-precision floating-point numeric class. MatLab reads a single value as an array with one double-precision element, or a 1x1 matrix. When this value is passed to the API, the API expects an array or multiple values.
For compatibility between MatLab and API, please dimension arrays as 2x1 matrices and use only the first address for single values.
\\
\\
{hidden-content}
h1. Previous page content:
MATLAB has a number of little quirks that the users have to deal with to use SAP2000 API. The goal of this page is identify such issues that we are aware of.
h1. Handling of arrays with single element
Apparently, MATLAB converts arrays with a single element (i.e. 1x1 matrices) to a regular double. This poses a problem when the API is expecting array and the workaround is to dimension the arrays to 2x1 and use only the first element of the array.
{hidden-content}
{hidden-content}
Related emails:
* {email:date=5/26/2011|from=bt|to=rs|subject=Handling of arrays with single element in Matlab|comment=|id=7635970}
Related incidents:
* {incident:no=35420|comment=Confirmation that the above works.}
{hidden-content} Info |
---|
This article is devoted to MatLab applications which use the SAP2000 OAPI. |
Single-cell arrays
To ensure compatibility between MatLab and the SAP2000 OAPI, each single-cell array (1x1 matrix) should be dimensioned as a 2x1 matrix, then the value should be addressed to the first cell. By default, MatLab settings store numeric values within the double-precision floating-point numeric class, which would otherwise pose a problem since the OAPI expects an array.
Show if |
---|
|
Related Emails: - Email Handling of arrays with single element in Matlab: (bt → rs, 5/26/2011, ID 7635970)
Related Incidents: - Incident 35420: Confirmation that the above works.
|