MATLAB: Does the SHRINKFACES command does not work on some patch objects and give warnings in MATLAB 7.6 (R2008a)

MATLAB

I created a patch object and then used SHRINKFACES command on it as shown below:
[x,y,z,v] = flow;
[x,y,z,v] = reducevolume(x,y,z,v,2);
fv = isosurface(x,y,z,v,-3);
% Create a patch
p=trisurf(fv.faces,fv.vertices(:,1),fv.vertices(:,2),fv.vertices(:,3))
% use SHRINKFACES on the patch
shrinkfaces(p,0.6) ;
This results in the following warnings and blank figure window.
Warning: Patch FaceVertexCData length (808) must equal 1, Vertices length (4620), or Faces length
(1540) for flat FaceColor

Best Answer

The ability to process patch handles is not available in the SHRINKFACES function available in MATLAB 7.6 (R2008a).
To work around this issue, execute the following steps:
1. Download the attached file MYSHRINKFACES.m and save it to a location in MATLAB path.
2. Use MYSHRINKFACES command instead of SHRINKFACES command.