Code covered by the BSD License  

Highlights from
Read spectrum analyzer trace file

from Read spectrum analyzer trace file by Stepan Matejka
Reads a spectrum analyzer ASCII trace file into Matlab variables for further processing.

example01.m
% Example01 - read and plot Agilent SA trace

% read trace
[s, f, l] = readsatf('ag00.trc', 'FileType', 'ag');
 
% plot it
MAXF = max(f);
MINF = min(f);
plot(f,l,'Color','blue','LineWidth',1)
axis([MINF MAXF s.YStart (s.YStart + s.YScale)])
set(gca,'XTick',MINF:(MAXF - MINF)/10:MAXF)
xlabel(['Frequency [' s.XUnit ']'])
ylabel(['Power Level [' s.YUnit ']'])
title('Power Spectrum')
grid on

Contact us at files@mathworks.com