DSPRelated.com
Forums

Questions regarding Octave

Started by Eric Jacobsen March 23, 2008
Okay, so I need to make some plots that neither MathCAD nor excel can
do easily, so I bit the bullet and installed Octave.   After wrestling
with it for a couple of days I have to say I am, so far, extremely
underwhelmed.

I can't seem to find any succint help references.  The online manual
has a good bit of info, but it's not well organized IMHO, and not at
all easy to wade through.   In general, it's a bit lacking, IMHO, but
I guess that goes with the price.

So after being unable to sort through my difficulties any other way, I
thought I'd try to ask here since I know there are some Octave users
here.   FWIW, I downloaded the latest version, which is 3.0.0, and the
SciTE editor was bundled with it.

I've a number of old Matlab programs, and have been, futilely, trying
to make some progress with editing new programs.   The common problem
seems to be "undefined near line xx column 1".   The file in which
this is currently happening only has 33 lines, but it's reporting
"undefined near line 50 column 1".   Oddly if I issue a "clear all"
and then immediately re-run the file, with no other changes, the line
count increments.   Like this:

ex_prog
error: 'ex_prog' undefined near line 50 column 1
clear all
ex_prog
error: 'ex_prog' undefined near line 51 column 1
clear all
ex_prog
error: 'ex_prog' undefined near line 52 column 1

Sometimes it complains about "undefined" near a line that has the
little expand/contract +/- in the first column, although that doesn't
seem to add a character to the actual file.  It doesn't seem to matter
whether the file has been recently opened or saved with another
editor, it just finds these mysterious little reasons to never run a
program.   I did manage to plot a single cycle of a sine wave (and the
plot was, again, underwhelming), but anything more complicated than
that doesnt get anywhere.

Is this a recognizable problem to anyone?   Is there a better place to
go for answers?   I didn't find a relevant newsgroup (other than the
matlab newsgroup, which I'd guess wouldn't necessarily be helpful),
nor have I found any relevant forums.

Eric Jacobsen
Minister of Algorithms
Abineau Communications
http://www.ericjacobsen.org
Hi Eric,

There is an octave newsgroup: 

  comp.soft-sys.octave

There is also an IRC channel on freenode.net called #octave. 

Regarding your error, would it be possible for you to post the code? I
can't help too much just based on what you wrote. 
-- 
%  Randy Yates                  % "The dreamer, the unwoken fool - 
%% Fuquay-Varina, NC            %  in dreams, no pain will kiss the brow..."
%%% 919-577-9882                %  
%%%% <yates@ieee.org>           % 'Eldorado Overture', *Eldorado*, ELO
http://www.digitalsignallabs.com
On Mar 23, 8:22 pm, Eric Jacobsen <eric.jacob...@ieee.org> wrote:
> Okay, so I need to make some plots that neither MathCAD nor excel can > do easily, so I bit the bullet and installed Octave. After wrestling > with it for a couple of days I have to say I am, so far, extremely > underwhelmed.
yer not the only one, after all it seems intended to be a gnu freeware counterpart to MATLAB. i contacted Eaton (and got on the Octave developer's list for a little while) to propose they do to Octave what i have, for more than a decade, been trying to get MATLAB to do: generalize handling array indices so that an array can have non- positive integer indices; so that the indices of the upper-left corner need not always be (1,1). fell on deaf ears. r b-j
On Mar 23, 8:22 pm, Eric Jacobsen <eric.jacob...@ieee.org> wrote:
> Okay, so I need to make some plots that neither MathCAD nor excel can > do easily, so I bit the bullet and installed Octave. After wrestling > with it for a couple of days I have to say I am, so far, extremely > underwhelmed.
yer not the only one, after all it seems intended to be a gnu freeware counterpart to MATLAB. i contacted Eaton (and got on the Octave developer's list for a little while) to propose they do to Octave what i have, for more than a decade, been trying to get MATLAB to do: generalize handling array indices so that an array can have non- positive integer indices; so that the indices of the upper-left corner need not always be (1,1). fell on deaf ears. r b-j
On Mar 23, 8:22 pm, Eric Jacobsen <eric.jacob...@ieee.org> wrote:
> Okay, so I need to make some plots that neither MathCAD nor excel can > do easily, so I bit the bullet and installed Octave. After wrestling > with it for a couple of days I have to say I am, so far, extremely > underwhelmed.
yer not the only one, after all it seems intended to be a gnu freeware counterpart to MATLAB. i contacted Eaton (and got on the Octave developer's list for a little while) to propose they do to Octave what i have, for more than a decade, been trying to get MATLAB to do: generalize handling array indices so that an array can have non- positive integer indices; so that the indices of the upper-left corner need not always be (1,1). fell on deaf ears. r b-j
On Mar 23, 8:22 pm, Eric Jacobsen <eric.jacob...@ieee.org> wrote:
> Okay, so I need to make some plots that neither MathCAD nor excel can > do easily, so I bit the bullet and installed Octave. After wrestling > with it for a couple of days I have to say I am, so far, extremely > underwhelmed.
yer not the only one, after all it seems intended to be a gnu freeware counterpart to MATLAB. i contacted Eaton (and got on the Octave developer's list for a little while) to propose they do to Octave what i have, for more than a decade, been trying to get MATLAB to do: generalize handling array indices so that an array can have non- positive integer indices; so that the indices of the upper-left corner need not always be (1,1). fell on deaf ears. r b-j
On Mar 23, 7:49 pm, robert bristow-johnson <r...@audioimagination.com>
wrote:

> ... > yer not the only one, after all it seems intended to be a gnu freeware > counterpart to MATLAB. i contacted Eaton (and got on the Octave > developer's list for a little while) to propose they do to Octave what > i have, for more than a decade, been trying to get MATLAB to do: > generalize handling array indices so that an array can have non- > positive integer indices; so that the indices of the upper-left corner > need not always be (1,1). > > fell on deaf ears. > > r b-j
So, doesn't that make Octave an accurate counterpart to MATLAB? But, in the spirit of GNU freeware, what did they say when you offered to implement the change for them? Dale B. Dalrymple http://dbdimages.com
On Sun, 23 Mar 2008 22:29:23 -0400, Randy Yates <yates@ieee.org>
wrote:

>Hi Eric, > >There is an octave newsgroup: > > comp.soft-sys.octave
Ah, thanks. Now the mystery is why the group search in Free Agent didn't find that...
>There is also an IRC channel on freenode.net called #octave. > >Regarding your error, would it be possible for you to post the code? I >can't help too much just based on what you wrote.
It seems to be code independent and somehow associated with the file. It appears to be complaining about some mysterious whitespace marker or something, and since in the one example it's complaining about a line well past the end of the file the code probably has nothing to do with it. Nevertheless, try this: _________________________________ % % 5/1/96 Eric Jacobsen % % Design a butterworth filter and determine the equivalent FIR taps. % order=4; % Order of filter. cutoff=0.25; % Cutoff relative to 1.0 = 1/2 sample rate. [B,A]=butter(order,cutoff); end; ___________________ That's an ancient file that I had laying around that's small and exhibits the problem. For this one it says error: 'buttgen' undefined near line 60 column 1 Well, the file only has 13 lines. Grrr. Eric Jacobsen Minister of Algorithms Abineau Communications http://www.ericjacobsen.org
Eric,

    If possible send the code to

    bharat at arithos dot com.

    I will have a look and suggest what might go wrong.

    The newer versions of octave does not have the
    plot zoom capability and hence u might have some
    trouble zooming into plots.

    1. Install octave 2.1.73 version. This is most
       stable and I have been using it for past 
       6 months without any issues (some very minor
       issues which can easily be resolved).

    2. If you are installing on linux machine then in
       your home directory you should edit one file
       called .gnuplot and in that file put

       set mouse

       close, save the file and then invoke octave. This
       will help zooming on the figure/plot using 3rd mouse 
       button. Press 3rd mouse button and drag.

       Just remember one thing: You can zoom only the
       last active plot. So whichever plot you want
       to zoom on, it should be put on the end of the
       code.

    3. On windows machine, install the cygwin version, it
       works fine and allows you to zoom plot. I am using
       this on windows vista and version of octave is
       again 2.1.73. After installation

             a. double clik on cygwin icon.
             b. startx
             c. In X window type octave.

    4. Octave has figure stickiness phenomena, to get over
       always do:

       figure; clf; hold on;
       plot(x, 'r');
       plot(y, 'g');
       hold off;

       for the next new plot do again

       figure; clf; hold on;
       plot(a, 'k');
       plot(b, 'c');
       hold off;

    5. For the active figure/plot some useful short keys

       a        : zoom to original full view
       g        : grid on/off (toggle button)
       l        : y-axis log scale toggle button
       r        : ruler
       h        : help on plot commands

    Hope this benefits other octave users too. Just a
    side note. I have provided DSP training to Karmic
    Engineers (13 of them) full day courses for 15 days.
    The whole training was done using Octave 2.1.73. 

    Only few minor hiccups were there but they can
    easily be resolved. GOD bless John Eaton's Team
    and all the guys who contributed to Octave. 

    No doubt the golden age of free software has arrived.

Thanks and Regards
Bharat Pathak

Arithos Designs
www.Arithos.com

........DSP Design Consultancy and Training Company........

       
        


>order=4; % Order of filter. >cutoff=0.25; % Cutoff relative to 1.0 = 1/2 sample rate. > >[B,A]=butter(order,cutoff); > >end;
Eric, This file runs fine for me. Only thing that I did is to remove extra "end;" command at the end of the file. The output generated is B = 0.010209 0.040838 0.061257 0.040838 0.010209 A = 1.00000 -1.96843 1.73586 -0.72447 0.12039 I think the problem for you might be something like this, you have your own version of a file called "butter.m" you could loacate it using which butter In that file you are calling one more function called "buttgen" and this could be problem. Also make sure that your filenames do not collide with standard function names provided by octave. Thanks and Regards Bharat Pathak www.Arithos.com DSP Design consultancy and training company