From bug-octave-request at bevo dot che dot wisc dot edu Tue Jan 28 16:28:02 2003 Subject: 2.1.43 -- fscanf(fh,"$s","C"); returns matrix data type instead of string From: Bruce Moore To: bug-octave at bevo dot che dot wisc dot edu Date: Tue, 28 Jan 2003 14:27:36 -0800 (PST) Test script --------------------------------------------------- $ cat test.m fh = popen("cat test.dat","r") [i1,i2,i3] = fscanf(fh,"%i %i %i\n","C") tval = i1*i2 [s1,s2,s3] = fscanf(fh,"%s %s %s\n","C") i1 = str2num(s1); i2 = str2num(s2); tval = i1*i2 pclose(fh) Output --------------------------------------------------- octave:1> test fh = { id = 3 name = cat test.dat mode = r arch = native status = open } i1 = [](0x0) i2 = [](0x0) i3 = [](0x0) tval = [](0x0) s1 = [](0x0) s2 = [](0x0) s3 = [](0x0) usage: str2num (s) error: evaluating if command near line 29, column 3 error: called from `str2num' in file `/usr/local/share/octave/2.1.43/m/strings/str2num.m' error: evaluating assignment expression near line 5, column 4 error: near line 5 of file `/home/moor762/smu/dissertation/yield_management/programs/test.m' octave:1> system("cat test.dat") 1 2 3 4 5 6 7 8 9.0e3ans = 0 ===== Bruce Moore __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------