[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: : new to octave, confused about load(), dlmread et cetera
From: |
justin.cress |
Subject: |
Re: : new to octave, confused about load(), dlmread et cetera |
Date: |
Wed, 1 Sep 2010 09:32:11 -0700 (PDT) |
forkandwait wrote:
>
>
> Matlab's dlmread puts zero into every empty or unparseable field, so one
> has to
> compensate for it. (Yes, this is UTTERLY LAME behavior, they should be
> NaN, but
> for compatibility we follow it. str2double() might be useful in a loop
> that
> reads lines, as it allows for subbing NaNs for empties.)
>
>
Cool, but, what if the data includes entries that are legitimately zero...
(female = 1 if female, 0 if male)
forkandwait wrote:
>
> (not the original poster, but an interested party in octave data handling,
> which
> leaves a lot to be desired at the moment)
>
>> Great code, why do you grab the first two lines? in case headers spill
>> over?
>
> dlmread snarfs everything unless you tell it where to start (the code
> below code
> have used a parameter to tell it to start reading at the second line.
>
Understood, but, why not just grab line one? That's where the variable
names should be. The OP's code fget's the first two lines and puts them in
arrays, i was just curious why.
--
View this message in context:
http://octave.1599824.n4.nabble.com/new-to-octave-confused-about-load-dlmread-et-cetera-tp2402617p2403535.html
Sent from the Octave - General mailing list archive at Nabble.com.
- : new to octave, confused about load(), dlmread et cetera, Roman.Griego, 2010/09/01
- Re: : new to octave, confused about load(), dlmread et cetera, Justin Cress, 2010/09/01
- Re: : new to octave, confused about load(), dlmread et cetera, fork, 2010/09/01
- Re: : new to octave, confused about load(), dlmread et cetera, Jaroslav Hajek, 2010/09/01
- Re: : new to octave, confused about load(), dlmread et cetera, justin.cress, 2010/09/01