Getting back input from unix(command)



Ok, I'm using [a,b] = unix(comand) and I expect it to return a couple
hundred lines. I would like the data in a format that puts every
line either in its own cell row or its own row in an array. I had it
working by taking the variable b, saving it to a file with fwrite()
and then loading it in with importdata(), but I have run into a
problem where its possible for the variable b to contain characters
that make MATLAB think that its done reading the file when infact it
has only read 2 of 300 lines. I cant suppress the characters so I'm
looking for the fastest way to take the output from the unix()
command and turn it into a cell array with each line in its own row.

right now I'm still saving it to file with fwrite() and then I'm
reading it back with a while loop (terminated by feof() ) and fgetl,
but its a lot slower then I would like it to be.

Does anyone have any ideas?
.



Relevant Pages

  • Re: Getting back input from unix(command)
    ... line either in its own cell row or its own row in an array. ... that make MATLAB think that its done reading the file when infact it ... I cant suppress the characters so I'm ... right now I'm still saving it to file with fwrite() and then I'm ...
    (comp.soft-sys.matlab)
  • Saving text data to file
    ... What is the best method of saving text data to file, ... there is a problem when reading back that data using ... I can replace CR & LF characters with different character when ... However it is CPU time consuming procedure and it extends drammatically data ...
    (microsoft.public.vb.general.discussion)
  • Re: Little C Help Please
    ... characters to read, so it hapily goes on reading even when the buffer ... represent the size of the buffer, and stops reading before that number ... I think the OP's problem was not a space in the input, but a newline ... Dig the even newer still, yet more improved, sig! ...
    (comp.os.linux.development.apps)
  • Re: Little C Help Please
    ... characters to read, so it hapily goes on reading even when the buffer ... represent the size of the buffer, and stops reading before that number ... I think the OP's problem was not a space in the input, but a newline ... Dig the even newer still, yet more improved, sig! ...
    (comp.unix.programmer)
  • Re: Whats the weirdest human language?
    ... you learn to match up combinations of two or more characters to recognize a word so that you can then pronounce it. ... He gets the meaning from context and doesn't give a fig what the pronunciation is. ... it becomes a logic puzzle that bears very little resemblance to reading. ... Japanese and Chinese people have both told me that they do this constantly while reading, and they can't understand why Westerners have such a problem reading words that they can't say. ...
    (talk.origins)