if you do the following to get your file names
spm_get('files','./','*.img')
then do
for ip = 1:size(P,1)
[fp fn] = fileparts(P(ip,:));
end
the variable fp will be the path, fn will be the name.
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Robert C. Welsh, PhD
Research Investigator
Department of Radiology
University of Michigan
(734) - 764 - 2412 (fax)
[log in to unmask]
>>> Sterling Johnson <[log in to unmask]> 10/2/2005 3:50 AM >>>
Dear SPMers
I'd like to use spm_get to select file names into a string matrix. It
provides the absolute path to the filename; I need the filename
itself--without the path. is there an easy way to do this?
thanks
Sterling
Sterling C. Johnson, Ph.D.
Assistant Professor of Medicine
University of Wisconsin Medical School
Madison VA Hospital
GRECC
2500 Overlook Terrace (11G),
Madison WI 53705
phone 608-256-1901 x 11946
fax 608-280-7165
email: [log in to unmask]
**********************************************************
Electronic Mail is not secure, may not be read every day, and should not be used for urgent or sensitive issues.
|