cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

How to append elements of two or more vectors

PaulN
5-Regular Member

How to append elements of two or more vectors

I am trying to create a vector with values like this

1, 2, 3, 4, 4.2, 4.4, 4.6, 4.8, 5, 6, 7, 8

In practice there will be many more values and it wouldn't be practical to enter them one at a time. If I create three vectors like this

v1 := 1,2..4

v2 = 4.2,.4...4.8

v3 = 5,6..8

Is there some way I can combine them into a single vector?

Also, I would like the resulting vector to be a row vector rather than a column vector (if that is possible).

1 ACCEPTED SOLUTION

Accepted Solutions
ttokoro
20-Turquoise
(To:PaulN)

6 REPLIES 6
ttokoro
20-Turquoise
(To:PaulN)

image.pngimage.pngimage.pngimage.pngimage.png

PaulN
5-Regular Member
(To:ttokoro)

Amazing ... I would never have found that. Many thanks
PaulN
5-Regular Member
(To:ttokoro)

I know I marked this topic as solved but can I add a follow-up question (about length, rows and cols) or should I start a new topic

Werner_E
24-Ruby V
(To:PaulN)


@PaulN wrote:

I know I marked this topic as solved but can I add a follow-up question (about length, rows and cols) or should I start a new topic


Thats up to you. If you think that your question still fits the topic its OK to add your follow-up question right here.

On the other hand a new thread may draw more attention and attract more people than an already solve topic.

So its your choice.

Hi 

rows from the rows() function with the matrix or vector name inside the brackets

cols from the cols() function with the matrix name inside the brackets

Cheers

Terry

Hi,

rows() and cols() allow you to find how many.

To extract rows and columns there are two possibilities

One is the row and column extractor/inserter functions

Screenshot 11-29-2022 14.27.52.png

Screenshot 11-29-2022 14.28.04.png

The second possibility is the submatrix() function you can look up in help

Cheers

Terry

Top Tags