# How do I combine column vectors with different rows

0

For example I have two column vectors (string)

```A = { "aa", "ab", "ac" }

B = { "bb", "bc" }
```

I want to create:

```AB =  aa   .
ab  bb
ac  bc
```

or

```AB =  aa  bb
ab  bc
ac    .
```

0

If your data are string arrays, then you could concatenate a "." onto the top (or bottom) of the string array with fewer rows, like this:

```string A = { "aa", "ab", "ac" };
string B = { "bb", "bc" };

B2 = "."\$|B;
AB = A\$~B2;
"AB = " AB;```

In the code above, \$| performs vertical concatenation of strings and string arrays while \$~ performs horizontal concatenation of strings and string arrays.

If what you have is instead character matrices, then you have the option of adding a GAUSS missing value as the extra element or a character dot:

```
AM = { "aa", "ab", "ac" };
BM = { "bb", "bc" };

BM2 = miss(0,0)|B;
ABM = A~B2;
"AB = " AB;```

The miss function creates a missing value. If you wanted instead to add a character dot, then change the assignment of BM2 to:

`BM2 = "."|B;`

0

If your data are string arrays, then you could concatenate a "." onto the top (or bottom) of the string array with fewer rows, like this:

```string A = { "aa", "ab", "ac" };
string B = { "bb", "bc" };

B2 = "."\$|B;
AB = A\$~B2;
"AB = " AB;```

In the code above, \$| performs vertical concatenation of strings and string arrays while \$~ performs horizontal concatenation of strings and string arrays.

If what you have is instead character matrices, then you have the option of adding a GAUSS missing value as the extra element or a character dot:

```
AM = { "aa", "ab", "ac" };
BM = { "bb", "bc" };

BM2 = miss(0,0)|B;
ABM = A~B2;
"AB = " AB;```

The miss function creates a missing value. If you wanted instead to add a character dot, then change the assignment of BM2 to:

`BM2 = "."|B;`

• ### Aptech Systems, Inc. Worldwide Headquarters

Aptech Systems, Inc.
2350 East Germann Road, Suite #21
Chandler, AZ 85286

Phone: 360.886.7100
FAX: 360.886.8922

• ### Training & Events

Want more guidance while learning about the full functionality of GAUSS and its capabilities? Get in touch for in-person training or browse additional references below.

• ### Tutorials

Step-by-step, informative lessons for those who want to dive into GAUSS and achieve their goals, fast.

• ### Want to find out more?

Get a real answer from a real person

• ### Have a Specific Question?

Get a real answer from a real person

• Need Support?
• ### Support Plans

Premier Support and Platinum Premier Support are annually renewable membership programs that provide you with important benefits including technical support, product maintenance, and substantial cost-saving features for your GAUSS System or the GAUSS Engine.

• ### User Forums

Join our community to see why our users are considered some of the most active and helpful in the industry!