help-octave
[Top][All Lists]
Advanced

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

Re: textread error / question


From: Rick T
Subject: Re: textread error / question
Date: Fri, 2 Dec 2011 14:23:47 -1000

It looks like the old IO package available for download never included the textread.m option and the new textread.m is only compatible with octave 3.4 or greater. http://octave.sourceforge.net/io/index.html which sucks, any body have any work arounds to read text data from a file into arrays? 

On Fri, Dec 2, 2011 at 12:51 PM, Ben Abbott <address@hidden> wrote:
On Dec 2, 2011, at 5:10 PM, Rick T wrote:

> On Fri, Dec 2, 2011 at 10:36 AM, Ben Abbott <address@hidden> wrote:
> On Dec 2, 2011, at 2:35 PM, Rick T wrote:
>
> > Greetings All
> >
> > I'm trying to read in a text file with comma delimited data see text of what's in data.txt below but I keep getting an error
> > feval: function `print_usage' not found
> >
> > text1,eq1=a+b*c
> > text2,eq2=b+c*d
> > text3,eq3=c+a*a
> >
> > This the command I use
> > [names,equation]=textread('data.txt', '%s%s', 'delimiter', ',')
> >
> > I have the io package installed and I'm using ubuntu 10.04 with octave 3.2.4
> >
> > Thanks
>
> With Octave 3.4.x, I tried ran the attached "rick.m" and obtained ...
>
> rick
> names =
> {
>  [1,1] = text1
>  [2,1] = text2
>  [3,1] = text3
> }
> equation =
> {
>  [1,1] = eq1=a+b*c
>  [2,1] = eq2=b+c*d
>  [3,1] = eq3=c+a*a
> }
>
> Since you are seeing "feval: function `print_usage' not found", it appears that there are two problems.
>
> First, textread() or something it calls is throwing an error via print_usage(). I don't think textread.m was part of Octave's core functions when Octave-3.2.4 was released.
>
> What do you get when you type "which textread" ?
> >>> which textread
> `textread' is a function from the file /usr/lib/octave/packages/3.2/io-1.0.9/x8
> 6_64-pc-linux-gnu-api-v37/textread.oct

Ok. the bug is with the octave forge version. Some time since 3.2.4 the textread.m was added to Octave's core. You might try to transplant the m-files from the developers sources.

       http://hg.savannah.gnu.org/hgweb/octave/file/09432c6f23e7/scripts/io

> Do you know where you got this function? Perhaps it is not compatible with 3.2.4 ?
>
> ubuntu software center standard software
>
>
> Secondly, it appears that print_usage() is not in your path.
>
> What do you get when you type "path" ?
>
>
> >>> path
> Octave's search path contains the following directories:
> .
> /usr/local/share/qtoctave/scripts_octave/
> /usr/local/share/octave/site-m
> /usr/share/octave/packages/3.2/time-1.0.9
> /usr/lib/octave/packages/3.2/signal-1.0.10/x86_64-pc-linux-gnu-api-v37
> /usr/share/octave/packages/3.2/signal-1.0.10
> /usr/lib/octave/packages/3.2/specfun-1.0.8/x86_64-pc-linux-gnu-api-v37
> /usr/share/octave/packages/3.2/specfun-1.0.8
> /usr/lib/octave/packages/3.2/optim-1.0.6/x86_64-pc-linux-gnu-api-v37
> /usr/share/octave/packages/3.2/optim-1.0.6
> /usr/lib/octave/packages/3.2/multicore-0.2.15/x86_64-pc-linux-gnu-api-v37
> /usr/share/octave/packages/3.2/multicore-0.2.15
> /usr/lib/octave/packages/3.2/miscellaneous-1.0.9/x86_64-pc-linux-gnu-api-v37
> /usr/share/octave/packages/3.2/miscellaneous-1.0.9
> /usr/lib/octave/packages/3.2/jaudio-0.2.0/x86_64-pc-linux-gnu-api-v37
> /usr/share/octave/packages/3.2/jaudio-0.2.0
> /usr/lib/octave/packages/3.2/io-1.0.9/x86_64-pc-linux-gnu-api-v37
> /usr/share/octave/packages/3.2/io-1.0.9
> /usr/lib/octave/packages/3.2/audio-1.1.4/x86_64-pc-linux-gnu-api-v37
> /usr/share/octave/packages/3.2/audio-1.1.4
> /usr/lib/octave/packages/3.2/aaudio-0.2.1/x86_64-pc-linux-gnu-api-v37
> /usr/share/octave/packages/3.2/aaudio-0.2.1
> /usr/lib/octave/3.2.4/oct/x86_64-pc-linux-gnu
> /usr/share/octave/3.2.4/m
> /usr/share/octave/3.2.4/m/miscellaneous
> /usr/share/octave/3.2.4/m/special-matrix
> /usr/share/octave/3.2.4/m/sparse
> /usr/share/octave/3.2.4/m/geometry
> /usr/share/octave/3.2.4/m/polynomial
> /usr/share/octave/3.2.4/m/audio
> /usr/share/octave/3.2.4/m/startup
> /usr/share/octave/3.2.4/m/image
> /usr/share/octave/3.2.4/m/pkg
> /usr/share/octave/3.2.4/m/testfun
> /usr/share/octave/3.2.4/m/optimization
> /usr/share/octave/3.2.4/m/strings
> /usr/share/octave/3.2.4/m/path
> /usr/share/octave/3.2.4/m/general
> /usr/share/octave/3.2.4/m/statistics
> /usr/share/octave/3.2.4/m/statistics/distributions
> /usr/share/octave/3.2.4/m/statistics/tests
> /usr/share/octave/3.2.4/m/statistics/models
> /usr/share/octave/3.2.4/m/statistics/base
> /usr/share/octave/3.2.4/m/help
> /usr/share/octave/3.2.4/m/deprecated
> /usr/share/octave/3.2.4/m/set
> /usr/share/octave/3.2.4/m/time
> /usr/share/octave/3.2.4/m/specfun
> /usr/share/octave/3.2.4/m/plot
> /usr/share/octave/3.2.4/m/elfun
> /usr/share/octave/3.2.4/m/signal
> /usr/share/octave/3.2.4/m/linear-algebra
> /usr/share/octave/3.2.4/m/io
> >>>
>
>
>
> And just to be sure, what do you get when you type "which print_usage" ?
>
> >>> which print_usage
> `print_usage' is a function from the file /usr/share/octave/3.2.4/m/help/print_
> usage.m
> >>>
>

Since Octave sees "print_usage" in the path, I'm surprised it gave you the error

       > feval: function `print_usage' not found

If you decide you want to track this error down, please cut-n-paste the entire error.

Ben






--


reply via email to

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