Showing Images from Arduino with MATLAB (or other code)

Hi,

I have an Arduino UNO (but once I get this working, I am switching to a much more complicated system) with an Arducam OV5642 camera shield attached. I have it taking a 640x480 photo every ~10 seconds and I want a way to show the images in real time on my computer (the photo taking rate can be slowed down if necessary). The relevant section of my arduino code is below (sorry about formatting, this is my first time posting code):

void loop() {
uint8_t temp = 0xff, temp_last = 0;
uint8_t start_capture = 0;
temp = Serial.read();
start_capture = 1;  
Serial.println(F("ACK CMD CAM start single shot."));
myCAM.clear_bit(ARDUCHIP_GPIO,GPIO_PWDN_MASK);
delay(800);
Serial.println("Start_capture=1");
if(start_capture == 1)
{
Serial.println("capture 'if' statement");
myCAM.flush_fifo();
Serial.println("capture 'if' statement 2");
myCAM.clear_fifo_flag();	 
Serial.println("capture 'if' statement 3");
//Start capture
myCAM.start_capture();
Serial.println("capture has been started");
delay(10000);
}
if(myCAM.get_bit(ARDUCHIP_TRIG, CAP_DONE_MASK))
{
myCAM.set_bit(ARDUCHIP_GPIO,GPIO_PWDN_MASK);
temp = 0;
Serial.println(F("ACK IMG"));
while( (temp != 0xD9) | (temp_last != 0xFF) )
//D9 is in hex=217 in decimal. FF=255
//according to the ArduCam Support, the head of the image data is 0xFF 9xD8
//and the end of the data is 0xFF 0xD9
{
  temp_last = temp;
  temp = myCAM.read_fifo();
  Serial.write(temp);
  delayMicroseconds(10);
}
Serial.println(F("ACK CMD CAM Capture Done."));
//Clear the capture done flag 
myCAM.clear_fifo_flag(); 
start_capture = 0;
}
}

The serial.println statements are just checks I was using to figure out where it went wrong. As you can see in the code, the head of the image data is 0xFF 9xD8 and the end of the data is 0xFF 0xD9. This information was given to me by the ArduCam Support team on their GitHub forum. How do I receive the stream data in MATLAB (or if necessary a different way) and display it as an image? Thanks!

(deleted)

I didn't know if there was something special about interfacing with Arduino. I've never had to do something like this and thought maybe I had to have something special through the Arduino physically or in the code