Mercurial > hg > octave-nkf
diff scripts/plot/__patch__.m @ 7711:263bcc319233
Minor fix for multiple patches with NaN values
author | David Bateman <dbateman@free.fr> |
---|---|
date | Tue, 15 Apr 2008 02:29:08 -0400 |
parents | 1c7b3e1fda19 |
children | 73d6b71788c0 |
line wrap: on
line diff
--- a/scripts/plot/__patch__.m +++ b/scripts/plot/__patch__.m @@ -125,10 +125,10 @@ nc = size (faces, 1); idx = faces .'; t1 = isnan (idx); - if (any (t1)) + if (any (t1(:))) t2 = find (t1 != t1([2:end,end],:)); idx (t1) = idx (t2 (cell2mat (cellfun (@(x) x(1)*ones(1,x(2)), - mat2cell ([1 : length(t2); sum(t1)], 2, ones(1,length(t2))), + mat2cell ([1 : nc; sum(t1)], 2, ones(1,nc)), "UniformOutput", false)))); endif x = reshape (vert(:,1)(idx), size (idx));