textread, better late than never ....

From 10/12/00:

>Hey guys, I am using psychtoolbox on a mac and like it much, but i
>want to parse through a control file that has both numbers and text
>on each line. Matlab is ornery about this, but there is a lovely
>function on Win version called TEXTREAD that does this fine. I don't
>know why it doesn't appear for the mac version. But in any case, I
>have attached the files.
>
>TEXTREAD is implemented as a mex file and for the life of me, I
>can't get my matlab (5.2.1) to compile mex files with either CW Pro
>2 or CW pro 3. I would be happy if you guys could just make a mex
>file from the attached and send, but I would also be interested in
>figuring out what is needed to get mex files to compile at all.
>
>I get different errors in CWP2 and CWP3, but both seem related to
>header files and such that matlab includes...

Attached is an archive with a working CW Pro 5 project and Mac MEX
file for the function textread. Since I've never used textread
I didn't actually test the MEX file. But probably it will work.
If not, you can use the enclosed to modify the source and try
to fix it. (Note, I did not include the source nor the .m help
file in the archive, since they belong to the Mathworks. But
all you need to do is get them from the Windows version and
put them in the same folder as the CW Pro project.)

Note that to make this project compile, you will need to have
set up your compiler as instructed in the PsychToolbox source
archive. See "Install the source.txt". Get the archive at
http://psychtoolbox.org/download.html#source


Best,

DB
For those without access to a windows version of Matlab, information
on how to use the textread function can be found at:
http://www.mathworks.com/access/helpdesk/help/techdoc/ref/textread.shtml

Gr.
Frans



>(Note, I did not include the source nor the .m help
>file in the archive, since they belong to the Mathworks. But
>all you need to do is get them from the Windows version and
>put them in the same folder as the CW Pro project.)
>
--
Frans W. Cornelissen
Laboratory of Experimental Ophthalmology
Graduate School for Behavioral and Cognitive Neurosciences (BCN)
University of Groningen
P.O. Box 30.001
Hanzeplein 1
9700 RB Groningen, The Netherlands

e-mail: f.w.cornelissen@...
Telephone: + 31 50 3614173/2510
Telefax: + 31 50 3611709
Private: + 31 50 5264050
Web-page: http://www.med.rug.nl/leo/