readcae

Reads data from a given file. readcae uses the CAE readers provided with Compose and supports a large set of file formats.

Syntax

readcae(filename, datatype, request, component, time, outputType)

readcae(filename, subcase, datatype, request, component, time, outputType)

R = readcae(...)

Inputs

filename
Path of the file.
Type: string
subcase
Subcase name or index in the file.
Type: string | int
datatype
Type name or index in the file.
Type: string | int
request
Request name or index, list of indices, list of names, or range of indices.
Matrix supported forms are:
[]
Extract all requests.
[i:j]
Extract ith to jth index (inclusive).
[i,j,k,l]
Extract the specified request indices.
Cell supported forms are:
{}
Extract all requests.
{i,j,k,l}
Extract the specified indices.
{'req1','req2','req3'}
Extract the specified requests.
Type: string | int | cell | matrix
component
Component name or index, list of indices, list of names, or range of indices.
Matrix supported forms are:
[]
Extract all components.
[i:j]
Extract ith to jth index (inclusive).
[i,j,k,l]
Extract the specified component indices.
Cell supported forms are:
{}
Extract all components.
{i,j,k,l}
Extract the specified indices.
{'req1','req2','req3'}
Extract the specified components.
Type: string | int | cell | matrix
time
Time name or index, list of indices, list of names, or range of indices.
Matrix supported forms are:
[]
Extract all time steps.
[i:j]
Extract ith to jth index (inclusive).
[i,j,k,l]
Extract the specified time step indices.
Cell supported forms are:
{}
Extract all time steps.
{i,j,k,l}
Extract the specified indices.
{'req1','req2','req3'}
Extract the specified time steps.
Type: string | int | cell | matrix
outputType
Determines the output type of the readcae command. Supported values are 0 or 1.
0
Cell
1
Multi-dimensional matrix.
Type: integer

Outputs

R
If outputType is 0, then output is a cell.
If outputType is 1, then output is a multi-dimensional matrix.

Example 1

readcae file with a subcase. Output is a cell.

output1=readcae('control_arm_sol111.pch', 'Subcase 1', 1, {}, [], [], 0)
output1 = 
{
[1,1] Subcase 1
[1,2] 1
[1,3] Frequency [Hz]
[1,4] Frequency [Hz]
[1,5] [Matrix] 1 x 22 Row[1] Columns[1:12]
10.00000  10.25000  10.50000  10.75000  11.00000  11.25000  11.50000  11.75000  12.00000  12.25000  12.50000  12.75000

Row[1] Columns[13:22]
13.00000  13.25000  13.50000  13.75000  14.00000  14.25000  14.50000  14.75000  15.00000  15.25000  
}

Example 2

readcae file with a subcase. Output is a cell.

output2=readcae('control_arm_sol111.pch', 'Subcase 1', 2, {1}, [1:3], [1,3], 0)
output2 = 
{
[1,1] Subcase 1
[1,2] 2
[1,3] 1
[1,4] 1
[1,5] [Matrix] 1 x 2
10.00000  10.50000
[2,1] Subcase 1
[2,2] 2
[2,3] 1
[2,4] 2
[2,5] [Matrix] 1 x 2
0.08723  0.12283
[3,1] Subcase 1
[3,2] 2
[3,3] 1
[3,4] 3
[3,5] [Matrix] 1 x 2
-0.00968  -0.17936
}

Example 3

readcae file with a subcase. Output is a multi-dimensional matrix.

output3=readcae('control_arm_sol111.pch', 'Subcase 1', 1, {}, [], [], 1)
output3 = 
slice(:, :, 1) = 
10

slice(:, :, 2) = 
10.25

slice(:, :, 3) = 
10.5

slice(:, :, 4) = 
10.75

slice(:, :, 5) = 
11

...

slice(:, :, 20) = 
14.75
    

slice(:, :, 21) = 
15

slice(:, :, 22) = 
15.25

Example 4

readcae file with a subcase. Output is a multi-dimensional matrix.

output4=readcae('control_arm_sol111.pch', 'Subcase 1', 2, {1}, [1:3], [1,3], 1)
output4 = 
slice(:, :, 1) = 
[Matrix] 1 x 3
10.00000  0.08723  -0.00968

slice(:, :, 2) = 
[Matrix] 1 x 3
10.50000  0.12283  -0.17936

Example 5

readcae file without a subcase. Output is a cell.

output5=readcae('ANGACC', 1, {}, [], [], 0)
output5 = 
{
[1,1] 1
[1,2] Time
[1,3] Time
[1,4] [Matrix] 1 x 151 Row[1] Columns[1:33]
0  1  2  3  4  5  6  7  8  9  10  11  12  13  14  15  16  17  18  19  20  21  22  23  24  25  26  27  28  29  30  31  32

Row[1] Columns[34:64]
33  34  35  36  37  38  39  40  41  42  43  44  45  46  47  48  49  50  51  52  53  54  55  56  57  58  59  60  61  62  63  

Row[1] Columns[65:95]
64  65  66  67  68  69  70  71  72  73  74  75  76  77  78  79  80  81  82  83  84  85  86  87  88  89  90  91  92  93  94  

Row[1] Columns[96:120]
95  96  97  98  99  100  101  102  103  104  105  106  107  108  109  110  111  112  113  114  115  116  117  118  119  

Row[1] Columns[121:144]
120  121  122  123  124  125  126  127  128  129  130  131  132  133  134  135  136  137  138  139  140  141  142  143  

Row[1] Columns[145:151]
144  145  146  147  148  149  150  
}

Example 6

readcae file without a subcase. Output is a cell.

output6=readcae('ANGACC', 2, {1}, [1:3], [1,3], 0)
output6 = 
{
[1,1] 2
[1,2] 1
[1,3] 1
[1,4] [Matrix] 1 x 2
189.77340  43.76210
[2,1] 2
[2,2] 1
[2,3] 2
[2,4] [Matrix] 1 x 2
-3.17862  0.07681
[3,1] 2
[3,2] 1
[3,3] 3
[3,4] [Matrix] 1 x 2
-189.74020  -43.72750
}

Example 7

readcae file without a subcase. Output is a multi-dimensional matrix.

output7=readcae('ANGACC', 1, {}, [], [], 1)
output7 = 
slice(:, :, 1) = 
0

slice(:, :, 2) = 
1

slice(:, :, 3) = 
2

slice(:, :, 4) = 
3

slice(:, :, 5) = 
4

...

slice(:, :, 146) = 
145

slice(:, :, 147) = 
146

slice(:, :, 148) = 
147

slice(:, :, 149) = 
148

slice(:, :, 150) = 
149
    

slice(:, :, 151) = 
150

Example 8

readcae file without a subcase. Output is a multi-dimensional matrix.

output8=readcae('ANGACC', 2, {1}, [1:3], [1,3], 1)
output8 = 
slice(:, :, 1) = 
[Matrix] 1 x 3
189.77340  -3.17862  -189.74020

slice(:, :, 2) = 
[Matrix] 1 x 3
43.76210  0.07681  -43.72750

Comments

When using readcae without the use of releasefileinfo in sequence, the subsequent executions of the script will load a version of the file that is already in the memory, not from the disk.