]> git.proxmox.com Git - ceph.git/blame - ceph/src/arrow/matlab/test/util/createTable.m
import quincy 17.2.0
[ceph.git] / ceph / src / arrow / matlab / test / util / createTable.m
CommitLineData
1d09f67e
TL
1function t = createTable()
2% CREATETABLE Helper function for creating test table.
3
4% Licensed to the Apache Software Foundation (ASF) under one or more
5% contributor license agreements. See the NOTICE file distributed with
6% this work for additional information regarding copyright ownership.
7% The ASF licenses this file to you under the Apache License, Version
8% 2.0 (the "License"); you may not use this file except in compliance
9% with the License. You may obtain a copy of the License at
10%
11% http://www.apache.org/licenses/LICENSE-2.0
12%
13% Unless required by applicable law or agreed to in writing, software
14% distributed under the License is distributed on an "AS IS" BASIS,
15% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
16% implied. See the License for the specific language governing
17% permissions and limitations under the License.
18
19variableNames = {'uint8', ...
20 'uint16', ...
21 'uint32', ...
22 'uint64', ...
23 'int8', ...
24 'int16', ...
25 'int32', ...
26 'int64', ...
27 'single', ...
28 'double'};
29
30variableTypes = {'uint8', ...
31 'uint16', ...
32 'uint32', ...
33 'uint64', ...
34 'int8', ...
35 'int16', ...
36 'int32', ...
37 'int64', ...
38 'single', ...
39 'double'};
40
41uint8Data = uint8([1; 2; 3]);
42uint16Data = uint16([1; 2; 3]);
43uint32Data = uint32([1; 2; 3]);
44uint64Data = uint64([1; 2; 3]);
45int8Data = int8([1; 2; 3]);
46int16Data = int16([1; 2; 3]);
47int32Data = int32([1; 2; 3]);
48int64Data = int64([1; 2; 3]);
49singleData = single([1/2; 1/4; 1/8]);
50doubleData = double([1/10; 1/100; 1/1000]);
51
52numRows = 3;
53numVariables = 10;
54
55t = table('Size', [numRows, numVariables], 'VariableTypes', variableTypes, 'VariableNames', variableNames);
56
57t.uint8 = uint8Data;
58t.uint16 = uint16Data;
59t.uint32 = uint32Data;
60t.uint64 = uint64Data;
61t.int8 = int8Data;
62t.int16 = int16Data;
63t.int32 = int32Data;
64t.int64 = int64Data;
65t.single = singleData;
66t.double = doubleData;
67
68end