www.gusucode.com > dsp 案例源码程序 matlab代码 > dsp/DisplayFixedPointSignalsExample.m

    %% Display Fixed-Point Signals  

%% 
% Construct a |dsp.LogicAnalyzer| object. Run the |addWave| method to add
% both floating-point and fixed-point wave channels. Run the |step| method
% to display the signals. 
hla2 = dsp.LogicAnalyzer('NumInputPorts', 2); % 2 inputs
hla2.TimeSpan = 12;
addWave(hla2,'InputChannel',1,'Name','Index');
addWave(hla2,'InputChannel',2,'Name','Fi_hex','Radix','Hexadecimal');
addWave(hla2,'InputChannel',2,'Name','Fi_bin','Radix','Binary');
for ii = 1:20
    fival = fi(mod(ii-1, 16), 0, 4, 0);
    step(hla2, ii, fival);
end