function povray(povfile,varargin) Width=-1; Height=-1; Inifile=''; Outfile=''; Options =''; ProcessVarargin(varargin); POVpath='c:\program files\pov-ray for windows v3.6'; POVpath='c:\progra~1\pov-ra~1.6'; %DOS version without spaces %s=sprintf('!"%s\\bin\\pvengine.exe" +I%s',POVpath,povfile); s=sprintf('!"%s\\bin\\megapov.exe" +I%s',POVpath,povfile); if Width>0 s=sprintf('%s +W%d',s,Width); end if Height>0 s=sprintf('%s +H%d',s,Height); end if ~isempty(Outfile) s=sprintf('%s +o%s',s,Outfile); end if ~isempty(Options) s=sprintf('%s %s',s,Options); end s=sprintf('%s +L%s',s,fullfile(POVpath,'include')); if ~isempty(Inifile) s=sprintf('%s %s',s,fullfile(POVpath,'renderer',Inifile)); end eval(s);