Help-octave Digest, Vol 37, Issue 6

David Doria daviddoria at gmail.com
Fri Apr 3 11:44:54 CDT 2009


Has anyone else seen the problem with scatter() that I was talking about?

Thanks,

David


On Fri, Apr 3, 2009 at 12:38 PM, <help-octave-request at octave.org> wrote:

> Send Help-octave mailing list submissions to
>        help-octave at octave.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>        https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
> or, via email, send a message with subject or body 'help' to
>        help-octave-request at octave.org
>
> You can reach the person managing the list at
>        help-octave-owner at octave.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Help-octave digest..."
>
>
> Today's Topics:
>
>   1. Re: How to derive from 'octave_base_value' ? (John W. Eaton)
>   2. Re: Performance optimization (allocation inside a for loop)
>      (John W. Eaton)
>   3. Re: Performance optimization (allocation inside a for loop) (r)
>   4. Re: Performance optimization (allocation inside a for loop)
>      (Jaroslav Hajek)
>   5. phase space (Johannes Wolfgang Woger)
>   6. octave plot function (Maxwell Blair)
>   7. undefined symbol: _glp_lib_fault_hook (Rishi Amrit)
>   8. Re: phase space (Carlo de Falco)
>   9. Re: phase space (Johannes Wolfgang Woger)
>  10. Octave to serial on Mac OS-X (Gondwana)
>  11. Re: octave plot function (David Bateman)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Thu, 2 Apr 2009 16:04:44 -0400
> From: "John W. Eaton" <jwe at octave.org>
> Subject: Re: How to derive from 'octave_base_value' ?
> To: S?ren Hauberg <soren at hauberg.org>
> Cc: help-octave at octave.org
> Message-ID: <18901.6748.803476.601223 at segfault.lan>
> Content-Type: text/plain; charset=iso-8859-1
>
> On  2-Apr-2009, S?ren Hauberg wrote:
>
> | s?n, 29 03 2009 kl. 19:03 -0400, skrev John W. Eaton:
> | > On 22-Mar-2009, S?ren Hauberg wrote:
> | >
> | > | s?n, 22 03 2009 kl. 20:53 +0100, skrev Jaroslav Hajek:
> | > | > I think your derived class must override
> octave_base_value::is_defined.
> | > |
> | > | Thanks, that was the missing part.
> | >
> | > and earlier you wrote:
> | >
> | > | I'd like to create a new type in Octave that simply holds a pointer
> to
> | > | some object in an external library. The attached code implements a
> very
> | > | simple type in Octave that just holds a string. This was the simplest
> | > | possible type I could think of. I compile the code with
> | >
> | > Does this solution (using octave_value) give you the copying semantics
> | > that you want?
> |
> | This sounds like a trick question :-) I think it does what I want, but
> | my current code is quite poorly tested, so I'm not sure. Is there
> | anything I should be looking out for?
>
> I was just wondering if the default copy-on-write semantics of the
> octave_valeu class caused trouble for you.  Or maybe it doesn't matter
> if you just have a scalar object?  I'm not sure.  I just remember
> running into trouble when trying to wrap pointers for COMEDI objects
> because I really needed reference/pointer/handle semantics for that.
>
> jwe
>
>
>
> ------------------------------
>
> Message: 2
> Date: Thu, 2 Apr 2009 16:06:23 -0400
> From: "John W. Eaton" <jwe at octave.org>
> Subject: Re: Performance optimization (allocation inside a for loop)
> To: r <nbs.public at gmail.com>
> Cc: help-octave at octave.org
> Message-ID: <18901.6847.912619.577620 at segfault.lan>
> Content-Type: text/plain; charset=us-ascii
>
> On  2-Apr-2009, r wrote:
>
> | I think chunks of ~5% of the structure size (perhaps more for smaller
> | arrays) would be affordable by anyone and would effectively fix these
> | allocation issues in practical applications. Whether it is worth the
> | effort is a different question.
>
> If you think this is important, how about submitting a patch?
>
> jwe
>
>
>
> ------------------------------
>
> Message: 3
> Date: Thu, 2 Apr 2009 22:06:46 +0100
> From: r <nbs.public at gmail.com>
> Subject: Re: Performance optimization (allocation inside a for loop)
> To: help-octave at octave.org
> Message-ID:
>        <5b9d31e90904021406ta42c6cekffb6d266b0f071e3 at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> On Thu, Apr 2, 2009 at 9:06 PM, John W. Eaton <jwe at octave.org> wrote:
> >
> > If you think this is important, how about submitting a patch?
>
> Sorry, I didn't mean to push anyone. Feel free to do whatever you like
> with my suggestions. As for the patch, I'm not capable of preparing
> one, really.
>
> Cheers,
> -r.
>
>
> ------------------------------
>
> Message: 4
> Date: Fri, 3 Apr 2009 07:11:55 +0200
> From: Jaroslav Hajek <highegg at gmail.com>
> Subject: Re: Performance optimization (allocation inside a for loop)
> To: r <nbs.public at gmail.com>
> Cc: help-octave at octave.org
> Message-ID:
>        <69d8d540904022211u1de70831ua56768a13ad83ad8 at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> On Thu, Apr 2, 2009 at 9:53 PM, r <nbs.public at gmail.com> wrote:
> > On Thu, Apr 2, 2009 at 9:59 AM, Francesco Potorti` <Potorti at isti.cnr.it>
> wrote:
> >>> ?for n = [1:n]
> >> ?A prefereable way is to write
> >>
> >> for ii = 1:n
> >
> > Sure, my mistake.
> >
> >> In the cases when you really need a for loop because your code cannot be
> >> vectorised, the efficient way is to either preallocate the vector, as
> >> you did, or to start writing from the end using
> >> ?for ii = n:-1:1
> >
> > That's a good idea. Perhaps it would be enough to document these
> > solutions (e.g. in "help for") so that newcomers didn't had to
> > rediscover them on their own.
> >
> >>>So the complexity is O(n^2).
> >>
> >> Well, given two points, it could be anything :)
> >
> > plot([10 20 30 40 50 60 70 80 90 100 120 150]*1000, [0.88 2.11 3.9
> > 6.48 10.7 19.9 28.3 39.8 58.2 82.1 123 215])
> >
> >> Hm. ?Maybe growing in fixed-size chunks would be a good idea, in fact it
> >> would significantly alleviate the problem you observe. ?Maybe also
> >> growing in variable-size chunks would be a good idea. ?In fact, others
> >> have observed that this would be dangerous for really big arrays, but
> >> growing a big array is anyway bad practice and very slow, so those
> >> conciously working at the limits of available memory will use the
> >> currently recommended techniques, while the others could benefit from
> >> improved performance and not be too disturbed by the occasional
> >> out-of-memory error.
> >
> > I think chunks of ~5% of the structure size (perhaps more for smaller
> > arrays) would be affordable by anyone
>
> based on what...?
>
> > and would effectively fix these
> > allocation issues in practical applications. Whether it is worth the
> > effort is a different question. It certainly doesn't help Octave when
> > somebody executes the same code in Matlab and Octave and the latter is
> > hundreds times slower.
> >
> > Regards,
> >
> > -r.
> >
>
> I don't think things work differently in Matlab. At least with Matlab
> 2007, I see the same behaviour.
> A lot of code runs faster in Matlab because it's better optimized,
> especially given the JIT accelerator. But there's also code that runs
> faster in Octave. We don't take always the same path as Matlab. I, for
> instance, don't think that a JIT compiler is really such a great idea.
> What doesn't help Octave would probably fill a long list. What does
> help Octave includes donations, patches, bug reports, etc.
>
> --
> RNDr. Jaroslav Hajek
> computing expert & GNU Octave developer
> Aeronautical Research and Test Institute (VZLU)
> Prague, Czech Republic
> url: www.highegg.matfyz.cz
>
>
>
> ------------------------------
>
> Message: 5
> Date: Fri, 03 Apr 2009 14:55:32 +0200
> From: Johannes Wolfgang Woger <jwwoger at chello.at>
> Subject: phase space
> To: help-octave at octave.org
> Message-ID: <49D60744.50501 at chello.at>
> Content-Type: text/plain; charset=ISO-8859-15; format=flowed
>
> Hi,
> I am an newby.
>
> How can I obtain a plot of the phase portrait
> of Lotka-Volterra:
>
> octave:92> function xdot = f(x,t)
>  >  a = 4;
>  >  b = 4;
>  >  c = 4;
>  >  d = 8;
>  >  E = 1;
>  >  K = 1;
>  >  xdot = zeros(2,1);
>  >  xdot(1) = x(1)*(a-b*x(2)-E*x(1));
>  >  xdot(2) = x(2)*(d*x(1)-c-K*x(2));
>  >  endfunction
> octave:93>
> octave:93> t = linspace(0,50,100);
> octave:94> x = lsode("f", [2,1],t);
> octave:95> plot(t,x);
>
>
> Thanks
>
>
> ------------------------------
>
> Message: 6
> Date: Thu, 02 Apr 2009 22:51:34 -0400
> From: Maxwell Blair <maxblair at earthlink.net>
> Subject: octave plot function
> To: help at octave.org
> Message-ID: <49D579B6.3030501 at earthlink.net>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> I just started to explore octave as alternative to matlab.
> The documentation for octave function 'plot' is not very satisfying.
> Does someone have a list of examples of plot that I can test?
> Thanks for anything
> Max
>
>
> ------------------------------
>
> Message: 7
> Date: Thu, 2 Apr 2009 22:10:31 -0500
> From: Rishi Amrit <rishiamrit at gmail.com>
> Subject: undefined symbol: _glp_lib_fault_hook
> To: help-octave <help-octave at bevo.che.wisc.edu>
> Message-ID:
>        <def1d5650904022010n6021dc2ep8520e895c4326a6a at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hi,
>
>   I built octave (stable ver 3.0.3) a few days back. One of sqp calls in my
> code spits out the following error terminating octave.
>
> octave: symbol lookup error:
>
> /usr/local/octave/version/libexec/octave/3.0.3/oct/x86_64-unknown-linux-gnu/__glpk__.oct:
> undefined symbol: _glp_lib_fault_hook
>
> I think its got to do with the octave build. I need to install something
> and
> build octave again. Any ideas ?
>
> Thanks,
>
> Rishi
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20090402/ab38a071/attachment-0001.html
>
> ------------------------------
>
> Message: 8
> Date: Fri, 3 Apr 2009 15:26:39 +0200
> From: Carlo de Falco <carlo.defalco at gmail.com>
> Subject: Re: phase space
> To: Johannes Wolfgang Woger <jwwoger at chello.at>
> Cc: help-octave at octave.org
> Message-ID: <61022ECC-6C58-4B51-A8E5-735B253E6681 at gmail.com>
> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes
>
>
> On 3 Apr 2009, at 14:55, Johannes Wolfgang Woger wrote:
>
> > Hi,
> > I am an newby.
> >
> > How can I obtain a plot of the phase portrait
> > of Lotka-Volterra:
> >
> > octave:92> function xdot = f(x,t)
> >> a = 4;
> >> b = 4;
> >> c = 4;
> >> d = 8;
> >> E = 1;
> >> K = 1;
> >> xdot = zeros(2,1);
> >> xdot(1) = x(1)*(a-b*x(2)-E*x(1));
> >> xdot(2) = x(2)*(d*x(1)-c-K*x(2));
> >> endfunction
> > octave:93>
> > octave:93> t = linspace(0,50,100);
> > octave:94> x = lsode("f", [2,1],t);
> > octave:95> plot(t,x);
> >
>
> plot(x(:,1), x(:,2));
> xlabel("x_1");
> ylabel("x_2");
>
> but I would suggest using a few more time steps if you want a nice
> looking spiral...
>
> > Thanks
>
> HTH,
> c.
>
>
>
> ------------------------------
>
> Message: 9
> Date: Fri, 03 Apr 2009 15:47:37 +0200
> From: Johannes Wolfgang Woger <jwwoger at chello.at>
> Subject: Re: phase space
> To: help-octave at octave.org
> Message-ID: <49D61379.3050703 at chello.at>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Carlo de Falco schrieb:
> >
> > On 3 Apr 2009, at 14:55, Johannes Wolfgang Woger wrote:
> >
> >> Hi,
> >> I am an newby.
> >>
> >> How can I obtain a plot of the phase portrait
> >> of Lotka-Volterra:
> >>
> >> octave:92> function xdot = f(x,t)
> >>> a = 4;
> >>> b = 4;
> >>> c = 4;
> >>> d = 8;
> >>> E = 1;
> >>> K = 1;
> >>> xdot = zeros(2,1);
> >>> xdot(1) = x(1)*(a-b*x(2)-E*x(1));
> >>> xdot(2) = x(2)*(d*x(1)-c-K*x(2));
> >>> endfunction
> >> octave:93>
> >> octave:93> t = linspace(0,50,100);
> >> octave:94> x = lsode("f", [2,1],t);
> >> octave:95> plot(t,x);
> >>
> >
> > plot(x(:,1), x(:,2));
> > xlabel("x_1");
> > ylabel("x_2");
> >
> > but I would suggest using a few more time steps if you want a nice
> > looking spiral...
> >
> Thanks, works great. Is there a tutorial addressing phase space?
>
> >> Thanks
> >
> > HTH,
> > c.
> >
> >
>
>
>
> ------------------------------
>
> Message: 10
> Date: Fri, 3 Apr 2009 07:47:07 -0700 (PDT)
> From: Gondwana <paul at paulgodard.com>
> Subject: Octave to serial on Mac OS-X
> To: help-octave at octave.org
> Message-ID: <22869916.post at talk.nabble.com>
> Content-Type: text/plain; charset=us-ascii
>
>
> Hi
> In the context of the Kids of Nature Initiative (www.kidsofnature.org), I
> am
> in charge of producing a series of time lapse movies on the last nature
> sanctuaries on earth, starting with Africa.  For the realization of this
> project, our non-profit organization has teamed-up with several sponsors,
> including Festo who is building up the motion controlled device for the
> time
> lapse photographic project.
>
> In order to download instructions to the motion control device's PLC, I
> will
> have to use a software such as MatLab (or Octave) to create the set of
> values for the different movements (linear, pan & azimut) via the serial
> port.
>
> I am using an Apple Mac Book Pro with OS-X 10.5.6 and the PLC is attached
> to
> the USB port via a serial RS232 - USB adator from Sunix.
>
> I normally program in PHP.  Although we have successfully tested PHP
> writing
> to a Festo intelligent motor via USB-Serial, PHP is unable to open the
> serial port as soon as the PLC is attached.  The PHP fopen() functions.  So
> far this problem could not be solved as not too many people seems to use
> PHP
> serial on Mac.
>
> We have tested MatLab on Windows and it is working fine.  However, the
> programme must work on OS-X.  Will MatLab/Octave Mac version do the same
> job?
>
> The principle is simple :
> - calculate an array of 10000 values (positions) through different math
> functions
> - open serial port
> - send each value, one by one and test the returned value for verification
> - close serial port
>
> I have tried to download the Mac package for Octave
> (octave-3.1.55-i386.dmg)
> but it failed twice.
> --
> View this message in context:
> http://www.nabble.com/Octave-to-serial-on-Mac-OS-X-tp22869916p22869916.html
> Sent from the Octave - General mailing list archive at Nabble.com.
>
>
>
> ------------------------------
>
> Message: 11
> Date: Fri, 03 Apr 2009 18:38:49 +0200
> From: David Bateman <dbateman at dbateman.org>
> Subject: Re: octave plot function
> To: Maxwell Blair <maxblair at earthlink.net>
> Cc: help at octave.org
> Message-ID: <49D63B99.10706 at dbateman.org>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Maxwell Blair wrote:
> > I just started to explore octave as alternative to matlab.
> > The documentation for octave function 'plot' is not very satisfying.
> > Does someone have a list of examples of plot that I can test?
> > Thanks for anything
> > Max
> > _______________________________________________
> > Help-octave mailing list
> > Help-octave at octave.org
> > https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
> >
> >
> The help of the functions are not suppose to stand on their own, but are
> rather an aid if you know more or less what you want to do. Read the
> manual in conjunction with the plot function and things will be clearer.
> I'll sent a pdf offline of the manual
>
> D.
>
>
> --
> David Bateman                                dbateman at dbateman.org
> 35 rue Gambetta                              +33 1 46 04 02 18 (Home)
> 92100 Boulogne-Billancourt FRANCE            +33 6 72 01 06 33 (Mob)
>
>
>
> ------------------------------
>
> _______________________________________________
> Help-octave mailing list
> Help-octave at octave.org
> https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
>
>
> End of Help-octave Digest, Vol 37, Issue 6
> ******************************************
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20090403/237cb3b8/attachment-0001.html 


More information about the Help-octave mailing list