Mercurial > hg > octave-nkf
changeset 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 | 9a6012d7cbb7 |
children | a626db2e8a1c |
files | scripts/ChangeLog scripts/plot/__patch__.m |
diffstat | 2 files changed, 6 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,7 @@ +2008-04-015 David Bateman <dbateman@free.fr> + + * plot/__patch__.m: Fix for NaN values in faces of patches. + 2008-04-14 David Bateman <dbateman@free.fr> * plot/rose.m: Add missing comment mark that causes issues with
--- 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));