www.gusucode.com > fixedpoint 案例源码程序 matlab代码 > fixedpoint/SquareArrayofZerosWithFixedPointAttributesExample.m

    %% Square Array of Zeros With Fixed-Point Attributes  
% Create a 4-by-4 array of zeros with specified numerictype and |fimath|
% properties.   

%% 
% Create a signed |fi| object with word length of |24| and fraction length
% of |12|. 
p = fi([],1,24,12);  

%% 
% Create a 4-by-4 array of zeros that has the same numerictype properties
% as |p|. 
X = zeros(4, 'like', p)