Skip to main content
1-Visitor
January 25, 2023
Solved

Changing Matrix Elements Automatically

  • January 25, 2023
  • 2 replies
  • 1228 views

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.

 

 

Best answer by terryhendicott

Capture.JPG

2 replies

21-Topaz II
January 25, 2023
1-Visitor
January 25, 2023

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

 

23-Emerald IV
January 25, 2023

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

LucMeekes_0-1674683446980.png

Success!
Luc