[471bfe]: @mp / private / getPrecs.m Maximize Restore History

Download this file

getPrecs.m    19 lines (15 with data), 513 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
function precision = getPrecs(x, index)
%# function precision = getPrecs(x, index)
%# If called with two input values, return the precision of the
%# (one-dimensional) array at given index. If called with only one
%# input value, return an array the same size as x, with the
%# individual precisions.
if (2 == nargin)
precision = x(index).precision;
else
precision = zeros (size (x), 'int32');
for ii = (1:numel (x))
precision(ii) = x(ii).precision;
end
end
end