MATLAB: Binary Stream into Matlab

depthdrawnowimshowMATLAB

Good evening,
So far the community has been fantastic in aiding me to learn Matlab so thank you. However a new problem has presented itself, in another program I have saved data to a file using a byte[] array (C#), the file is 100MB large.
The data contained within that file is a depth sensor pixel data stored in a byte[] array and saved to file. I am able to read the file and import the data into a single column and that is as far as I am able to get.
I am looking for assistance in how to visualise the data into possible a imshow()/drawnow method.
Thanks again,
Dan

Best Answer

Why are you reading it into a column when you want a 2D array? You can read directly into a 2D array. Here's a snippet from an m-file of mine:
oneSlice = fread(fileHandle, [x_size y_size], '*uint8');
Ok, then you have a 2D array. Not sure what your difficulty with imshow() is. You can simply do
imshow(oneSlice); % or whatever your matrix is called.
Related Question