Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

** Community Tip** - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more!
X

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Feb 05, 2024
06:20 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Feb 05, 2024
06:20 PM

Adding a scalar to every other Column in a Matrix

Using: MathCAD Prime 9.0

Hello,

I am trying to add a scalar value to every other column in a large matrix (each element in an even column). I included a screenshot below of a small scale example of the input matrix M, scalar value to add, and the desired output. I thought this might be able to be accomplished using a for loop of some kind looping through the elements and only adding the scalar to the even columns, but I wasn't able to figure out how to do this.

The real application is I have a large matrix of time and current values with every other column being the time columns, and want to add a scalar value to shift the time values.

Any help would be greatly appreciated!

Solved! Go to Solution.

Labels:

- Tags:
- matrix operations

ACCEPTED SOLUTION

Accepted Solutions

Feb 05, 2024
10:24 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Feb 05, 2024
10:24 PM

I would suggest using a small user-written utility function (which also should be ORIGIN-aware for maximal portability):

Prime 9 sheet attached

2 REPLIES 2

Feb 05, 2024
06:45 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Feb 05, 2024
10:24 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Feb 05, 2024
10:24 PM

I would suggest using a small user-written utility function (which also should be ORIGIN-aware for maximal portability):

Prime 9 sheet attached