From: Tom H. <to...@ku...> - 2005-05-15 21:24:56
|
fread with 'char' returns a column array; eventually this got passed to strtok. In strtok, there's a skip = find(idx != 1:length(idx)) which failed because 1) there were multiple instances of the delimiter, and 2) idx is a column and the : is a row. For example, in matlab: >> s = 'abca'; >> strtok(s, 'a') ans = bc >> strtok(s', 'a') ans = b c In octave: octave:1> s = 'abca'; octave:2> strtok(s, 'a') ans = bc octave:3> strtok(s', 'a') error: mx_el_ne: nonconformant arguments (op1 is 2x1, op2 is 1x2) One way to fix this is: --- #strtok.m 2005-05-15 16:18:02.000000000 -0400 +++ strtok.m 2005-05-15 16:47:53.000000000 -0400 @@ -57,6 +57,7 @@ tok = str; rem = ""; else + idx = reshape(idx, [1 length(idx)]); skip = find(idx != 1:length(idx)); # find first non-leading delimiter if isempty(skip) tok = str(idx(length(idx))+1:length(str)); -- Dr. Tom Holroyd "A man of genius makes no mistakes. His errors are volitional and are the portals of discovery." -- James Joyce |