title: How can I overwrite specific values in an matrix? MATLAB
body: <p>For a university assignment I have to take an image of size 512x512 and then apply an effect to particular blocks of the image, as displayed in the image below.</p>
  
  <p><a href="https://i.stack.imgur.com/omDnk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/omDnk.png" alt="enter image description here"></a></p>
  
  <p>I have managed to achieve this by accessing particular regions of the image using indexing, like this:</p>
  
  <p><code>w1_region = [DCTImage(1:imageSizeQuarter, imageSizeQuarter+1:imageSizeHalf)];</code></p>
  
  <p>This is repeated for w2 and w3. These regions are all of size 128x128 and need to be written back into the original image. </p>
  
  <p>However now what I need to do is overwrite the blocks of the original image with the edited blocks, so that I have a full image with 3 blocks <code>w1</code>, <code>w2</code>, <code>w3</code> that have been modified.</p>
  
  <p>How can I go about overwriting the matrix that defines the original image with the modified blocks? Is there a way that I can effectively say "Overwrite the values held in the matrix starting at X"?</p>
  
  <p>I feel like there is some kind of matrix operation that would allow me to do this but I'm not entirely sure which. </p>