Like fileparts, but separates off a comma separated list at the end FORMAT [pth,nam,ext,num] = spm_fileparts(fname) fname - original filename pth - path nam - filename ext - extension num - comma separated list of values _______________________________________________________________________ Copyright (C) 2005 Wellcome Department of Imaging Neuroscience
0001 function [pth,nam,ext,num] = spm_fileparts(fname) 0002 % Like fileparts, but separates off a comma separated list at the end 0003 % FORMAT [pth,nam,ext,num] = spm_fileparts(fname) 0004 % fname - original filename 0005 % pth - path 0006 % nam - filename 0007 % ext - extension 0008 % num - comma separated list of values 0009 % 0010 %_______________________________________________________________________ 0011 % Copyright (C) 2005 Wellcome Department of Imaging Neuroscience 0012 0013 % John Ashburner 0014 % $Id: spm_fileparts.m 112 2005-05-04 18:20:52Z john $ 0015 0016 0017 num = ''; 0018 [pth,nam,ext] = fileparts(fname); 0019 ind = find(ext==','); 0020 if ~isempty(ind), 0021 num = ext(ind(1):end); 0022 ext = ext(1:(ind(1)-1)); 0023 end; 0024