Re: matlab fscanf
- From: csordaspepe@xxxxxxxxx
- Date: Tue, 2 Dec 2008 11:31:32 -0800 (PST)
On dec. 2, 20:20, dpb <n...@xxxxxxx> wrote:
csordasp...@xxxxxxxxx wrote:
On dec. 2, 20:09, "David" <d...@xxxxxxxxxxxxxx> wrote:...
csordasp...@xxxxxxxxx wrote in message <ac70556a-6b60-4f0a-804f-10ed13f69...@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>...
...I have a .txt file with rows like:
4980361404 SMP 1 569.41 372.51
I have need the 1.,4.,5. colums(4980361404, 569.41, 372.51).
'nothing' happened? what does your code look like?
I tried:
1,a=fscanf(fid,['%d %s %d %d %d']);
2,a=fscanf(fid,['%d' 'SMP' '1' '%d %d']);
I hope (and will assume) the "1," and "2," are spurious trying to show
different attempts. I'd suggest not murky-ing [sic] up the water that
way in the future -- it would be best to report only the exact
characters typed. Otherwise, it's possible the intent to clarify will
simply obfuscate. Here it's possible to figure what was probably
intended relatively easily; in other instances perhaps "not so much".
That said, I responded earlier.
I'd start w/ the
doc fscanf
as a recommendation to read the doc's more carefully; specifically the
"*" skip modifier and look at the type of data and the corresponding
format string more carefully (yes, I'm a Fortran, not C kinda' guy,
sorry :) ).
Anyway, try
a = fscanf(fid,'%f, %*s %*d %f %f');
I'll let you use the previous suggestion to check on the why's...
--
Thanks!
I read the doc:D
a = fscanf(fid,'%f, %*s %*d %f %f');
unfortunately this not good.I got just the first column.
.
- Follow-Ups:
- Re: matlab fscanf
- From: Walter Roberson
- Re: matlab fscanf
- References:
- matlab fscanf
- From: csordaspepe
- Re: matlab fscanf
- From: David
- Re: matlab fscanf
- From: csordaspepe
- Re: matlab fscanf
- From: dpb
- matlab fscanf
- Prev by Date: Saving double data as 16 bit tiff fle
- Next by Date: Re: Alternative to repmat
- Previous by thread: Re: matlab fscanf
- Next by thread: Re: matlab fscanf
- Index(es):
Relevant Pages
|
Loading