from
NANSUBSREF
by Miguel
NANSUBSREF Subscripted reference, ignoring NaNs.
|
| B=nansubsref(A,I)
|
function B=nansubsref(A,I)
%NANSUBSREF Subscripted reference, ignoring NaNs.
% B=NANSUBSREF(A,I) is an array formed from the elements of A specified
% by the subscript vector I. The resulting array is the same size as I.
B=nan(size(I));
InnnanI=find(~isnan(I));
B(InnnanI)=A(I(InnnanI));
|
|
Contact us at files@mathworks.com