# HG changeset patch # User David Bateman # Date 1208240948 14400 # Node ID 263bcc319233d269d851fc48a39243dc832d7419 # Parent 9a6012d7cbb7c882a9bc77989f06a8b4ca57274b Minor fix for multiple patches with NaN values diff --git a/scripts/ChangeLog b/scripts/ChangeLog --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,7 @@ +2008-04-015 David Bateman + + * plot/__patch__.m: Fix for NaN values in faces of patches. + 2008-04-14 David Bateman * plot/rose.m: Add missing comment mark that causes issues with diff --git a/scripts/plot/__patch__.m b/scripts/plot/__patch__.m --- 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));