Arduino shooting data to Matlab

I am trying to read the data received from the USB through Matlab so I can graph it but unfortunately, I am new to this stuff and I have been too much time trying to understand how to do it but so far
I found:
s=serial("COM5");
fopen(S)
I read the data
fclose(s)
but I can't really interface that wel. At one point, Matlab
tells there is no port open eventhough it was reading it just a sec ago.
There is gotta be geniuses out there that know what I am talking about. I would love if anybody has a sample example of code that interfaces Matlab with Arduino.
All help is appreciated. Thank you for your time