The MATLAB MeasDemo.m script connects to the VSA, configures measurement parameters, and performs a single measurement sweep. Then the script reads frequency and voltage data and plots the data. Afterwards, the script quits the VSA if the VSA was started by the script.
Normally all these steps would not be combined into a single routine. In particular, the starting the 89600 VSA would normally be done only once by a user's application and a reference would be stored until the user's application exited.
The MeasDemo.m script can be run from the following directory:
%PROGRAMFILES%\Keysight\89600 Software 20xx\89600 VSA Software\Examples\DotNET\Matlab
where 20xx is the version number of the 89600 VSA.