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

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

Dividing a vector by a constant and assigning it to a new variable issue

Jee-Bee_CS
11-Garnet

Dividing a vector by a constant and assigning it to a new variable issue


@Werner_E wrote:

3) Use a small program to create vectors of your choice - you can chose to use the same argument order as in the definition of a range.

Similar routines also were posted here from time to time and a command like this should be part of Mathcad/Prime out of the box. Unfortunately it isn't.


I see that the topic is from 2016 and it is now 2024 but i had basically the same issue. Have i to conclude that it is still not fixed to create easy a vector in some range?

 

-----

Initially posted in this topic

1 ACCEPTED SOLUTION

Accepted Solutions
LucMeekes
23-Emerald III
(To:Jee-Bee_CS)

It's very easy to create a vector in some range. Some examples:

Digits := matrix(10, 1, max)

produces a vector with all digits 0 through 9

Tens := (matrix(10, 1, max) + 1) * 10

produces a vector with the numbers 10, 20, 30...100

 

Success!
Luc

 

View solution in original post

3 REPLIES 3


@Jee-Bee_CS wrote:

@Werner_E wrote:

3) Use a small program to create vectors of your choice - you can chose to use the same argument order as in the definition of a range.

Similar routines also were posted here from time to time and a command like this should be part of Mathcad/Prime out of the box. Unfortunately it isn't.


I see that the topic is from 2016 and it is now 2024 but i had basically the same issue. Have i to conclude that it is still not fixed to create easy a vector in some range?


I am not sure if there is anything to be 'fixed' concerning the creation of a vector.

I made a few suggestions, the easiest seems to be the undocumented trick to turn a vector into a range.

A small user-written program to create vectors might be useful so you can fit it to your needs - e.g. it could take the first, the last value and the stepwidth instead of the second value. Or first and last value and the number of elements you need.
Guess there can't be a built-in function for every need we could think of...

LucMeekes
23-Emerald III
(To:Jee-Bee_CS)

It's very easy to create a vector in some range. Some examples:

Digits := matrix(10, 1, max)

produces a vector with all digits 0 through 9

Tens := (matrix(10, 1, max) + 1) * 10

produces a vector with the numbers 10, 20, 30...100

 

Success!
Luc

 

Nice idea!

Could be turned into a utility function where you provide start value, step width and number of elements:

Werner_E_0-1708552440870.png

 

Top Tags