According to my hands-on experience, If you have an agilent digital oscilloscope you can easily acquire the data and then save it as excel file or simple data file which matlab can easily read and handle. similarly or more easily if you have an agilent logic analyzer that enables you to directly get the data into Matlab.
However, if it is mandatory to read the real time data from the generator directly to matlab, you need "Instrument Control Toolbox" http://www.mathworks.com/products/instrument/
You can request free 30-day trial. This toolbox enables you connect MATLAB® directly to instruments such as oscilloscopes, function generators, signal analyzers, power supplies, and analytical instruments. The toolbox connects to your instruments via instrument drivers such as IVI and VXIplug&play, or via text-based SCPI commands over commonly used communication protocols such as GPIB, VISA, TCP/IP, and UDP. You can also control and acquire data from your test equipment without writing code.