Skip to main content
1-Visitor
Jan 25, 2023 5:04 PM UTC
Solved

Changing Matrix Elements Automatically

I have a large matrix representing an image, 4000 columns, 2000 rows. I would like to change the values of some of the matrix elements and these elements are defined in a pair of vectors. Trying to automate the process because of the extreme size and complexity. I have attached a small example of what I am doing (and doing wrong) in which I have set up a FOR loop. This loop changes all of the elements, not just the ones I want. Help? See attached example.

 

 

terryhendicott
21-Topaz II
Jan 25, 2023 5:31 PM UTC

Capture.JPG

3 replies

terryhendicott
21-Topaz II
Jan 25, 2023 5:31 PM UTC
1-Visitor
Jan 25, 2023 5:40 PM UTC

Thank you! Very cool. Learned a lot, lots to learn.

 

Translate
23-Emerald V
Jan 25, 2023 9:51 PM UTC

For this purpose the built-in, but undocumented, function update2() comes in handy:

LucMeekes_0-1674683446980.png

Success!
Luc

 

Translate