resvector

Returns a vector or matrix of values at a given timestep.

Syntax

resvector(file_name, type, start_request, end_request,start_component, end_component, timestep, [subcase])

Argument

file_name
The name of the file from which to read.
type
The type of data to read specified as the explicit numerical index.
start_request
The first data request to read specified as the explicit numerical index.
end_request
The last data request to read specified as the explicit numerical index. Must be greater than or equal to start_request.
start_component
The first data component to read specified as the explicit numerical index.
end_component
The last data component to read specified as the explicit numerical index. Must be greater than or equal to start_component.
timestep
The timestep to read specified as an index.
[subcase]
Optional argument. The subcase to read specified as the explicit numerical index. It is assumed to be 0 (the first subcase) if unspecified. Many file formats do not support subcases, in which case the argument should not be specified.

Example

Templex Expression Results
{a = resvector(“nodout”, 1, 13, 26, 0, 0, 14)} This creates a vector of results for each of the requests from 13 to 26 (inclusive) for component 0 at timestep 14.

Comments

All indices are 0-based.

This statement uses any available readers (import templates, external readers, or shared readers) to read the given datafile.

The read statement is used to acquire data for a particular type, request, and component across timesteps. The resvector statement is used to acquire data for a particular type at a particular timestep across requests and components.

The result will be a matrix of size (end_requeststart_request+1) rows and (end_componentstart_component + 1) columns. If start_component and end_component are equal, the result is a column vector. If start_request and end_request are equal, the result is a row vector.

Please see readsim for a more robust version of this function.