Re: Getting back input from unix(command)
- From: Doug Schwarz <see@xxxxxxxxxxxxxxxxxxx>
- Date: Fri, 30 Jun 2006 19:07:00 GMT
In article <ef3acc1.-1@xxxxxxxxxxxxxxxxxxxxxxx>,
"Tanner Suttles" <foodjester@xxxxxxxxxxx> wrote:
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?
[a,b] = unix(command);
c = strread(b,'%s','whitespace','\r\n');
--
Doug Schwarz
dmschwarz&ieee,org
Make obvious changes to get real email address.
.
- References:
- Getting back input from unix(command)
- From: Tanner Suttles
- Getting back input from unix(command)
- Prev by Date: Re: Getting back input from unix(command)
- Next by Date: Real-Time Workshop --> C Code Bug
- Previous by thread: Re: Getting back input from unix(command)
- Next by thread: Re: figure windows not in focus
- Index(es):