title: Splitting an image into two parts (background / foreground) with logical indexing in Matlab
body: <p>I have a problem I don't know how to resolve in Matlab.
  Basically. I have an image array hw x 3 and a seperate binary array that defines the background foreground. What I want to do, is split the image into two parts - corresponding to the mask.</p>
  
  <p>Thanks in advance for the help!</p>