help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: dlmread problem


From: John W. Eaton
Subject: Re: dlmread problem
Date: Tue, 30 Nov 2010 15:08:57 -0500

On 30-Nov-2010, Keith Grider wrote:

| I am just defining the matrix name when I run the command.
| 
| It does the same thing if I type:
| octave:39> dlmread("test.txt"," ",1,0)
| ans =
| 
|    -0.00900 +  0.00000i
|    -0.02800 +  0.00000i
|    -0.01600 +  0.00000i
|    -0.00300 +  0.00000i
|    -0.02200 +  0.00000i
|    -0.01600 +  0.00000i
|    -0.00300 +  0.00000i
|     0.00300 +  0.00000i
|    -0.00900 +  0.00000i
|    -0.00300 +  0.00000i
|    -0.00900 +  0.00000i
|    -0.01600 +  0.00000i
| 
| The file is called test.txt and is this:
| 1000.0
| -0.009 0.000
| -0.028 0.000
| -0.016 0.000
| -0.003 0.000
| -0.022 0.000
| -0.016 0.000
| -0.003 0.000
| 0.003 0.000
| -0.009 0.000
| -0.003 0.000
| -0.009 0.000
| -0.016 0.000

I can't duplicate the results you see with 3.3.54 or the current
development sources.  I see

  x = dlmread ("test.txt", " ", 1, 0)x =

    -0.009000   0.000000
    -0.028000   0.000000
    -0.016000   0.000000
    -0.003000   0.000000
    -0.022000   0.000000
    -0.016000   0.000000
    -0.003000   0.000000
     0.003000   0.000000
    -0.009000   0.000000
    -0.003000   0.000000
    -0.009000   0.000000
    -0.016000   0.000000

  octave:2> size (x)
  ans =

     12    2

  octave:3> iscomplex (x)
  ans = 0

The only explanation I can think of is that your file contains some
characters that are not showing up when you pasted it in to your
mail message.  What are the end of line characters for your file?
Unix style line feed only?  MSDOS carriage return + line feed?  MacOS
carriage return only?  Though even when I experiment with those
possibilities, I am unable to duplicate your results.  Instead of
having us guess, maybe you should attach the file instead of pasting
it into your mail message, so we see precisely the binary bits you
have in your file.

jwe



reply via email to

[Prev in Thread] Current Thread [Next in Thread]