% VSWRs for radio hams
% Assumes the sweep has been set and the nanoVNA is calibrated
% possibly usung ajfCalibrate

% Andrew Fletcher 2020

% Configuration Section  -------------------------------------------------

% the serial port that the nanoVNA is connected to
nanoVNAport = '/dev/tty.usbmodem4001';

% End  of Configuration
% Do not edit below here -------------------------------------------------

hCom = nanoOpen(nanoVNAport);

netwk = nanoGetData(hCom);

fig = figure('Name', 'VSWRs', 'NumberTitle','off');
plot(netwk.Frequencies, vswr(rfparam(netwk,1,1)))
xlabel('Frequency (MHz)')
ylabel('VSWR')
ax = gca;
ax.XRuler.Exponent = 6;

nanoClose(hCom);
