From: Jos (10584) on 1 Jul 2010 17:15 "Joerg Buchholz" <buchholz(a)hs-bremen.de> wrote in message <i0hee7$q81$1(a)fred.mathworks.com>... > I'm sure a Matlab expert could do that in one line of code ... ;-) It took me a while, but here is a one-liner ... ;-) % data A = [NaN 0 3;7 2 6;5 1 2;NaN NaN 5] % code [B, B(~isnan(A))] = deal(repmat(nanmean(A,1),size(A,1),1), A(~isnan(A))) Jos
|
Pages: 1 Prev: ??? Undefined function or variable "sm_". Next: GUI Table: Indicate what is selected. |