From thomas.weber.mail at gmail.com Sun Nov 1 02:11:53 2009 From: thomas.weber.mail at gmail.com (Thomas Weber) Date: Sun, 1 Nov 2009 09:11:53 +0100 Subject: Upgrade Ubuntu Jaunty to Karmic (9.04 to 9.10) breaks self-compiled octave In-Reply-To: <9543b3a40910311020n33cdda63y743ab2e68996acaa@mail.gmail.com> References: <4AEAF5F4.1030302@uniten.edu.my> <4AEB0531.1030708@claude.uniten.edu.my> <9543b3a40910311020n33cdda63y743ab2e68996acaa@mail.gmail.com> Message-ID: <20091101081153.GA5430@atlan> On Sat, Oct 31, 2009 at 11:20:12AM -0600, Jordi Guti?rrez Hermoso wrote: > 2009/10/30 Uwe Dippel : > > Though it would be great to have a transitional package. > > I wonder if there is a good reason to name it octave2.9 / octave3.0 / > > octave3.2 instead of maybe just octave? So that it gets updated > > automatically? > > I can't remember the exact reason for it, but roughly, I believe it > has to do with other packages dependent on Octave and of course, on > specific versions of Octave. > > Rafael Laboissiere and his heir apparent Thomas Weber had very good > reasons for keeping the version name in the package name, so perhaps > one of them can provide an explanation. Off the top of my head (and maybe mixing some version numbers in the 2.0/2.1 case). When 2.0 was stable, it was so for a really long time. Most users actually used the 2.1 version. So, both were introduced into Debian (I think this was actually done by Dirk Eddelbuettel, but it happened before I got involved in Debian, so maybe it was someone else). 2.1 vs. 2.9/3.0: There were some big changes, breaking other people's software. I don't remember what exactly, but I submitted at least one patch to another maintainer to get his package working on the new 3.0 stuff. Ultimately, we are talking about Octave as a library and an interpreter, not as a standalone software. If a new release isn't 100% backwards compatible, you somehow need to give people a way to migrate their scripts to the new version. That means they need the old release in ordr to work and the new release for porting their stuff. Thomas From udippel at uniten.edu.my Sun Nov 1 03:27:22 2009 From: udippel at uniten.edu.my (Uwe Dippel) Date: Sun, 01 Nov 2009 17:27:22 +0800 Subject: Upgrade Ubuntu Jaunty to Karmic (9.04 to 9.10) breaks self-compiled octave In-Reply-To: <20091101081153.GA5430@atlan> References: <4AEAF5F4.1030302@uniten.edu.my> <4AEB0531.1030708@claude.uniten.edu.my> <9543b3a40910311020n33cdda63y743ab2e68996acaa@mail.gmail.com> <20091101081153.GA5430@atlan> Message-ID: <4AED547A.8050803@uniten.edu.my> Thomas Weber wrote: > > Off the top of my head (and maybe mixing some version numbers in the > 2.0/2.1 case). > > When 2.0 was stable, it was so for a really long time. Most users > actually used the 2.1 version. So, both were introduced into Debian > (I think this was actually done by Dirk Eddelbuettel, but it happened > before I got involved in Debian, so maybe it was someone else). > > 2.1 vs. 2.9/3.0: There were some big changes, breaking other people's > software. I don't remember what exactly, but I submitted at least one > patch to another maintainer to get his package working on the new 3.0 > stuff. > > Ultimately, we are talking about Octave as a library and an interpreter, > not as a standalone software. > If a new release isn't 100% backwards compatible, you somehow need to > give people a way to migrate their scripts to the new version. That > means they need the old release in ordr to work and the new release for > porting their stuff. > Dear Thomas, appreciate your explanation very much. I thought so, since Eidors was broken with 3.0. Unfortunately, 2.X was not available under Jaunty, and some list members suggested to compile 3.2.2 myself. (Which was quite a hassle, but finally done with some very helpful people on this list.) The whole thing broke again, with the update of Jaunty to Karmic. Maybe I should say a few words about my background and motivation: being a FOSS-person for > 10 years, I was looking to replace expensive/pirated Matlab stuff in my workplace (students can easily buy Matlab for around US$1 in various markets). We were doing EIT-research, using Eidors. Our data, alas, cannot be shown on octave, subsequent to the transition 2.X->3.X of octave, because it broke Eidors compatibility; so we are stuck with Matlab. With students' work, I was trying to get some first-year second-semester students to use octave for their basic Bode plots, but the instructions on the web, for Matlab, don't work neither. With the usually utmost helpful people on this list, another syntax made those plots work, but with the title printed in the center instead of at the top. And still, the Bode plot comes with warnings, despite of using the suggested syntax. Add together with my hours (now rather days) just for installing, I'm not really impressed. Though I tried very hard to be impressed. For next Friday, I am invited to show the potential replacement of proprietary research tools (SPSS, Matlab) with FOSS tools in the MyGOSSCon 2009 (Malaysian Government Open Source Conference). What should/could I say without lying? Oh, yes, qtocatve is incompatible with 3.2.2. Also in this respect, your sentence Ultimately, we are talking about Octave as a library and an interpreter, not as a standalone software. confuses me. Does that mean octave does not want to be a competitor to Matlab? I really don't know what to say at MyGOSSCon. As of now, I can only summarise, that I couldn't find fault with R as a full replacement of the functionality of SPSS (nevermind GUI), function; while octave - sorry, only to my own personal experiences in the last few months, and not wanting to hurt anyone - looks more like alpha. At least, seen from the perspective of someone who intends to replace it for Matlab in teaching and research. (And, from the point of view of a FOSS-developer, a software that seems to have seen some wrong decisions. But that's not what I feel like discussing here. Terms like backward compatibility and Matlab compatibility would need addressing before I could full-heartedly recommend its use.) Uwe From thomas.weber.mail at gmail.com Sun Nov 1 12:21:17 2009 From: thomas.weber.mail at gmail.com (Thomas Weber) Date: Sun, 1 Nov 2009 19:21:17 +0100 Subject: Upgrade Ubuntu Jaunty to Karmic (9.04 to 9.10) breaks self-compiled octave In-Reply-To: <4AED547A.8050803@uniten.edu.my> References: <4AEAF5F4.1030302@uniten.edu.my> <4AEB0531.1030708@claude.uniten.edu.my> <9543b3a40910311020n33cdda63y743ab2e68996acaa@mail.gmail.com> <20091101081153.GA5430@atlan> <4AED547A.8050803@uniten.edu.my> Message-ID: <20091101182117.GA16719@atlan> On Sun, Nov 01, 2009 at 05:27:22PM +0800, Uwe Dippel wrote: > Thomas Weber wrote: >> >> Off the top of my head (and maybe mixing some version numbers in the >> 2.0/2.1 case). >> >> When 2.0 was stable, it was so for a really long time. Most users >> actually used the 2.1 version. So, both were introduced into Debian >> (I think this was actually done by Dirk Eddelbuettel, but it happened >> before I got involved in Debian, so maybe it was someone else). >> >> 2.1 vs. 2.9/3.0: There were some big changes, breaking other people's >> software. I don't remember what exactly, but I submitted at least one >> patch to another maintainer to get his package working on the new 3.0 >> stuff. >> >> Ultimately, we are talking about Octave as a library and an interpreter, >> not as a standalone software. >> If a new release isn't 100% backwards compatible, you somehow need to >> give people a way to migrate their scripts to the new version. That >> means they need the old release in ordr to work and the new release for >> porting their stuff. >> > > Dear Thomas, > > appreciate your explanation very much. I thought so, since Eidors was > broken with 3.0. Unfortunately, 2.X was not available under Jaunty, and > some list members suggested to compile 3.2.2 myself. (Which was quite a > hassle, but finally done with some very helpful people on this list.) > The whole thing broke again, with the update of Jaunty to Karmic. I'm sorry to say that, but you are using the wrong distribution. Get a distribution with a *real* maintainer caring for Octave. Ubuntu's "let's recompile whatever happens to be in Debian unstable/testing at an arbitrary point of time" attitude just doesn't cut it. That goes for Octave's dependencies as well. If you don't want Debian, Fedora seems to be a sensible alternative. > Maybe I should say a few words about my background and motivation: being > a FOSS-person for > 10 years, I was looking to replace expensive/pirated > Matlab stuff in my workplace (students can easily buy Matlab for around > US$1 in various markets). We were doing EIT-research, using Eidors. Our > data, alas, cannot be shown on octave, subsequent to the transition > 2.X->3.X of octave, because it broke Eidors compatibility; so we are > stuck with Matlab. > Add together with my hours (now rather days) just for installing, I'm > not really impressed. Though I tried very hard to be impressed. For next > Friday, I am invited to show the potential replacement of proprietary > research tools (SPSS, Matlab) with FOSS tools in the MyGOSSCon 2009 > (Malaysian Government Open Source Conference). What should/could I say > without lying? Oh, yes, qtocatve is incompatible with 3.2.2. Hm, are you sure about the incompatibility? I know for a fact that 3.2.3 works: https://buildd.debian.org/pkg.cgi?pkg=qtoctave > Also in this respect, your sentence > > Ultimately, we are talking about Octave as a library and an interpreter, > not as a standalone software. > > confuses me. Does that mean octave does not want to be a competitor to > Matlab? I don't know what Octave wants to be. I don't care about Matlab at all. I'm no longer at the university and buying Matlab is out of the question. My sentence was meant in the idea that Octave is not a stand-alone project like OpenOffice.org. Ie, I need to care for people having written code specific to older versions of Octave by giving them a migration path. > I really don't know what to say at MyGOSSCon. As of now, I can only > summarise, that I couldn't find fault with R as a full replacement of > the functionality of SPSS (nevermind GUI), function; while octave - > sorry, only to my own personal experiences in the last few months, and > not wanting to hurt anyone - looks more like alpha. At least, seen from > the perspective of someone who intends to replace it for Matlab in > teaching and research. I've used Octave for several years at the university without problems. If it doesn't meet your needs, you seem to have different needs than I have. > (And, from the point of view of a FOSS-developer, a software that seems > to have seen some wrong decisions. But that's not what I feel like > discussing here. Terms like backward compatibility and Matlab > compatibility would need addressing before I could full-heartedly > recommend its use.) Then continue to use Matlab. I don't see a problem with that at all. If money is a problem, . You can't eat your cake and have it, too. Thomas From frenk.calza at gmail.com Sun Nov 1 13:09:51 2009 From: frenk.calza at gmail.com (franco basaglia) Date: Sun, 1 Nov 2009 20:09:51 +0100 Subject: octave and delay ode's In-Reply-To: References: <39CEC9CB-7B58-4173-8E6D-9C7BF6CBE6B4@gmail.com> <59CCC399-AC46-45F9-AD93-A0643AFC0EA8@gmail.com> <55A3A9EF-0C56-4091-A6AE-8A126012CD71@gmail.com> Message-ID: I must be missing something as in your file I see no time derivatives... sorry for my oversight. I attach again pdf with right system. function f = fun (t, y, yd) f(1) =-y(1) + yd(2); f(2) =-y(2) ; endfunction ode23d (@fun, [0 5], [1;1], .1, [1;1]) notice that in the example above only one equation includes a delay: is this what you mean by system of ODEs and DDEs? Yes,sure. To be more precise I have a system like this: d y1(t)/ dt = -y1(t) d y2(t)/ dt = -y2(t) + y1(t-5) d y3(t)/dt = -y3(t) + y2(t-10)*y1(t-10) that I try to solve in this way: function f = fun (t, y, yd) f(1) =-y(1) f(2) =-y(2) + yd(1) f(3) =-y(3) + yd(2)*yd(1) endfunction t = [0:.5:20] res = ode45d (@fun, t, [1;1;1], [5;10], ones (3,10)) It's run. But I don't think this is the right way.I don't know if with this notation it applies a delay of 5 time units to f(2) and of 10 time units to f(3). Note that in f(3) yd(1) comes again but with a different delay. Infact for my script, that I attach here, is the same. It's runs but with different results compare to Stella. Any Idea? thanks a lot f.t. 2009/10/29 Carlo de Falco > On 29 Oct 2009, at 16:38, franco basaglia wrote: > > sorry, I don't know what "stella" is so I do not understand this syntax, >> >> Stella is a simulation development environment. Delay sintax is in [1] >> >> >> maybe you could describe your system in plain mathematical syntax? >> >> I attach a pdf with my ode's system. Only equations number 6 and number 7 >> have a delay as you can see. >> >> > I must be missing something as in your file I see no time derivatives... > > > >> yes, odepkg comes with a very nice set of examples and a pdf manual, type >> odepkg_examples_dde () >> to see some DDE examples. >> >> >> Thanks.I'm trying to use it. I dont' yet understand how to apply in a >> system with >> DDE's and ODE's >> > > ode23d (fun, [t0, tend], y0, tau, h) > solves the DDE sysytem > > dy/dt = fun (t, y(t), y(t-tau)) > y(t0) = y0 > y(t) = h, t > where of course y,y0,h can be vectors. > > for example to solve the following system in 0 > d y1(t)/ dt = - y1 (t) + y2 (t-.1) > d y2(t)/ dt = - y2 (t) > > y1(t) = y2(t) = 1, t<=0 > > you can do: > > function f = fun (t, y, yd) > f(1) =-y(1) + yd(2); > f(2) =-y(2) ; > endfunction > > ode23d (@fun, [0 5], [1;1], .1, [1;1]) > > notice that in the example above only one equation includes a delay: > is this what you mean by system of ODEs and DDEs? > > >> >> HTH, > c. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091101/0cf3f370/attachment-0001.html -------------- next part -------------- A non-text attachment was scrubbed... Name: equazioniPatu.pdf Type: application/pdf Size: 27484 bytes Desc: not available Url : https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091101/0cf3f370/attachment-0001.pdf -------------- next part -------------- A non-text attachment was scrubbed... Name: scriptode45.m Type: text/x-objcsrc Size: 4173 bytes Desc: not available Url : https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091101/0cf3f370/attachment-0001.bin From carlo.defalco at gmail.com Sun Nov 1 17:00:54 2009 From: carlo.defalco at gmail.com (Carlo de Falco) Date: Mon, 2 Nov 2009 00:00:54 +0100 Subject: octave and delay ode's In-Reply-To: References: <39CEC9CB-7B58-4173-8E6D-9C7BF6CBE6B4@gmail.com> <59CCC399-AC46-45F9-AD93-A0643AFC0EA8@gmail.com> <55A3A9EF-0C56-4091-A6AE-8A126012CD71@gmail.com> Message-ID: <2ED5382C-8DFA-45C1-BD40-00DD0EE986FC@gmail.com> On 1 Nov 2009, at 20:08, franco basaglia wrote: > > I must be missing something as in your file I see no time > derivatives... > sorry for my oversight. I attach again pdf with right system. What exactly does "delta t" mean in your file? > function f = fun (t, y, yd) > f(1) =-y(1) + yd(2); > f(2) =-y(2) ; > endfunction > > ode23d (@fun, [0 5], [1;1], .1, [1;1]) > > notice that in the example above only one equation includes a delay: > is this what you mean by system of ODEs and DDEs? > > Yes,sure. > To be more precise I have a system like this: > d y1(t)/ dt = -y1(t) > d y2(t)/ dt = -y2(t) + y1(t-5) > d y3(t)/dt = -y3(t) + y2(t-10)*y1(t-10) > > that I try to solve in this way: > function f = fun (t, y, yd) > f(1) =-y(1) > f(2) =-y(2) + yd(1) > f(3) =-y(3) + yd(2)*yd(1) > endfunction > t = [0:.5:20] > res = ode45d (@fun, t, [1;1;1], [5;10], ones (3,10)) I think this should rather be something like: function f = fun (t, y, yd) f(1) =-y(1); %% y1' = -y1(t) f(2) =-y(2) + yd(1,1); %% y2' = -y2(t) + y1(t-lags(1)) f(3) =-y(3) + yd(2,2)*yd(1,2); %% y3' = -y3(t) + y2(t-lags(2))*y1(t- lags(2)) endfunction T = [0,20] %% only initlial and final time %% need to be provided res = ode45d (@fun, t, [1;1;1], [5, 10], ones (3,2)); %% number of columns in HIST should %% be the same as the number of columns %% in LAGS I beleive Thomas Treichl, the author of odepkg is listening on the list so maybe he can confirm whether this is correct? > It's run. But I don't think this is the right way.I don't know if > with this notation it applies a delay of 5 time units to f(2) and of > 10 time units to f(3). what do you mean by "time units"? > Note that in f(3) yd(1) comes again but with a different delay. > Infact for my script, that I attach here, is the same. It's runs but > with different results compare to Stella. > > Any Idea? From your pdf file and your script I get the feeling that you are confusing the time parameter in the continuos problem and the number of time-steps in the discretized system... > thanks a lot > > f.t. c. P.S. please keep the list in CC as someone else may want to help with your questions or benefit from the answers. -------------- next part -------------- A non-text attachment was scrubbed... Name: equazioniPatu.pdf Type: application/pdf Size: 27485 bytes Desc: not available Url : https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091102/103c3cd5/attachment-0001.pdf -------------- next part -------------- A non-text attachment was scrubbed... Name: scriptode45.m Type: text/x-objcsrc Size: 4174 bytes Desc: not available Url : https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091102/103c3cd5/attachment-0001.bin -------------- next part -------------- From highegg at gmail.com Mon Nov 2 01:59:07 2009 From: highegg at gmail.com (Jaroslav Hajek) Date: Mon, 2 Nov 2009 08:59:07 +0100 Subject: new function for quadratic programming: pqpnonneg In-Reply-To: <4AEC5669.1040505@vcn.com> References: <4AEC5669.1040505@vcn.com> Message-ID: <69d8d540911012359k13e4002ckbd7507457b1febe1@mail.gmail.com> On Sat, Oct 31, 2009 at 4:23 PM, Jonathan Stickel wrote: > I finally got a round to checking this function out. ?However, my problem > also has equality and inequality constraints in addition to x>=0. ?Is it > possible to add constraints and use the same implementation > > Thanks, > Jonathan > I don't think this can be done in full generality. It might be possible to solve for the constraints first and then project the quadratic form to the feasible space. If you're lucky and the feasible space is a convex "corner", you can still use pqpnonneg. The simple "corner-like" shape of the feasible space is where the algorithm gets its good features from. A generalization to arbitrary combination of lower and upper bounds is possible, but hasn't been implemented yet. I'm planning to address this in the future. hth -- RNDr. Jaroslav Hajek computing expert & GNU Octave developer Aeronautical Research and Test Institute (VZLU) Prague, Czech Republic url: www.highegg.matfyz.cz From lindnerben at gmx.net Mon Nov 2 06:50:12 2009 From: lindnerben at gmx.net (Benjamin Lindner) Date: Mon, 02 Nov 2009 13:50:12 +0100 Subject: package installation Octave Message-ID: <20091102125012.161640@gmx.net> > On Sat, Oct 31, 2009 at 9:01 PM, Benjamin Lindner > wrote: > > Erik Brezet wrote: > >> > >> On Thu, Oct 15, 2009 at 5:40 PM, Benjamin Lindner > >> wrote: > >>> > >>> Erik Brezet wrote: > >>>> > >>>> Hi, > >>>> I can't seem to get any packages (tar.gz) installed on Octave in > >>>> windows. Packages like: RODBC, xlsreadwrite, ga .. > >>>> Octave gives: error COPYING file missing or other errors. > >>>> I've got the mingw32 installer for windows. > >>>> > >>>> Help? > >>> > >>> Well, not all available forge packages can be successfully built for > the > >>> mingw32 build. > >>> > >>> Please provide some more information. Which version of octave do you > have > >>> installed? Which version of the package do you try to install? Can you > >>> post > >>> the commands you executed and octave's error response? > >>> > >>> With the 3.2.2 mingw32 installer I can for example install ga-0.9.7 > >>> without > >>> errors. > >>> > >>> benjamin > >>> > >>> > >>> > >> > >> Hi Benjamin and Anandaram, > >> Thanks for your responses. > >> I've got Octave 3.2.2. I still don't get the packages to work. > >> For example, I want to install SPCtools: > >> > >> ftp://svr-ftp.eng.cam.ac.uk/pub/comp.speech/tools/spctools > >> > >> and I unzip the files in the package directory > >> "octave\share\octave\packeges\SPCtools" > >> ,but when I run Octave, it doesn't recognize any of the commands.. > >> > > > > Well, these tools are not an octave-forge-package, so they don't follow > > octave's packaging rules, and they must not be installed in octave's > > directory tree (well, it's not forbidden, but I'll encourage you not to > do > > so). > > > > If you want to use tools like the above, then you must unzip them > somewhere > > on your local machine, e.g. into a subdirectory in your home directory, > and > > then tell octave where to find it by adding all paths with scripts to > > octave's searchpath using the command addpath(). > > If you want to add a directory and all its aubdirectories, you might > also > > take a look at genpath(). > > > > hope this helps > > > > benjamin > > > > Hi Benjamin, > I used addpath and genpath to add all the directories of the SPC package. > When I type "path" they appear in the list, so that seems ok. > But how do I use the added .m functions now? When I type "help one of > the functions" Octave > doesn't recognize the function of the added directories.. > Please keep the discussion on the mailing-list. There seems to be a problem with case-sensitive file matching C:\temp> type foo.m function y = foo(x) C:\temp> type BAZ.M function y = baz(x) octave:> dir . .. BAZ.M foo.m octave:> which foo `foo' is a function from the file c:\temp\foo.m octave:> which BAZ octave:> glob("*.m") ans = { [1,1] = foo.m } octave:> glob("*.M") ans = { [1,1] = BAZ.M } ren BAZ.M BAZ.m octave:> dir . .. BAZ.m foo.m octave:> which baz octave:> which BAZ warning: function name `baz' does not agree with function file name `c:\temp\BAZ.m' `BAZ' is a function from the file c:\temp\BAZ.m Octave obviously treats file names case-sensitive which makes little sense on case-insensitive file systems. Hmm, this needs some investigation. benjamin -- GRATIS f?r alle GMX-Mitglieder: Die maxdome Movie-FLAT! Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01 From joseph.wakeling at webdrake.net Mon Nov 2 07:21:02 2009 From: joseph.wakeling at webdrake.net (Joseph Wakeling) Date: Mon, 02 Nov 2009 14:21:02 +0100 Subject: Efficient code for operating on pairwise vector diffs Message-ID: <4AEEDCBE.80901@webdrake.net> Hello all, Suppose that I have a set of N d-dimensional vectors, which I guess could be represented as either a matrix, X = [X1 X2 ... XN] or a cell: X = {X1 X2 ... XN} I'm trying to implement a function which consists of the following steps: (i) calculate the pairwise vector differences Dij = Xi - Xj (ii) perform some function on each of the vector differences, Fij = F(Dij) (iii) Construct the averages aveFi = mean of Fij calculated over the subscript j. My guess is that the best way to do this is to represent the vector differences in a NxN cell whose (i,j)'th element is the d-dimensional vector X(:,i)-X(:,j). Then I can call cellfun to apply the function F and finally the averages can be achieved by some use of mean(cell2mat()) or whatever. Now, the challenge is how to generate the vector differences efficiently. I can do, for i=1:N for j=1:N D{i,j} = X(:,i) - X(:,j) end end ... but that seems very inefficient, which is exactly what I'm trying to avoid(*). Can anyone advise an efficient way to carry out the above? Thanks & best wishes, -- Joe (*) Motivation for this whole query: I'm editing some MATLAB code by a colleague which we're going to release some time soon(**). His code works but is not very efficiently written from a MATLAB/Octave point of view, and so he's used C extensions for some parts. I think that the code can be made efficient without needing to use C, which would be very nice as it would allow it to be run in Octave as well as MATLAB. But my implementation is foundering on implementing the above code without costly for loops ... (**) In answer to 'When?' and 'Why can't we see the actual code now?': it comes down to academic confidentiality. If it was just my work I would happily share, but I can't presume on the part of my co-workers. >From a publication point of view, we've done all the necessary work and could just chuck the existing code over the wall; but if I can make sure that the supporting information to our paper contains Octave-compatible code, I would like to. Hope you understand. From highegg at gmail.com Mon Nov 2 08:00:08 2009 From: highegg at gmail.com (Jaroslav Hajek) Date: Mon, 2 Nov 2009 15:00:08 +0100 Subject: Efficient code for operating on pairwise vector diffs In-Reply-To: <4AEEDCBE.80901@webdrake.net> References: <4AEEDCBE.80901@webdrake.net> Message-ID: <69d8d540911020600x17797edsd19eea7afdcdc17f@mail.gmail.com> On Mon, Nov 2, 2009 at 2:21 PM, Joseph Wakeling wrote: > Hello all, > > Suppose that I have a set of N d-dimensional vectors, which I guess > could be represented as either a matrix, > > ? X = [X1 X2 ... XN] > > or a cell: > > ? X = {X1 X2 ... XN} > > I'm trying to implement a function which consists of the following steps: > > ?(i) calculate the pairwise vector differences Dij = Xi - Xj > > ?(ii) perform some function on each of the vector differences, > ? ? ? Fij = F(Dij) > > ?(iii) Construct the averages aveFi = mean of Fij calculated over > ? ? ? ?the subscript j. > > My guess is that the best way to do this is to represent the vector > differences in a NxN cell whose (i,j)'th element is the d-dimensional > vector X(:,i)-X(:,j). ?Then I can call cellfun to apply the function F > and finally the averages can be achieved by some use of mean(cell2mat()) > or whatever. > > Now, the challenge is how to generate the vector differences > efficiently. ?I can do, > > for i=1:N > ? ?for j=1:N > ? ? ? ?D{i,j} = X(:,i) - X(:,j) > ? ?end > end > > ... but that seems very inefficient, which is exactly what I'm trying to > avoid(*). ?Can anyone advise an efficient way to carry out the above? > > Thanks & best wishes, > > ? ?-- Joe If X is a DxN matrix, you can get a dxNxN array of pairwise differences using, for instance using spread indexing D = X(:,:,ones (1, N)) - reshape (X, d, 1, N)(:,ones (1, N), :); or using bsxfun D = bsxfun (@minus, X, reshape (X, d, 1, N)); the relative efficiency will depend on your version of Octave (bsxfun wins if you use the bleeding edge sources). Then, D = squeeze (nu2mcell (D, 1)); converts this to an NxN cell array of dx1 vectors. Note that unless your mapper function is fast enough (built-in?), this isn't going to win you much, because your function will still be called NxN times. If F is a fixed mapping and relatively simple, there may be a better way to do the trick in a few calls. See also http://octave.sourceforge.net/doc/f/pdist.html > (*) Motivation for this whole query: I'm editing some MATLAB code by a > colleague which we're going to release some time soon(**). ?His code > works but is not very efficiently written from a MATLAB/Octave point of > view, and so he's used C extensions for some parts. > > I think that the code can be made efficient without needing to use C, > which would be very nice as it would allow it to be run in Octave as > well as MATLAB. ?But my implementation is foundering on implementing > the above code without costly for loops ... > See the above comment. Note that Octave also has a C++ extension as an option. > (**) In answer to 'When?' and 'Why can't we see the actual code now?': > it comes down to academic confidentiality. ?If it was just my work I > would happily share, but I can't presume on the part of my co-workers. Code is always better if you want good answers. You can only extract a small (but working!) skeleton. Unless your co-workers are idiots, they won't bark at you for showing a few lines, especially if you're trying to improve your common work. hth -- RNDr. Jaroslav Hajek computing expert & GNU Octave developer Aeronautical Research and Test Institute (VZLU) Prague, Czech Republic url: www.highegg.matfyz.cz From tmkdudek at gmail.com Sun Nov 1 06:11:32 2009 From: tmkdudek at gmail.com (tmkd) Date: Sun, 1 Nov 2009 04:11:32 -0800 (PST) Subject: How to add octjpeglib In-Reply-To: <26146221.post@talk.nabble.com> References: <26146221.post@talk.nabble.com> Message-ID: <26148885.post@talk.nabble.com> I am using slackware 13. i downloaded octave from slackbuilds.org, it is octace-3.0.1. -- View this message in context: http://old.nabble.com/How-to-add-octjpeglib-tp26146221p26148885.html Sent from the Octave - General mailing list archive at Nabble.com. From patrick at mail.uni-paderborn.de Mon Nov 2 06:23:01 2009 From: patrick at mail.uni-paderborn.de (Patrick Foster) Date: Mon, 02 Nov 2009 13:23:01 +0100 Subject: Java-enabled Computer Algebra System for Use in Value Stream Mapping Message-ID: <20091102132301.11507k1pzyi6im91@webmail.uni-paderborn.de> Dear Sir or Madam, we are currently engaged in a project for the department of Computer Integrated Manufacturing, Information Systems College, University of Paderborn. Our task is to identify the most suitable CAS for integration in the Value Stream Mapping-System developed by our department. The only prerequisite is the possibility to use the CAS in a java environment to its full extent. This might be achieved by a bridge, a java kernel or similar. At this point we would like to ask you, which outstanding features you could offer us in the context of Value Stream Mapping within a java environment and which benefits your product provides us in contrast to your competitors. A feature-wishlist of ours would contain the following: -full java embedding -possibility to pass on 3D-graphs as interactive java objects -derive distribution functions from datasets -support complex mathematical calculations -use a standardized set of syntax -short startup time while being loaded in our java object Thank you very much for your efforts in advance. Best Regards Patrick Gareth Foster CIM, Winfo, University of Paderborn From joseph.wakeling at webdrake.net Mon Nov 2 08:54:21 2009 From: joseph.wakeling at webdrake.net (Joseph Wakeling) Date: Mon, 02 Nov 2009 15:54:21 +0100 Subject: Efficient code for operating on pairwise vector diffs In-Reply-To: <69d8d540911020600x17797edsd19eea7afdcdc17f@mail.gmail.com> References: <4AEEDCBE.80901@webdrake.net> <69d8d540911020600x17797edsd19eea7afdcdc17f@mail.gmail.com> Message-ID: <4AEEF29D.10207@webdrake.net> Jaroslav Hajek wrote: > If X is a DxN matrix, you can get a dxNxN array of pairwise > differences using, for instance using spread indexing > > D = X(:,:,ones (1, N)) - reshape (X, d, 1, N)(:,ones (1, N), :); > > or using bsxfun > > D = bsxfun (@minus, X, reshape (X, d, 1, N)); > > the relative efficiency will depend on your version of Octave (bsxfun > wins if you use the bleeding edge sources). That's brilliant -- thank you very much! Seems to provide exactly what I need. I will play and see where this goes. > converts this to an NxN cell array of dx1 vectors. Note that unless > your mapper function is fast enough (built-in?), this isn't going to > win you much, because your function will still be called NxN times. I'm hoping it will win a fair amount relative to the code I inherited -- NxN is an inevitability, but I think the actual implementation was surely less efficient than that ... > If F is a fixed mapping and relatively simple, there may be a better > way to do the trick in a few calls. See also > http://octave.sourceforge.net/doc/f/pdist.html The code has to be both MATLAB- and Octave-compatible, so this is probably out unless we copy from octave-forge. Probably simpler to stick with functions that are built-in with both programs. > See the above comment. Note that Octave also has a C++ extension as an option. Sure -- but it's preferable to remove techy problems like compiling extensions from users' lives. :-) > Code is always better if you want good answers. You can only extract a > small (but working!) skeleton. Unless your co-workers are idiots, they > won't bark at you for showing a few lines, especially if you're trying > to improve your common work. _I_ know that, but some people (and some fields:-) are paranoid about such things. I'll have a word with people and see what we can do. I'm trying to persuade them to accept a preprint release of the article; if that goes ahead maybe we could at the same time present the code for review to the Octave user community, and we could add a little note of acknowledgement in the final published paper. I would certainly like to see the code end up in octave-forge at some point. Thanks again for your detailed and helpful remarks, -- Joe From gkousiou at telecom.ntua.gr Mon Nov 2 11:29:21 2009 From: gkousiou at telecom.ntua.gr (George Kousiouris) Date: Mon, 02 Nov 2009 19:29:21 +0200 Subject: Passing an array from java to octave Message-ID: <4AEF16F1.7010900@telecom.ntua.gr> Hi all, I want to pass a Java array to Octave, so that I can process the data inside. Does anyone have an idea how this can be done? I have tried a java to octave bridge (javaoctave-0.4.0.jar) however this seems to be only for executing Octave commands inside a Java program and not actually passing data from Java to Octave... Best regards, George From Thomas.Treichl at gmx.net Mon Nov 2 13:26:37 2009 From: Thomas.Treichl at gmx.net (Thomas Treichl) Date: Mon, 02 Nov 2009 20:26:37 +0100 Subject: octave and delay ode's In-Reply-To: <2ED5382C-8DFA-45C1-BD40-00DD0EE986FC@gmail.com> References: <39CEC9CB-7B58-4173-8E6D-9C7BF6CBE6B4@gmail.com> <59CCC399-AC46-45F9-AD93-A0643AFC0EA8@gmail.com> <55A3A9EF-0C56-4091-A6AE-8A126012CD71@gmail.com> <2ED5382C-8DFA-45C1-BD40-00DD0EE986FC@gmail.com> Message-ID: <4AEF326D.1070406@gmx.net> Carlo de Falco schrieb: > On 1 Nov 2009, at 20:08, franco basaglia wrote: >> Yes,sure. >> To be more precise I have a system like this: >> d y1(t)/ dt = -y1(t) >> d y2(t)/ dt = -y2(t) + y1(t-5) >> d y3(t)/dt = -y3(t) + y2(t-10)*y1(t-10) >> >> that I try to solve in this way: >> function f = fun (t, y, yd) >> f(1) =-y(1) >> f(2) =-y(2) + yd(1) >> f(3) =-y(3) + yd(2)*yd(1) >> endfunction >> t = [0:.5:20] >> res = ode45d (@fun, t, [1;1;1], [5;10], ones (3,10)) > > I think this should rather be something like: > > function f = fun (t, y, yd) > f(1) =-y(1); %% y1' = -y1(t) > f(2) =-y(2) + yd(1,1); %% y2' = -y2(t) + y1(t-lags(1)) > f(3) =-y(3) + yd(2,2)*yd(1,2); %% y3' = -y3(t) + > y2(t-lags(2))*y1(t-lags(2)) > endfunction > > T = [0,20] %% only initlial > and final time > %% need to be > provided > > res = ode45d (@fun, t, [1;1;1], [5, 10], ones (3,2)); %% number of > columns in HIST should > %% be the same as > the number of columns > %% in LAGS > I beleive Thomas Treichl, the author of odepkg is listening on the list > so maybe he can confirm whether this is correct? Because there is an "ode" in the subject of the email, yes, but I also must say that I currently don't have the time to dig into this problem and can only provide a short answer: if the above equations form the DDE problem then Carlo's implementation does make more sense to me. Best regards Thomas From thomas.weber.mail at gmail.com Mon Nov 2 14:56:06 2009 From: thomas.weber.mail at gmail.com (Thomas Weber) Date: Mon, 2 Nov 2009 21:56:06 +0100 Subject: Java-enabled Computer Algebra System for Use in Value Stream Mapping In-Reply-To: <20091102132301.11507k1pzyi6im91@webmail.uni-paderborn.de> References: <20091102132301.11507k1pzyi6im91@webmail.uni-paderborn.de> Message-ID: <20091102205606.GA7509@atlan> On Mon, Nov 02, 2009 at 01:23:01PM +0100, Patrick Foster wrote: > Dear Sir or Madam, > > we are currently engaged in a project for the department of Computer > Integrated Manufacturing, Information Systems College, University of > Paderborn. > > Our task is to identify the most suitable CAS for integration in the > Value Stream Mapping-System developed by our department. > > The only prerequisite is the possibility to use the CAS in a java > environment to its full extent. This might be achieved by a bridge, a > java kernel or similar. > > At this point we would like to ask you, which outstanding features you > could offer us in the context of Value Stream Mapping within a java > environment and which benefits your product provides us in contrast to > your competitors. > > A feature-wishlist of ours would contain the following: > -full java embedding > -possibility to pass on 3D-graphs as interactive java objects > -derive distribution functions from datasets > -support complex mathematical calculations > -use a standardized set of syntax > -short startup time while being loaded in our java object > > Thank you very much for your efforts in advance. I think there's a misconfiguration in the mailing list manager. It seems to forward sales at octave.org to the help list. Thomas From hwhoyer at web.de Mon Nov 2 13:58:22 2009 From: hwhoyer at web.de (hoyermann) Date: Mon, 2 Nov 2009 11:58:22 -0800 (PST) Subject: Increase max number of iterations Message-ID: <26157797.post@talk.nabble.com> Hello Friends, i'm doing a simulation in octave which calculates in many iterations. unfortunately Octave stops all 4 houres and i hav to restart the calculation manually. It continues as it should, but i would prefer if i could run it through the night without stops. The error massage is "number of maximal iterations exeeded (at windows)" or "warning broken pipe (at Mac)". Is there a way to increase the maximum number of iterations? Any help is welcome, i would be glad. Cheers Hoyermann -- View this message in context: http://old.nabble.com/Increase-max-number-of-iterations-tp26157797p26157797.html Sent from the Octave - General mailing list archive at Nabble.com. From psdc1978 at gmail.com Mon Nov 2 18:43:14 2009 From: psdc1978 at gmail.com (xeon) Date: Mon, 2 Nov 2009 16:43:14 -0800 (PST) Subject: create matrix with all possible combinations Message-ID: <26159876.post@talk.nabble.com> Hi, I would like to create a matrix with 8 columns with all possible combinations with the values 0 and 1 in Octave. For example, [0,0,0,0,0,0,0,0;1,0,0,0,0,0,0,0;0,1,0,0,0,0,0,0;...;1,1,1,1,1,1,1,1]; How can I do that? thanks, -- View this message in context: http://old.nabble.com/create-matrix-with-all-possible-combinations-tp26159876p26159876.html Sent from the Octave - General mailing list archive at Nabble.com. From joshua.stults at gmail.com Mon Nov 2 20:04:15 2009 From: joshua.stults at gmail.com (Joshua Stults) Date: Mon, 2 Nov 2009 21:04:15 -0500 Subject: create matrix with all possible combinations In-Reply-To: <26159876.post@talk.nabble.com> References: <26159876.post@talk.nabble.com> Message-ID: On Mon, Nov 2, 2009 at 7:43 PM, xeon wrote: > > Hi, > > I would like to create a matrix with 8 columns with all possible > combinations with the values 0 and 1 in Octave. > > For example, > [0,0,0,0,0,0,0,0;1,0,0,0,0,0,0,0;0,1,0,0,0,0,0,0;...;1,1,1,1,1,1,1,1]; > > How can I do that? Perhaps nchoosek() will give you what you want: n = [ones(8,1); zeros(8,1)]; A = nchoosek(n, 8); The size of a matrix created this way can grow very large very quickly; calling nchoosek() with a scalar will give you the number of combinations: nchoosek(16, 8) ans = 12870 -- Joshua Stults Website: http://j-stults.blogspot.com From bpabbott at mac.com Mon Nov 2 20:05:09 2009 From: bpabbott at mac.com (Ben Abbott) Date: Mon, 02 Nov 2009 21:05:09 -0500 Subject: create matrix with all possible combinations In-Reply-To: <26159876.post@talk.nabble.com> References: <26159876.post@talk.nabble.com> Message-ID: <2EBB3DE4-14FB-4462-AE36-C3AA545C5746@mac.com> On Nov 2, 2009, at 7:43 PM, xeon wrote: > Hi, > > I would like to create a matrix with 8 columns with all possible > combinations with the values 0 and 1 in Octave. > > For example, > [0,0,0,0,0,0,0,0;1,0,0,0,0,0,0,0;0,1,0,0,0,0,0,0;...;1,1,1,1,1,1,1,1]; > > How can I do that? > > thanks, The may be a better way, but you can accomplish what you want by ... n = 8; a = dec2bin ([0:2^n-1], n); b = num2cell (a(:), 2); c = cellfun (@(x) eval(x), b); d = reshape (c, [2^n, n]) Ben From tshores1 at math.unl.edu Mon Nov 2 20:30:38 2009 From: tshores1 at math.unl.edu (Thomas Shores) Date: Mon, 02 Nov 2009 20:30:38 -0600 Subject: create matrix with all possible combinations In-Reply-To: <26159876.post@talk.nabble.com> References: <26159876.post@talk.nabble.com> Message-ID: <4AEF95CE.7080301@math.unl.edu> There are probably faster, simpler ways, but here's one: n = 8; x = (0:2^n-1)'; M = zeros(2^n,n); for k = 1:n M(:,k) = mod(x,2); x = (x-M(:,k))/2; end; On 11/02/2009 06:43 PM, xeon wrote: > Hi, > > I would like to create a matrix with 8 columns with all possible > combinations with the values 0 and 1 in Octave. > > For example, > [0,0,0,0,0,0,0,0;1,0,0,0,0,0,0,0;0,1,0,0,0,0,0,0;...;1,1,1,1,1,1,1,1]; > > How can I do that? > > thanks, > > From highegg at gmail.com Tue Nov 3 06:46:08 2009 From: highegg at gmail.com (Jaroslav Hajek) Date: Tue, 3 Nov 2009 13:46:08 +0100 Subject: crashes when exiting octave and loading swig-wrapped code In-Reply-To: <19170.24794.771836.23727@segfault.lan> References: <1256107637.2953.67.camel@no> <19170.24794.771836.23727@segfault.lan> Message-ID: <69d8d540911030446t6493a000m263448ccb4c0cb81@mail.gmail.com> On Sat, Oct 24, 2009 at 3:05 AM, John W. Eaton wrote: > On 21-Oct-2009, Soeren Sonnenburg wrote: > > | I am seeing crashes when exiting octave when I use swig-wrapped code but > | only when loading multiple modules (with potentially overlapping > | variables/functions). > | > | Well it seems to be some invalid delete/free occurring only when closing > | octave (gdb & valgrind outputs follow): > | > | (this happens when just *loading* multiple modules of the shogun toolbox > | (http://www.shogun-toolbox.org)): > | > Yes, it's a known problem that you can't load a .oct file that creates > a variable (or is it just a user-defined class?) then clear the .oct > file and expect to continue to use the variables that were created. > I think you can avoid the problem by locking the .oct file that > creates the object. > > We've had some discussions about making Octave delay unloading the > file until all objects created by it are deleted. ?That might be > better, but so far no one has done the work. > > jwe I inspected the code a bit, and the basic obstacle I see is the octave_shlib::close method, which runs a hook function for each registered function, and then forces dlclose() (or equivalent), even though there may still be references to the shlib object. John, can you give me a clue why this is so? I would imagine a more straightforward implementation of octave_shlib, being merely a reference-counted pointer to the library handle (or zero). Then, dlclose would simply be called when the reference count drops to zero - similar to array and all the other reference-counted stuff. If this were true, classes defined via .oct files could simply attach a copy of the originating octave_shlib into the class, ensuring that the library won't be unloaded. This could result in multiple loads of the same file into memory, if it was modified after loading, but I didn't find any information that this is not possible. Unless I'm missing something important, I'd volunteer for this job. Any comments? -- RNDr. Jaroslav Hajek computing expert & GNU Octave developer Aeronautical Research and Test Institute (VZLU) Prague, Czech Republic url: www.highegg.matfyz.cz From highegg at gmail.com Tue Nov 3 06:53:44 2009 From: highegg at gmail.com (Jaroslav Hajek) Date: Tue, 3 Nov 2009 13:53:44 +0100 Subject: create matrix with all possible combinations In-Reply-To: <26159876.post@talk.nabble.com> References: <26159876.post@talk.nabble.com> Message-ID: <69d8d540911030453r5962a186yf068d2fb2b328f21@mail.gmail.com> On Tue, Nov 3, 2009 at 1:43 AM, xeon wrote: > > Hi, > > I would like to create a matrix with 8 columns with all possible > combinations with the values 0 and 1 in Octave. > > For example, > [0,0,0,0,0,0,0,0;1,0,0,0,0,0,0,0;0,1,0,0,0,0,0,0;...;1,1,1,1,1,1,1,1]; > > How can I do that? > > thanks, > With 3.3.50+, it's easy: reshape (bitunpack (uint8(0:255)), 8, []).' -- RNDr. Jaroslav Hajek computing expert & GNU Octave developer Aeronautical Research and Test Institute (VZLU) Prague, Czech Republic url: www.highegg.matfyz.cz From frenk.calza at gmail.com Tue Nov 3 07:58:45 2009 From: frenk.calza at gmail.com (franco basaglia) Date: Tue, 3 Nov 2009 14:58:45 +0100 Subject: octave and delay ode's In-Reply-To: <2ED5382C-8DFA-45C1-BD40-00DD0EE986FC@gmail.com> References: <39CEC9CB-7B58-4173-8E6D-9C7BF6CBE6B4@gmail.com> <59CCC399-AC46-45F9-AD93-A0643AFC0EA8@gmail.com> <55A3A9EF-0C56-4091-A6AE-8A126012CD71@gmail.com> <2ED5382C-8DFA-45C1-BD40-00DD0EE986FC@gmail.com> Message-ID: What exactly does "delta t" mean in your file? what do you mean by "time units"? >From your pdf file and your script I get the feeling that you are confusing the time parameter in the continuos problem and the number of time-steps in the discretized system... Yes.You're right. I have confused "delta t" (time parameter in the contiunuos problem) and time-steps in the discretizet system, that are my "time units". These time units are 5 and 10 in my DISCRETE function "delay". Are you meaning this or that I have to modify my system in a discrete time system? I'm confuse about this question because, for example, Stella runtime equation is something like this: .... L(t) = L(t-dt)+(-LtoM-LtoF)?dt T(t) = T(t-dt)+(DELAY(S?(1-GP),10)?(1-T))?dt and Euler and 4th-order Runge-Kutta methods are used with time step *dt * set to 0.5 year Anyway, I correct my script following your suggestion, but it doesn't work. And the different values from Stella concern, particularly, the 2 state variables with delay. I have also this warning but I don't think that the problem is here: warning: Option "RelTol" not set, new value 0.000001 is used warning: Option "AbsTol" not set, new value 0.000001 is used warning: Option "InitialStep" not set, new value 30.000000 is used warning: Option "MaxStep" not set, new value 30.000000 is used I attach my new script. thanks best regrads f.b. Il giorno 02 novembre 2009 00.00, Carlo de Falco ha scritto: > > On 1 Nov 2009, at 20:08, franco basaglia wrote: > > >> I must be missing something as in your file I see no time derivatives... >> sorry for my oversight. I attach again pdf with right system. >> > > What exactly does "delta t" mean in your file? > > > function f = fun (t, y, yd) >> f(1) =-y(1) + yd(2); >> f(2) =-y(2) ; >> endfunction >> >> ode23d (@fun, [0 5], [1;1], .1, [1;1]) >> >> notice that in the example above only one equation includes a delay: >> is this what you mean by system of ODEs and DDEs? >> >> Yes,sure. >> To be more precise I have a system like this: >> d y1(t)/ dt = -y1(t) >> d y2(t)/ dt = -y2(t) + y1(t-5) >> d y3(t)/dt = -y3(t) + y2(t-10)*y1(t-10) >> >> that I try to solve in this way: >> function f = fun (t, y, yd) >> f(1) =-y(1) >> f(2) =-y(2) + yd(1) >> f(3) =-y(3) + yd(2)*yd(1) >> endfunction >> t = [0:.5:20] >> res = ode45d (@fun, t, [1;1;1], [5;10], ones (3,10)) >> > > I think this should rather be something like: > > > function f = fun (t, y, yd) > f(1) =-y(1); %% y1' = -y1(t) > f(2) =-y(2) + yd(1,1); %% y2' = -y2(t) + y1(t-lags(1)) > f(3) =-y(3) + yd(2,2)*yd(1,2); %% y3' = -y3(t) + > y2(t-lags(2))*y1(t-lags(2)) > endfunction > > T = [0,20] %% only initlial and > final time > %% need to be provided > > res = ode45d (@fun, t, [1;1;1], [5, 10], ones (3,2)); %% number of columns > in HIST should > %% be the same as the > number of columns > %% in LAGS > > I beleive Thomas Treichl, the author of odepkg is listening on the list so > maybe he can confirm whether this is correct? > > > It's run. But I don't think this is the right way.I don't know if with >> this notation it applies a delay of 5 time units to f(2) and of 10 time >> units to f(3). >> > what do you mean by "time units"? > > > Note that in f(3) yd(1) comes again but with a different delay. >> Infact for my script, that I attach here, is the same. It's runs but with >> different results compare to Stella. >> >> Any Idea? >> > > From your pdf file and your script I get the feeling that you are confusing > the > time parameter in the continuos problem and the number of time-steps in the > discretized > system... > > > thanks a lot >> >> f.t. >> > c. > > P.S. please keep the list in CC as someone else may want to help with your > questions > or benefit from the answers. > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091103/a3d305b9/attachment-0001.html -------------- next part -------------- A non-text attachment was scrubbed... Name: ode45delay.m Type: text/x-objcsrc Size: 4203 bytes Desc: not available Url : https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091103/a3d305b9/attachment-0001.bin From pleser at sup-logistik.de Tue Nov 3 04:45:41 2009 From: pleser at sup-logistik.de (Philipp Leser) Date: Tue, 3 Nov 2009 11:45:41 +0100 Subject: error in a Matlab toolbox. Problem with" cellfun". Message-ID: <0EA9662A402E6A4B88078E93D7F20D7B78451C@x346-001w2k3.sup2000.sup-logistik.de> Hey, I try to play around with the Matlog (http://www.ise.ncsu.edu/kay/matlog/)toolbox and run it on Octave. It's quite interesting since I can run Matlog on MATLAB at the university and compare it to Octave. On Matlab the Matlog toolbox runs quite smooth, but on Octave I get some error messages. To me it is an educating experience on the few incompatibilities of the two tools. Here is one error I really have trouble understanding. Would be happy about any hints or help. I run the function "vrpsavings". The function itself calls a function called LocTC in an "try and catch" construction: "try % Use for error checking and to store input arguments locTC([],C,cap,twin,locfeas); catch errstr = lasterr; idx = find(double(errstr) == 10); error(errstr(idx(1)+1:end)) end "; where C is a NxN matrix, cap a cell object and twin locfeas are a [] double. In the line " locTC([],C,cap,twin,locfeas)" I get the error message. "error: cellfun: second argument must be a cell array error: evaluating argument list element number 1 error: evaluating argument list element number 1 error: called from: error: C:\Octave\3.2.2_gcc-4.3.0\bin\matlog\locTC.m at line 180, column 1 error: C:\Octave\3.2.2_gcc-4.3.0\bin\matlog\vrpsavings_test.m at line 54, column 1 " In "locTC" line 180 to 186 " if isfirstcall & ~isempty(loc) & (~(isreal(loc) | iscell(loc)) | ... (~iscell(loc) & (min(size(loc)) ~= 1 | ... any(loc(:) < 1 | loc(:) > n))) | ... (iscell(loc) & (any(cellfun('prodofsize',loc) ~= ... cellfun('length',loc)) | any([loc{:}] < 1 | [loc{:}] > n)))) error('"loc" not a valid loc seq.') end " When I run the "vrpsavings" file in the Matlab debugger, the "locTC([],C,cap,twin,locfeas)" returns "inf", but no error. Why? I don't get it. Thanks in advance cheers -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091103/d397987e/attachment.html From highegg at gmail.com Tue Nov 3 08:18:16 2009 From: highegg at gmail.com (Jaroslav Hajek) Date: Tue, 3 Nov 2009 15:18:16 +0100 Subject: error in a Matlab toolbox. Problem with" cellfun". In-Reply-To: <0EA9662A402E6A4B88078E93D7F20D7B78451C@x346-001w2k3.sup2000.sup-logistik.de> References: <0EA9662A402E6A4B88078E93D7F20D7B78451C@x346-001w2k3.sup2000.sup-logistik.de> Message-ID: <69d8d540911030618je409590m47c2adac9b6a8f55@mail.gmail.com> On Tue, Nov 3, 2009 at 11:45 AM, Philipp Leser wrote: > Hey, > > I try to play around with the Matlog > ?(http://www.ise.ncsu.edu/kay/matlog/)toolbox and run it on Octave. It?s > quite interesting since I can run Matlog on MATLAB at the university and > compare it to Octave. On Matlab the Matlog toolbox runs quite smooth, but on > Octave I get some error messages. To me it is an educating experience on the > few incompatibilities of the two tools. > > > > ?Here is one error I really have trouble understanding. Would be happy about > any hints or help. > > > > I run the function ?vrpsavings?. ?The function itself calls a function > called LocTC in an ?try and catch? construction: > > > > > > ?try? % Use for error checking and to store input arguments > > ?? locTC([],C,cap,twin,locfeas); > > catch > > ?? errstr = lasterr; > > ?? idx = find(double(errstr) == 10); > > ?? error(errstr(idx(1)+1:end)) > > end ?; > > > > where? C is a NxN matrix, cap a cell object and twin locfeas are a [] > double. > > > > > > In? the line ? locTC([],C,cap,twin,locfeas)? I get the error message. > > > > ?error: cellfun: second argument must be a cell array > > error: evaluating argument list element number 1 > > error: evaluating argument list element number 1 > > error: called from: > > error:?? C:\Octave\3.2.2_gcc-4.3.0\bin\matlog\locTC.m at line 180, column 1 > > error:?? C:\Octave\3.2.2_gcc-4.3.0\bin\matlog\vrpsavings_test.m at line 54, > column 1 > > ? > > > > In ?locTC? line 180 to 186 > > > > > > > > ? > > if isfirstcall & ~isempty(loc) & (~(isreal(loc) | iscell(loc)) | ... > > ????? (~iscell(loc) & (min(size(loc)) ~= 1 | ... > > ????? any(loc(:) < 1 | loc(:) > n))) | ... > > ????? (iscell(loc) & (any(cellfun('prodofsize',loc) ~= ... > > ????? cellfun('length',loc)) | any([loc{:}] < 1 | [loc{:}] > n)))) > > ?? error('"loc" not a valid loc seq.') > > end > > ? > > > > > > When I run the ?vrpsavings? file ?in the Matlab debugger, the > ?locTC([],C,cap,twin,locfeas)? returns ?inf?, but no error. > > Why? I don?t get it. > > In Matlab & and | operators use short-circuit evaluation if used in if-clause conditions (but not otherwise). This is a design flaw in Matlab that Octave intentionally does not reproduce. && and || should be used instead (these work in Matlab as well). see http://www.gnu.org/software/octave/FAQ.html#MATLAB-compatibility -- RNDr. Jaroslav Hajek computing expert & GNU Octave developer Aeronautical Research and Test Institute (VZLU) Prague, Czech Republic url: www.highegg.matfyz.cz From individ at acc.umu.se Tue Nov 3 08:20:37 2009 From: individ at acc.umu.se (David Grundberg) Date: Tue, 03 Nov 2009 15:20:37 +0100 Subject: error in a Matlab toolbox. Problem with" cellfun". In-Reply-To: <0EA9662A402E6A4B88078E93D7F20D7B78451C@x346-001w2k3.sup2000.sup-logistik.de> References: <0EA9662A402E6A4B88078E93D7F20D7B78451C@x346-001w2k3.sup2000.sup-logistik.de> Message-ID: <4AF03C35.1080709@acc.umu.se> Philipp Leser wrote: > > Hey, > > I try to play around with the Matlog > (http://www.ise.ncsu.edu/kay/matlog/)toolbox and run it on Octave. > It?s quite interesting since I can run Matlog on MATLAB at the > university and compare it to Octave. On Matlab the Matlog toolbox runs > quite smooth, but on Octave I get some error messages. To me it is an > educating experience on the few incompatibilities of the two tools. > > Here is one error I really have trouble understanding. Would be happy > about any hints or help. > > I run the function ?vrpsavings?. The function itself calls a function > called LocTC in an ?try and catch? construction: > > ?try % Use for error checking and to store input arguments > > locTC([],C,cap,twin,locfeas); > > catch > > errstr = lasterr; > > idx = find(double(errstr) == 10); > > error(errstr(idx(1)+1:end)) > > end ?; > > where C is a NxN matrix, cap a cell object and twin locfeas are a [] > double. > > In the line ? locTC([],C,cap,twin,locfeas)? I get the error message. > > ?error: cellfun: second argument must be a cell array > > error: evaluating argument list element number 1 > > error: evaluating argument list element number 1 > > error: called from: > > error: C:\Octave\3.2.2_gcc-4.3.0\bin\matlog\locTC.m at line 180, column 1 > > error: C:\Octave\3.2.2_gcc-4.3.0\bin\matlog\vrpsavings_test.m at line > 54, column 1 > > ? > > In ?locTC? line 180 to 186 > > ? > > if isfirstcall & ~isempty(loc) & (~(isreal(loc) | iscell(loc)) | ... > > (~iscell(loc) & (min(size(loc)) ~= 1 | ... > > any(loc(:) < 1 | loc(:) > n))) | ... > > (iscell(loc) & (any(cellfun('prodofsize',loc) ~= ... > > cellfun('length',loc)) | any([loc{:}] < 1 | [loc{:}] > n)))) > > error('"loc" not a valid loc seq.') > > end > > ? > > When I run the ?vrpsavings? file in the Matlab debugger, the > ?locTC([],C,cap,twin,locfeas)? returns ?inf?, but no error. > > Why? I don?t get it. > > Thanks in advance > > cheers > > ------------------------------------------------------------------------ > > _______________________________________________ > Help-octave mailing list > Help-octave at octave.org > https://www-old.cae.wisc.edu/mailman/listinfo/help-octave > Try replacing the & in the if-condition with &&, and | with ||. The && and || operators short-circuit, the & and | operators do not. Seems like that condition was written with short-circuit boolean logic in mind (rather than bitwise logic). hth David From sonne at debian.org Tue Nov 3 09:27:41 2009 From: sonne at debian.org (Soeren Sonnenburg) Date: Tue, 03 Nov 2009 16:27:41 +0100 Subject: crashes when exiting octave and loading swig-wrapped code In-Reply-To: <69d8d540911030446t6493a000m263448ccb4c0cb81@mail.gmail.com> References: <1256107637.2953.67.camel@no> <19170.24794.771836.23727@segfault.lan> <69d8d540911030446t6493a000m263448ccb4c0cb81@mail.gmail.com> Message-ID: <1257262061.24818.28.camel@no> On Tue, 2009-11-03 at 13:46 +0100, Jaroslav Hajek wrote: > On Sat, Oct 24, 2009 at 3:05 AM, John W. Eaton wrote: > > On 21-Oct-2009, Soeren Sonnenburg wrote: > > > > | I am seeing crashes when exiting octave when I use swig-wrapped code but > > | only when loading multiple modules (with potentially overlapping > > | variables/functions). > > | > > | Well it seems to be some invalid delete/free occurring only when closing > > | octave (gdb & valgrind outputs follow): > > | > > | (this happens when just *loading* multiple modules of the shogun toolbox > > | (http://www.shogun-toolbox.org)): > > | > > > Yes, it's a known problem that you can't load a .oct file that creates > > a variable (or is it just a user-defined class?) then clear the .oct > > file and expect to continue to use the variables that were created. > > I think you can avoid the problem by locking the .oct file that > > creates the object. > > > > We've had some discussions about making Octave delay unloading the > > file until all objects created by it are deleted. That might be > > better, but so far no one has done the work. > > > > jwe > > I inspected the code a bit, and the basic obstacle I see is the > octave_shlib::close method, which runs a hook function for each > registered function, and then forces dlclose() (or equivalent), even > though there may still be references to the shlib object. > > John, can you give me a clue why this is so? > > I would imagine a more straightforward implementation of octave_shlib, > being merely a reference-counted pointer to the library handle (or > zero). Then, dlclose would simply be called when the reference count > drops to zero - similar to array and all the other reference-counted > stuff. > > If this were true, classes defined via .oct files could simply attach > a copy of the originating octave_shlib into the class, ensuring that > the library won't be unloaded. > This could result in multiple loads of the same file into memory, if > it was modified after loading, but I didn't find any information that > this is not possible. > > Unless I'm missing something important, I'd volunteer for this job. > Any comments? From my outsiders viewpoint this sounds very reasonable (and is what I do here too in shogun). But it is John here who would need to decide... Soeren -- For the one fact about the future of which we can be certain is that it will be utterly fantastic. -- Arthur C. Clarke, 1962 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: This is a digitally signed message part Url : https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091103/eb8ea363/attachment-0001.bin From jwe at octave.org Tue Nov 3 09:39:09 2009 From: jwe at octave.org (John W. Eaton) Date: Tue, 3 Nov 2009 10:39:09 -0500 Subject: crashes when exiting octave and loading swig-wrapped code In-Reply-To: <69d8d540911030446t6493a000m263448ccb4c0cb81@mail.gmail.com> References: <1256107637.2953.67.camel@no> <19170.24794.771836.23727@segfault.lan> <69d8d540911030446t6493a000m263448ccb4c0cb81@mail.gmail.com> Message-ID: <19184.20125.61037.542477@segfault.lan> On 3-Nov-2009, Jaroslav Hajek wrote: | On Sat, Oct 24, 2009 at 3:05 AM, John W. Eaton wrote: | > On 21-Oct-2009, Soeren Sonnenburg wrote: | > | > | I am seeing crashes when exiting octave when I use swig-wrapped code but | > | only when loading multiple modules (with potentially overlapping | > | variables/functions). | > | | > | Well it seems to be some invalid delete/free occurring only when closing | > | octave (gdb & valgrind outputs follow): | > | | > | (this happens when just *loading* multiple modules of the shogun toolbox | > | (http://www.shogun-toolbox.org)): | > | | | > Yes, it's a known problem that you can't load a .oct file that creates | > a variable (or is it just a user-defined class?) then clear the .oct | > file and expect to continue to use the variables that were created. | > I think you can avoid the problem by locking the .oct file that | > creates the object. | > | > We've had some discussions about making Octave delay unloading the | > file until all objects created by it are deleted. ?That might be | > better, but so far no one has done the work. | > | > jwe | | I inspected the code a bit, and the basic obstacle I see is the | octave_shlib::close method, which runs a hook function for each | registered function, and then forces dlclose() (or equivalent), even | though there may still be references to the shlib object. | | John, can you give me a clue why this is so? Let's move this discussion to the maintainers list. jwe From gbarrick at walsh.edu Tue Nov 3 09:28:53 2009 From: gbarrick at walsh.edu (George Barrick) Date: Tue, 3 Nov 2009 10:28:53 -0500 Subject: create matrix with all possible combinations. Message-ID: <4B30AD0BED19E842AAE88DC39736493123FA64EB2D@mail3.walsh.edu> 2009.11.03.15:24:56 UT Hello xeon, You can create your array of zeros and ones using a vectorized call to the octave bitget() function. I've pasted a bit of code with comments below this paragraph. It is only six lines of code; but I like to extensively comment my octave scripts so that I can read through my thinking months (or more) later. I hope you like my code. George gbarrick at walsh.edu %% %% Start with a column consisting of the first %% 256 integers. %% %% Set bigN to be the length of the list. %% %% Inflate that list to a 256x8 array where %% the same integer is repeated eight times across %% each row. %% numlist = [ 0 : 255 ]' ; bigN = max( size( numlist ) ) ; intmtrx = numlist * ones( 1, 8 ) ; %% %% List the bit positions in descending order %% in the 1x8 array idx. %% %% Inflate the list of positions into a 256x8 %% array where the same position is repeated 256 %% times down each column. %% idx = 8 : -1 : 1 ; indexes = ones( bigN, 1 ) * idx ; %% %% Make a vectorized call to the bitget() %% function. It outputs a 256x8 array in which %% each integer from the first array is queried %% for a particular bit of its binary %% representation. %% bitmtrx = bitget( intmtrx, indexes ) ; From carlo.defalco at gmail.com Tue Nov 3 12:12:21 2009 From: carlo.defalco at gmail.com (Carlo de Falco) Date: Tue, 3 Nov 2009 19:12:21 +0100 Subject: octave and delay ode's In-Reply-To: References: <39CEC9CB-7B58-4173-8E6D-9C7BF6CBE6B4@gmail.com> <59CCC399-AC46-45F9-AD93-A0643AFC0EA8@gmail.com> <55A3A9EF-0C56-4091-A6AE-8A126012CD71@gmail.com> <2ED5382C-8DFA-45C1-BD40-00DD0EE986FC@gmail.com> Message-ID: <6FFDE12B-E2E9-4DEB-8003-4440F8398347@gmail.com> On 3 Nov 2009, at 14:58, franco basaglia wrote: > >> What exactly does "delta t" mean in your file? >> >> what do you mean by "time units"? >> >> >> From your pdf file and your script I get the feeling that you are >> confusing the >> time parameter in the continuos problem and the number of time- >> steps in the discretized >> system... > > Yes.You're right. I have confused "delta t" (time parameter in the > contiunuos problem) and time-steps in the discretizet system, that > are my "time units". > These time units are 5 and 10 in my DISCRETE function "delay". > Are you meaning this or that I have to modify my system in a > discrete time system? > I'm confuse about this question because, for example, Stella runtime > equation is something like this: > .... > L(t) = L(t?dt)+(?LtoM?LtoF)?dt > T(t) = T(t?dt)+(DELAY(S?(1?GP),10)?(1?T))?dt > and Euler and 4th-order Runge-Kutta methods are used > with time step dt set to 0.5 year the functions in odepkg use adaptive time-stepping so 1) you cannot know in advance what the value of dt will be and 2) dt it will vary during the simulation therefore specifying the delay in terms of dt makes no sense, if your time is measured in years your delay must also be expressed in years. In particular the following command in your script: res = ode45d (@fun, t, init, [5,10],ones(7,2)); means that at any given time t, "fun" will be called as fun (t, x, xd) where xd(:,1) is the value of the state vetor at the time point t-5 years and xd(:,2) is the value of the state vetor at the time point t-10 years is that what you want? > Anyway, I correct my script following your suggestion, but it > doesn't work. And the different values from Stella concern, > particularly, the 2 state variables with delay. > I have also this warning but I don't think that the problem is here: > warning: Option "RelTol" not set, new value 0.000001 is used > warning: Option "AbsTol" not set, new value 0.000001 is used > warning: Option "InitialStep" not set, new value 30.000000 is used > warning: Option "MaxStep" not set, new value 30.000000 is used These are just warnings, you can safely ignore them at this stage, or specify the missing options if you want to get rid of them... > I attach my new script. Your script runs without errors on my system, but I have no idea about what the results should look like so I cannot comment on their correctness. > thanks > > best regrads > f.b. c. From liuwensui at gmail.com Tue Nov 3 20:44:40 2009 From: liuwensui at gmail.com (Wensui Liu) Date: Tue, 3 Nov 2009 21:44:40 -0500 Subject: octave gui in ubuntu Message-ID: <1115a2b00911031844p62bd32dew3d7673d886da6efe@mail.gmail.com> Dear all could you please recommend an octave gui in ubuntu? thank you so much! -- ============================== WenSui Liu Tough Times Never Last. But Tough People Do. - Robert Schuller ============================== From leledumbo_cool at yahoo.co.id Tue Nov 3 22:19:18 2009 From: leledumbo_cool at yahoo.co.id (leledumbo) Date: Tue, 3 Nov 2009 20:19:18 -0800 (PST) Subject: octave gui in ubuntu In-Reply-To: <1115a2b00911031844p62bd32dew3d7673d886da6efe@mail.gmail.com> References: <1115a2b00911031844p62bd32dew3d7673d886da6efe@mail.gmail.com> Message-ID: <26190791.post@talk.nabble.com> Two the best I know: XOctave - http://xoctave.webs.com/ (GTK2/QT dependency) QTOctave - http://qtoctave.wordpress.com/ (QT dependency) -- View this message in context: http://old.nabble.com/octave-gui-in-ubuntu-tp26190233p26190791.html Sent from the Octave - General mailing list archive at Nabble.com. From jpswensen at comcast.net Wed Nov 4 06:44:14 2009 From: jpswensen at comcast.net (John Swensen) Date: Wed, 4 Nov 2009 07:44:14 -0500 Subject: octave gui in ubuntu In-Reply-To: <26190791.post@talk.nabble.com> References: <1115a2b00911031844p62bd32dew3d7673d886da6efe@mail.gmail.com> <26190791.post@talk.nabble.com> Message-ID: OctaveDE is also available in the Karmic Koala repositories. John Swensen On Nov 3, 2009, at 11:19 PM, leledumbo wrote: > > Two the best I know: > XOctave - http://xoctave.webs.com/ (GTK2/QT dependency) > QTOctave - http://qtoctave.wordpress.com/ (QT dependency) > -- > View this message in context: http://old.nabble.com/octave-gui-in-ubuntu-tp26190233p26190791.html > Sent from the Octave - General mailing list archive at Nabble.com. > > _______________________________________________ > Help-octave mailing list > Help-octave at octave.org > https://www-old.cae.wisc.edu/mailman/listinfo/help-octave From charlton at 2creek.com Wed Nov 4 12:14:22 2009 From: charlton at 2creek.com (Charlton Galvarino) Date: Wed, 4 Nov 2009 13:14:22 -0500 Subject: fresh install, bwmorph running into Index exceeds matrix dimension Message-ID: <97FDCEA6D905154D94E20D02312C8A310D0B1A7880@mse18be1.mse18.exchange.ms> Hi, list. I'm brand new to Octave and am afraid that I don't have Matlab experience to back me up. I have scoured the archives and googled around, but I haven't found any clear winners as to why a brand new Octave install fails as follows: octave:2> BW = imread('/home/cpurvis/Temp/20091002fronts.gif'); octave:3> BW2 = bwmorph(BW,'thin'); error: A(I): Index exceeds matrix dimension. error: called from: error: /usr/local/octave/share/octave/packages/image-1.0.10/applylut.m at line 44, column 4 error: evaluating argument list element number 1 error: evaluating argument list element number 1 error: /usr/local/octave/share/octave/packages/image-1.0.10/bwmorph.m at line 551, column 5 octave:3> This is a valid image, and I can even write it back out to a new .gif, and it looks fine. The image stats are as follows: Driver: GIF/Graphics Interchange Format (.gif) Size is 2797, 2234 Coordinate System is `' Corner Coordinates: Upper Left ( 0.0, 0.0) Lower Left ( 0.0, 2234.0) Upper Right ( 2797.0, 0.0) Lower Right ( 2797.0, 2234.0) Center ( 1398.5, 1117.0) Band 1 Block=2797x1 Type=Byte, ColorInterp=Palette Metadata: GIF_BACKGROUND=0 Color Table (RGB with 4 entries) 0: 255,255,255,255 1: 206,206,206,255 2: 0,0,0,255 3: 0,0,0,255 I can printf the size of the image after it's loaded, no problem. Converting it to .jpg results in the same error. Am I missing something very obvious that is a result of me being an Octave newbie? If so, I'm dreadfully sorry, and I can continue to printf debug messages as I work backwards. My stats are as follows and my thanks is in advance! ---------------------------------------------------------------------- GNU Octave Version 3.2.3 GNU Octave License: GNU General Public License Operating System: Linux 2.6.9-55.0.6.ELsmp #1 SMP Thu Aug 23 11:11:20 EDT 2007 i686 ---------------------------------------------------------------------- Package Name | Version | Installation directory --------------+---------+----------------------- control *| 1.0.11 | /usr/local/octave/share/octave/packages/control-1.0.11 image *| 1.0.10 | /usr/local/octave/share/octave/packages/image-1.0.10 Charlton Galvarino 1 (803) 233-6205 : voice 1 (803) 223-9579 : fax charlton at 2creek.com P.O. Box 50960 Columbia, SC 29250 From soren at hauberg.org Wed Nov 4 12:30:34 2009 From: soren at hauberg.org (=?ISO-8859-1?Q?S=F8ren?= Hauberg) Date: Wed, 04 Nov 2009 19:30:34 +0100 Subject: fresh install, bwmorph running into Index exceeds matrix dimension In-Reply-To: <97FDCEA6D905154D94E20D02312C8A310D0B1A7880@mse18be1.mse18.exchange.ms> References: <97FDCEA6D905154D94E20D02312C8A310D0B1A7880@mse18be1.mse18.exchange.ms> Message-ID: <1257359434.3955.18.camel@sh-t400> ons, 04 11 2009 kl. 13:14 -0500, skrev Charlton Galvarino: > octave:2> BW = imread('/home/cpurvis/Temp/20091002fronts.gif'); > octave:3> BW2 = bwmorph(BW,'thin'); > error: A(I): Index exceeds matrix dimension. > error: called from: > error: /usr/local/octave/share/octave/packages/image-1.0.10/applylut.m at line 44, column 4 > error: evaluating argument list element number 1 > error: evaluating argument list element number 1 > error: /usr/local/octave/share/octave/packages/image-1.0.10/bwmorph.m at line 551, column 5 > octave:3> I cannot replicate this problem. Can you send the image to me or make it available somewhere on the internet so I can try? One problem might be that your image is not binary. What do you get when you run class (BW) you should get 'logical' if your image is indeed binary. S?ren From charlton at 2creek.com Wed Nov 4 12:50:24 2009 From: charlton at 2creek.com (Charlton Galvarino) Date: Wed, 4 Nov 2009 13:50:24 -0500 Subject: fresh install, bwmorph running into Index exceeds matrix dimension In-Reply-To: <1257359434.3955.18.camel@sh-t400> References: <97FDCEA6D905154D94E20D02312C8A310D0B1A7880@mse18be1.mse18.exchange.ms> <1257359434.3955.18.camel@sh-t400> Message-ID: <97FDCEA6D905154D94E20D02312C8A310D0B1A7896@mse18be1.mse18.exchange.ms> > One problem might be that your image is not binary. What do you get when > you run > > class (BW) > > you should get 'logical' if your image is indeed binary. You hit the nail on the head. Once I made it monochrome, everything works wonderfully. Thank you for such a quick response. Charlton From joseph.wakeling at webdrake.net Wed Nov 4 14:01:11 2009 From: joseph.wakeling at webdrake.net (Joseph Wakeling) Date: Wed, 04 Nov 2009 21:01:11 +0100 Subject: Efficient code for operating on pairwise vector diffs In-Reply-To: <69d8d540911020600x17797edsd19eea7afdcdc17f@mail.gmail.com> References: <4AEEDCBE.80901@webdrake.net> <69d8d540911020600x17797edsd19eea7afdcdc17f@mail.gmail.com> Message-ID: <4AF1DD87.2020208@webdrake.net> Jaroslav Hajek wrote: > Code is always better if you want good answers. You can only extract a > small (but working!) skeleton. Unless your co-workers are idiots, they > won't bark at you for showing a few lines, especially if you're trying > to improve your common work. Further to previous comments -- I wound up implementing pairwisediff() as a function in its own right (attached). This actually uses both your suggested solutions: the version of MATLAB I was using to test MATLAB compatibility didn't have bsxfun included, so I put in place this check to use either bsxfun or the alternative. Looking at this it occurs to me that it would be very easy to modify it to allow pairwise diffs of either rows or columns (just add a DIM parameter), and that it would make a nice addition to octave-forge. This particular code has bugger-all to do with any academic worries, and could be useful for a lot of people, so would be interested on having comments on what needs to be added to it to make it a worthwhile submission. Thanks & best wishes, -- Joe -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: pairwisediff.m Url: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091104/0c87d969/attachment.ksh From muhali at shaw.ca Wed Nov 4 16:04:25 2009 From: muhali at shaw.ca (Muhali) Date: Wed, 4 Nov 2009 14:04:25 -0800 (PST) Subject: Weibull scale and shape parameters swapped Message-ID: <26205016.post@talk.nabble.com> I'm not sure if this is a bug as it only affects naming conventions of the help text: The weibull functions have shape and scale parameters mixed up. -- Function File: weibull_cdf (X, SHAPE, SCALE) Compute the cumulative distribution function (CDF) at X of the Weibull distribution with shape parameter SCALE and scale parameter SHAPE, which is 1 - exp(-(x/shape)^scale) for X >= 0. -- View this message in context: http://old.nabble.com/Weibull-scale-and-shape-parameters-swapped-tp26205016p26205016.html Sent from the Octave - General mailing list archive at Nabble.com. From alberto.frigerio1 at studenti.unimi.it Thu Nov 5 03:35:24 2009 From: alberto.frigerio1 at studenti.unimi.it (Alberto Frigerio) Date: Thu, 5 Nov 2009 01:35:24 -0800 (PST) Subject: Multidimensional matrix Message-ID: <26208649.post@talk.nabble.com> Hi everyone, I've some questions about multidimensional matrix. *) It is possible to create (maybe using a list) a multidimensional matrix A, i.e. every element of A is not a number but a couple, triplet, etc. of numbers ? *) How can I multiply two multidimensional matrices ? Thanks everybody, Alberto -- View this message in context: http://old.nabble.com/Multidimensional-matrix-tp26208649p26208649.html Sent from the Octave - General mailing list archive at Nabble.com. From carlo.defalco at gmail.com Thu Nov 5 03:48:03 2009 From: carlo.defalco at gmail.com (Carlo de Falco) Date: Thu, 5 Nov 2009 10:48:03 +0100 Subject: Multidimensional matrix In-Reply-To: <26208649.post@talk.nabble.com> References: <26208649.post@talk.nabble.com> Message-ID: <03F17CA8-F768-4DE3-A9D9-9284BC57247B@gmail.com> On 5 Nov 2009, at 10:35, Alberto Frigerio wrote: > > Hi everyone, I've some questions about multidimensional matrix. > > *) It is possible to create (maybe using a list) a multidimensional > matrix > A, i.e. every element of A is not a number but a couple, triplet, > etc. of > numbers ? you could use a multi-index matrix A = rand (2,4,5); A (:,2,4) or a cell-array of matrices for ii=1:4 for jj=1:5 A{ii,jj} = rand(3,1); endfor endfor A {2,4} > *) How can I multiply two multidimensional matrices ? in the second case you could use cellfun (@(x,y) (x'*y), A, A, 'UniformOutput', false) > Thanks everybody, > Alberto c. From individ at acc.umu.se Thu Nov 5 03:53:05 2009 From: individ at acc.umu.se (David Grundberg) Date: Thu, 05 Nov 2009 10:53:05 +0100 Subject: Multidimensional matrix In-Reply-To: <26208649.post@talk.nabble.com> References: <26208649.post@talk.nabble.com> Message-ID: <4AF2A081.1020509@acc.umu.se> Alberto Frigerio wrote: > Hi everyone, I've some questions about multidimensional matrix. > > *) It is possible to create (maybe using a list) a multidimensional matrix > A, i.e. every element of A is not a number but a couple, triplet, etc. of > numbers ? > *) How can I multiply two multidimensional matrices ? > > Thanks everybody, > Alberto > To create 3x3x8 double matrices, use something like: A = [1 2 3; 4 5 6; 7 8 9]; A = repmat(A, [1, 1, 8]); A B = eye(3); B = repmat(B, [1, 1, 8]); # To make it more interesting, use indexing to change certain elements: B(2,:,1:2) = 10; B(2,:,3:4) = 100; B(1,[1 3],5:6) = 1000; B(1,[1 3],7:8) = 10000; B(2,2,1:4) = -1; B #And to do element multiplication you could use the .* operator: A .* B hth David From frenk.calza at gmail.com Thu Nov 5 05:31:38 2009 From: frenk.calza at gmail.com (franco basaglia) Date: Thu, 5 Nov 2009 12:31:38 +0100 Subject: octave and delay ode's In-Reply-To: <6FFDE12B-E2E9-4DEB-8003-4440F8398347@gmail.com> References: <39CEC9CB-7B58-4173-8E6D-9C7BF6CBE6B4@gmail.com> <59CCC399-AC46-45F9-AD93-A0643AFC0EA8@gmail.com> <55A3A9EF-0C56-4091-A6AE-8A126012CD71@gmail.com> <2ED5382C-8DFA-45C1-BD40-00DD0EE986FC@gmail.com> <6FFDE12B-E2E9-4DEB-8003-4440F8398347@gmail.com> Message-ID: is that what you want? Thanks Carlo. You are very helpful and I'm learning about Octave Your script runs without errors on my system, but I have no idea about what the results should look like so I cannot comment on their correctness. I make some editing on equations in my script(I attach it again). I also try to run my system without delay, paradoxically it works better than "Delay Script". I attach result from Stella( there isn't U variable), from Octave with Delay and From Octave without Delay. Note that Variables S and T are influenced directly from Delay As you can see the difference is on transitory. Thanks for all. Best regards f.b. 2009/11/3 Carlo de Falco > > On 3 Nov 2009, at 14:58, franco basaglia wrote: > > >> What exactly does "delta t" mean in your file? >>> >>> what do you mean by "time units"? >>> >>> >>> From your pdf file and your script I get the feeling that you are >>> confusing the >>> time parameter in the continuos problem and the number of time-steps in >>> the discretized >>> system... >>> >> >> Yes.You're right. I have confused "delta t" (time parameter in the >> contiunuos problem) and time-steps in the discretizet system, that are my >> "time units". >> These time units are 5 and 10 in my DISCRETE function "delay". >> Are you meaning this or that I have to modify my system in a discrete time >> system? >> I'm confuse about this question because, for example, Stella runtime >> equation is something like this: >> .... >> L(t) = L(t-dt)+(-LtoM-LtoF)?dt >> T(t) = T(t-dt)+(DELAY(S?(1-GP),10)?(1-T))?dt >> and Euler and 4th-order Runge-Kutta methods are used >> with time step dt set to 0.5 year >> > > the functions in odepkg use adaptive time-stepping so > > 1) you cannot know in advance what the value of dt will be > > and > > 2) dt it will vary during the simulation > > therefore specifying the delay in terms of dt makes no sense, > if your time is measured in years your delay must also be expressed in > years. > In particular the following command in your script: > > res = ode45d (@fun, t, init, [5,10],ones(7,2)); > > means that at any given time t, "fun" will be called as > > fun (t, x, xd) > > where xd(:,1) is the value of the state vetor at the time point t-5 years > and xd(:,2) is the value of the state vetor at the time point t-10 years > > is that what you want? > > > Anyway, I correct my script following your suggestion, but it doesn't >> work. And the different values from Stella concern, particularly, the 2 >> state variables with delay. >> I have also this warning but I don't think that the problem is here: >> warning: Option "RelTol" not set, new value 0.000001 is used >> warning: Option "AbsTol" not set, new value 0.000001 is used >> warning: Option "InitialStep" not set, new value 30.000000 is used >> warning: Option "MaxStep" not set, new value 30.000000 is used >> > > These are just warnings, you can safely ignore them at this stage, or > specify the missing options if you want to get rid of them... > > > I attach my new script. >> > > Your script runs without errors on my system, but I have no idea about what > the results should look like so I cannot comment on their correctness. > > > thanks >> >> best regrads >> f.b. >> > c. -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091105/ebf4ba2f/attachment-0001.html -------------- next part -------------- A non-text attachment was scrubbed... Name: patumode45d.m Type: text/x-objcsrc Size: 4283 bytes Desc: not available Url : https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091105/ebf4ba2f/attachment-0001.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: stellagsd0a600.png Type: image/png Size: 6290 bytes Desc: not available Url : https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091105/ebf4ba2f/attachment-0001.png -------------- next part -------------- A non-text attachment was scrubbed... Name: OctDelaygsd0a600.ps Type: application/postscript Size: 28948 bytes Desc: not available Url : https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091105/ebf4ba2f/attachment-0002.ps -------------- next part -------------- A non-text attachment was scrubbed... Name: OctNOdelaygsd0a600.ps Type: application/postscript Size: 29053 bytes Desc: not available Url : https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091105/ebf4ba2f/attachment-0003.ps From individ at acc.umu.se Thu Nov 5 06:35:23 2009 From: individ at acc.umu.se (David Grundberg) Date: Thu, 05 Nov 2009 13:35:23 +0100 Subject: Multidimensional matrix In-Reply-To: <96bc13e50911050328w4bdc2b94w713ec492b68bf989@mail.gmail.com> References: <26208649.post@talk.nabble.com> <03F17CA8-F768-4DE3-A9D9-9284BC57247B@gmail.com> <96bc13e50911050328w4bdc2b94w713ec492b68bf989@mail.gmail.com> Message-ID: <4AF2C68B.4080205@acc.umu.se> I have absolutely no idea what you are trying to say. Your idea of "multiplication" is not something I recognize as multiplication. Also, if you want to find W and H given V, it is misleading to say that you are "extending the usual matrix product". Alberto Frigerio wrote: > OOPS I forgot one important information. > > In my mind I would like to extend the usual matrix product using > multidimensional matrix. Hence, given a (d,t,s) matrix ,V I want to > find two matrices W (d,r,s1) and H (r,t,s2) so that V = W*H > (eventually s=s1=s2) .In my problem I have s=2, i.e. every element of > the matrix V is a couple of elements. > > I could obviously take the matrices V(:,:,1) , V(:,:,2) , etc, find > the corrispective Wi and Hi and then create the matrices W and H by > taking W(:,:,i)=Wi and H(:,:,i)=Hi. But it would mean to work in > parallel, while I introduced the second parameter in s to have a > better representation of V by W and H. > > > 2009/11/5 Carlo de Falco > > > > On 5 Nov 2009, at 10:35, Alberto Frigerio wrote: > > > Hi everyone, I've some questions about multidimensional matrix. > > *) It is possible to create (maybe using a list) a > multidimensional matrix > A, i.e. every element of A is not a number but a couple, > triplet, etc. of > numbers ? > > you could use a multi-index matrix > > A = rand (2,4,5); > A (:,2,4) > > or a cell-array of matrices > > for ii=1:4 > for jj=1:5 > A{ii,jj} = rand(3,1); > endfor > endfor > > A {2,4} > > > *) How can I multiply two multidimensional matrices ? > > > in the second case you could use > cellfun (@(x,y) (x'*y), A, A, 'UniformOutput', false) > > Thanks everybody, > Alberto > > c. > > From carlo.defalco at gmail.com Thu Nov 5 07:38:55 2009 From: carlo.defalco at gmail.com (Carlo de Falco) Date: Thu, 5 Nov 2009 14:38:55 +0100 Subject: octave and delay ode's In-Reply-To: <4AEF326D.1070406@gmx.net> References: <39CEC9CB-7B58-4173-8E6D-9C7BF6CBE6B4@gmail.com> <59CCC399-AC46-45F9-AD93-A0643AFC0EA8@gmail.com> <55A3A9EF-0C56-4091-A6AE-8A126012CD71@gmail.com> <2ED5382C-8DFA-45C1-BD40-00DD0EE986FC@gmail.com> <4AEF326D.1070406@gmx.net> Message-ID: <970DCC2C-F189-43B7-AD47-8D847899D89B@gmail.com> Thomas, On 2 Nov 2009, at 20:26, Thomas Treichl wrote: > Because there is an "ode" in the subject of the email, yes, but I > also must say that I currently don't have the time to dig into this > problem and can only provide a short answer: if the above equations > form the DDE problem then Carlo's implementation does make more > sense to me. Thanks for your answer, I was not 100% sure I was doing things correctly as it seems to me that the case of mutiple delays is not fully clear from the documentation (I looked at the implementation to find out the meaning of LAGS). So if you believe my interpretation was correct, would you mind if I commit the patch below to improve the documentation of the DDE functions? > Best regards > Thomas c. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: patch.txt Url: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091105/e0980f0b/attachment.txt From alb.frigerio at gmail.com Thu Nov 5 05:16:07 2009 From: alb.frigerio at gmail.com (Alberto Frigerio) Date: Thu, 5 Nov 2009 12:16:07 +0100 Subject: Multidimensional matrix In-Reply-To: <03F17CA8-F768-4DE3-A9D9-9284BC57247B@gmail.com> References: <26208649.post@talk.nabble.com> <03F17CA8-F768-4DE3-A9D9-9284BC57247B@gmail.com> Message-ID: <96bc13e50911050316ie4fd9bi17784c85faf1e302@mail.gmail.com> Well, both they seem good ideas, but I've another problem . In my mind I would like to extend the usual matrix product using multidimensional matrix. Hence, given a (d,t,s) matrix ,V I want to find two matrices W (d,r,s1) and H (r,t,s2) so that V = W*H (eventually s=s1=s2) .In my problem I have s=2, i.e. every element of the matrix V is a couple of elements. 2009/11/5 Carlo de Falco > > On 5 Nov 2009, at 10:35, Alberto Frigerio wrote: > > >> Hi everyone, I've some questions about multidimensional matrix. >> >> *) It is possible to create (maybe using a list) a multidimensional matrix >> A, i.e. every element of A is not a number but a couple, triplet, etc. of >> numbers ? >> > you could use a multi-index matrix > > A = rand (2,4,5); > A (:,2,4) > > or a cell-array of matrices > > for ii=1:4 > for jj=1:5 > A{ii,jj} = rand(3,1); > endfor > endfor > > A {2,4} > > > *) How can I multiply two multidimensional matrices ? >> > > in the second case you could use > cellfun (@(x,y) (x'*y), A, A, 'UniformOutput', false) > > Thanks everybody, >> Alberto >> > c. > -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091105/812725a8/attachment.html From alb.frigerio at gmail.com Thu Nov 5 05:28:40 2009 From: alb.frigerio at gmail.com (Alberto Frigerio) Date: Thu, 5 Nov 2009 12:28:40 +0100 Subject: Multidimensional matrix In-Reply-To: <03F17CA8-F768-4DE3-A9D9-9284BC57247B@gmail.com> References: <26208649.post@talk.nabble.com> <03F17CA8-F768-4DE3-A9D9-9284BC57247B@gmail.com> Message-ID: <96bc13e50911050328w4bdc2b94w713ec492b68bf989@mail.gmail.com> OOPS I forgot one important information. In my mind I would like to extend the usual matrix product using multidimensional matrix. Hence, given a (d,t,s) matrix ,V I want to find two matrices W (d,r,s1) and H (r,t,s2) so that V = W*H (eventually s=s1=s2) .In my problem I have s=2, i.e. every element of the matrix V is a couple of elements. I could obviously take the matrices V(:,:,1) , V(:,:,2) , etc, find the corrispective Wi and Hi and then create the matrices W and H by taking W(:,:,i)=Wi and H(:,:,i)=Hi. But it would mean to work in parallel, while I introduced the second parameter in s to have a better representation of V by W and H. 2009/11/5 Carlo de Falco > > On 5 Nov 2009, at 10:35, Alberto Frigerio wrote: > > >> Hi everyone, I've some questions about multidimensional matrix. >> >> *) It is possible to create (maybe using a list) a multidimensional matrix >> A, i.e. every element of A is not a number but a couple, triplet, etc. of >> numbers ? >> > you could use a multi-index matrix > > A = rand (2,4,5); > A (:,2,4) > > or a cell-array of matrices > > for ii=1:4 > for jj=1:5 > A{ii,jj} = rand(3,1); > endfor > endfor > > A {2,4} > > > *) How can I multiply two multidimensional matrices ? >> > > in the second case you could use > cellfun (@(x,y) (x'*y), A, A, 'UniformOutput', false) > > Thanks everybody, >> Alberto >> > c. > -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091105/6f2470a5/attachment-0001.html From alb.frigerio at gmail.com Thu Nov 5 08:01:49 2009 From: alb.frigerio at gmail.com (Alberto Frigerio) Date: Thu, 5 Nov 2009 15:01:49 +0100 Subject: Multidimensional matrix In-Reply-To: <4AF2C68B.4080205@acc.umu.se> References: <26208649.post@talk.nabble.com> <03F17CA8-F768-4DE3-A9D9-9284BC57247B@gmail.com> <96bc13e50911050328w4bdc2b94w713ec492b68bf989@mail.gmail.com> <4AF2C68B.4080205@acc.umu.se> Message-ID: <96bc13e50911050601q3143e160ib3fc717bd5080291@mail.gmail.com> OK, you are right, I explained the problem in a terrible way. Let's restart with "usual" matrices. I have a matrix V (sive(V)=[d,t]) of positive elements and, using an iterative algorithm, I found its non negative matrix factorization, V = W*H, where size(W)= [d,r] and size(H)=[r,t]. What I want now to do is improving the same thing for a multidimensional matrix. Hence, if size(V)=[d,t,s] I wanna find two matrices W and H such as V = W*H . My first idea was to consider V(:,:,1) , to find W1 and H1 such as V(:,:,1)=W1*H1 with my algorithm, and then to repeat it for V(:,:,2) , V(:,:,3) , etc . At the end I will consider W={W1,W2,W3, etc.} and H={H1,H2,H3, etc.} . But in this way I will consider V(:,:,1) , V(:,:,2) ,... as completely indipendent matrices, but it is not true. What I would like to do is to find the matrices W and H using, at the same time, all the V(:,:,i)'s. I don't know if I'm talking about something possible or not, it is just an idea I had yesterday looking at my algorithm ... Hope I explained the problem in a better way!!!!! 2009/11/5 David Grundberg > I have absolutely no idea what you are trying to say. Your idea of > "multiplication" is not something I recognize as multiplication. > > Also, if you want to find W and H given V, it is misleading to say that you > are "extending the usual matrix product". > > > Alberto Frigerio wrote: > >> OOPS I forgot one important information. >> >> In my mind I would like to extend the usual matrix product using >> multidimensional matrix. Hence, given a (d,t,s) matrix ,V I want to find two >> matrices W (d,r,s1) and H (r,t,s2) so that V = W*H (eventually s=s1=s2) .In >> my problem I have s=2, i.e. every element of the matrix V is a couple of >> elements. >> >> I could obviously take the matrices V(:,:,1) , V(:,:,2) , etc, find the >> corrispective Wi and Hi and then create the matrices W and H by taking >> W(:,:,i)=Wi and H(:,:,i)=Hi. But it would mean to work in parallel, while I >> introduced the second parameter in s to have a better representation of V by >> W and H. >> >> >> 2009/11/5 Carlo de Falco > carlo.defalco at gmail.com>> >> >> >> >> On 5 Nov 2009, at 10:35, Alberto Frigerio wrote: >> >> >> Hi everyone, I've some questions about multidimensional matrix. >> >> *) It is possible to create (maybe using a list) a >> multidimensional matrix >> A, i.e. every element of A is not a number but a couple, >> triplet, etc. of >> numbers ? >> >> you could use a multi-index matrix >> >> A = rand (2,4,5); >> A (:,2,4) >> >> or a cell-array of matrices >> >> for ii=1:4 >> for jj=1:5 >> A{ii,jj} = rand(3,1); >> endfor >> endfor >> >> A {2,4} >> >> >> *) How can I multiply two multidimensional matrices ? >> >> >> in the second case you could use >> cellfun (@(x,y) (x'*y), A, A, 'UniformOutput', false) >> >> Thanks everybody, >> Alberto >> >> c. >> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091105/bda7fd67/attachment-0001.html From pleser at sup-logistik.de Wed Nov 4 08:55:46 2009 From: pleser at sup-logistik.de (Philipp Leser) Date: Wed, 4 Nov 2009 15:55:46 +0100 Subject: data base package Message-ID: <0EA9662A402E6A4B88078E93D7F20D7B78455A@x346-001w2k3.sup2000.sup-logistik.de> Hey guys, it's me again. Is there a possibility to install the data base package without installing all the additional packages that are mentioned in the system requirements section? (swig, postgresql-8.2, postgresql-client-8.2, mysql-common, mysql-client-5.0, mysql-server-5.0, libmysqlclient15-dev, sqlite3, libsqlite3-dev, unixodbc-bin, unixodbc-dev, odbc-postgresql.). As warnend in the packages FAQ section I get a bunch of weird errors when run " install pkg...." . I don't think I need the whole functionality and all the options, just want to select some data from an Oracle data base usindg JDBC. Thanx in advance Regards Phil -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091104/087c1cd9/attachment.html From individ at acc.umu.se Thu Nov 5 09:30:51 2009 From: individ at acc.umu.se (David Grundberg) Date: Thu, 05 Nov 2009 16:30:51 +0100 Subject: Multidimensional matrix In-Reply-To: <96bc13e50911050601q3143e160ib3fc717bd5080291@mail.gmail.com> References: <26208649.post@talk.nabble.com> <03F17CA8-F768-4DE3-A9D9-9284BC57247B@gmail.com> <96bc13e50911050328w4bdc2b94w713ec492b68bf989@mail.gmail.com> <4AF2C68B.4080205@acc.umu.se> <96bc13e50911050601q3143e160ib3fc717bd5080291@mail.gmail.com> Message-ID: <4AF2EFAB.2030801@acc.umu.se> Your solution sounds reasonable to me. When the matrices are independent, it doesn't matter in what order they are calculated. Alberto Frigerio wrote: > OK, you are right, I explained the problem in a terrible way. Let's > restart with "usual" matrices. > > I have a matrix V (sive(V)=[d,t]) of positive elements and, using an > iterative algorithm, I found its non negative matrix factorization, V > = W*H, where size(W)= [d,r] and size(H)=[r,t]. What I want now to do > is improving the same thing for a multidimensional matrix. > > Hence, if size(V)=[d,t,s] I wanna find two matrices W and H such as V > = W*H . My first idea was to consider V(:,:,1) , to find W1 and H1 > such as V(:,:,1)=W1*H1 with my algorithm, and then to repeat it for > V(:,:,2) , V(:,:,3) , etc . At the end I will consider W={W1,W2,W3, > etc.} and H={H1,H2,H3, etc.} . > But in this way I will consider V(:,:,1) , V(:,:,2) ,... as completely > indipendent matrices, but it is not true. What I would like to do is > to find the matrices W and H using, at the same time, all the > V(:,:,i)'s. I don't know if I'm talking about something possible or > not, it is just an idea I had yesterday looking at my algorithm ... > > Hope I explained the problem in a better way!!!!! > > > 2009/11/5 David Grundberg > > > I have absolutely no idea what you are trying to say. Your idea of > "multiplication" is not something I recognize as multiplication. > > Also, if you want to find W and H given V, it is misleading to say > that you are "extending the usual matrix product". > > > Alberto Frigerio wrote: > > OOPS I forgot one important information. > > In my mind I would like to extend the usual matrix product > using multidimensional matrix. Hence, given a (d,t,s) matrix > ,V I want to find two matrices W (d,r,s1) and H (r,t,s2) so > that V = W*H (eventually s=s1=s2) .In my problem I have s=2, > i.e. every element of the matrix V is a couple of elements. > > I could obviously take the matrices V(:,:,1) , V(:,:,2) , etc, > find the corrispective Wi and Hi and then create the matrices > W and H by taking W(:,:,i)=Wi and H(:,:,i)=Hi. But it would > mean to work in parallel, while I introduced the second > parameter in s to have a better representation of V by W and H. > > > 2009/11/5 Carlo de Falco > >> > > > > On 5 Nov 2009, at 10:35, Alberto Frigerio wrote: > > > Hi everyone, I've some questions about multidimensional > matrix. > > *) It is possible to create (maybe using a list) a > multidimensional matrix > A, i.e. every element of A is not a number but a couple, > triplet, etc. of > numbers ? > > you could use a multi-index matrix > > A = rand (2,4,5); > A (:,2,4) > > or a cell-array of matrices > > for ii=1:4 > for jj=1:5 > A{ii,jj} = rand(3,1); > endfor > endfor > > A {2,4} > > > *) How can I multiply two multidimensional matrices ? > > > in the second case you could use > cellfun (@(x,y) (x'*y), A, A, 'UniformOutput', false) > > Thanks everybody, > Alberto > > c. > > > > From Thomas.Treichl at gmx.net Thu Nov 5 09:48:12 2009 From: Thomas.Treichl at gmx.net (Thomas Treichl) Date: Thu, 05 Nov 2009 16:48:12 +0100 Subject: octave and delay ode's In-Reply-To: <970DCC2C-F189-43B7-AD47-8D847899D89B@gmail.com> References: <39CEC9CB-7B58-4173-8E6D-9C7BF6CBE6B4@gmail.com> <59CCC399-AC46-45F9-AD93-A0643AFC0EA8@gmail.com> <55A3A9EF-0C56-4091-A6AE-8A126012CD71@gmail.com> <2ED5382C-8DFA-45C1-BD40-00DD0EE986FC@gmail.com> <4AEF326D.1070406@gmx.net> <970DCC2C-F189-43B7-AD47-8D847899D89B@gmail.com> Message-ID: <4AF2F3BC.8040409@gmx.net> Carlo de Falco schrieb: > Thomas, > > On 2 Nov 2009, at 20:26, Thomas Treichl wrote: > >> Because there is an "ode" in the subject of the email, yes, but I also >> must say that I currently don't have the time to dig into this problem >> and can only provide a short answer: if the above equations form the >> DDE problem then Carlo's implementation does make more sense to me. > > Thanks for your answer, I was not 100% sure I was doing things correctly as > it seems to me that the case of mutiple delays is not fully clear from > the documentation (I looked at the implementation to find out the > meaning of LAGS). > So if you believe my interpretation was correct, would you mind if I > commit the patch below to improve the documentation of the DDE functions? These changes would be an improvement. Can you please make these changes also for ode45d, ode54d and ode78d? Thanks, Thomas From carlo.defalco at gmail.com Thu Nov 5 10:42:10 2009 From: carlo.defalco at gmail.com (Carlo de Falco) Date: Thu, 5 Nov 2009 17:42:10 +0100 Subject: octave and delay ode's In-Reply-To: <4AF2F3BC.8040409@gmx.net> References: <39CEC9CB-7B58-4173-8E6D-9C7BF6CBE6B4@gmail.com> <59CCC399-AC46-45F9-AD93-A0643AFC0EA8@gmail.com> <55A3A9EF-0C56-4091-A6AE-8A126012CD71@gmail.com> <2ED5382C-8DFA-45C1-BD40-00DD0EE986FC@gmail.com> <4AEF326D.1070406@gmx.net> <970DCC2C-F189-43B7-AD47-8D847899D89B@gmail.com> <4AF2F3BC.8040409@gmx.net> Message-ID: On 5 Nov 2009, at 16:48, Thomas Treichl wrote: > Carlo de Falco schrieb: >> Thomas, >> On 2 Nov 2009, at 20:26, Thomas Treichl wrote: >>> Because there is an "ode" in the subject of the email, yes, but I >>> also must say that I currently don't have the time to dig into >>> this problem and can only provide a short answer: if the above >>> equations form the DDE problem then Carlo's implementation does >>> make more sense to me. >> Thanks for your answer, I was not 100% sure I was doing things >> correctly as >> it seems to me that the case of mutiple delays is not fully clear >> from the documentation (I looked at the implementation to find out >> the meaning of LAGS). >> So if you believe my interpretation was correct, would you mind if >> I commit the patch below to improve the documentation of the DDE >> functions? > > These changes would be an improvement. > Can you please make these changes also for ode45d, ode54d and ode78d? > > Thanks, Thomas I checked-in the patch below, c. Index: ode45d.m =================================================================== --- ode45d.m (revision 6438) +++ ode45d.m (revision 6439) @@ -23,20 +23,54 @@ %# %# If this function is called with no return argument then plot the solution over time in a figure window while solving the set of DDEs that are defined in a function and specified by the function handle @var{@@fun}. The second input argument @var{slot} is a double vector that defines the time slot, @var{init} is a double vector that defines the initial values of the states, @var{lags} is a double vector that describes the lags of time, @var{hist} is a double matrix and describes the history of the DDEs, @var{opt} can optionally be a structure array that keeps the options created with the command @command{odeset} and @var{par1}, @var{par2}, @dots{} can optionally be other input arguments of any type that have to be passed to the function defined by @var{@@fun}. %# +%# In other words, this function will solve a problem of the form +%# @example +%# dy/dt = fun (t, y(t), y(t-lags(1), y(t-lags(2), @dots{}))) +%# y(slot(1)) = init +%# y(slot(1)-lags(1)) = hist(1), y(slot(1)-lags(2)) = hist(2), @dots{} +%# @end example +%# %# If this function is called with one return argument then return the solution @var{sol} of type structure array after solving the set of DDEs. The solution @var{sol} has the fields @var{x} of type double column vector for the steps chosen by the solver, @var{y} of type double column vector for the solutions at each time step of @var{x}, @var{solver} of type string for the solver name and optionally the extended time stamp information @var{xe}, the extended solution information @var{ye} and the extended index information @var{ie} all of type double column vector that keep the informations of the event function if an event function handle is set in the option argument @var{opt}. %# %# If this function is called with more than one return argument then return the time stamps @var{t}, the solution values @var{y} and optionally the extended time stamp information @var{xe}, the extended solution information @var{ye} and the extended index information @var{ie} all of type double column vector. %# -%# For example, solve an anonymous implementation of a chaotic behavior +%# For example: +%# @itemize @minus +%# @item +%# the following code solves an anonymous implementation of a chaotic behavior +%# %# @example %# fcao = @@(vt, vy, vz) [2 * vz / (1 + vz^9.65) - vy]; %# -%# vopt = odeset ("NormControl", "on", "RelTol", 1e-4); +%# vopt = odeset ("NormControl", "on", "RelTol", 1e-3); %# vsol = ode45d (fcao, [0, 100], 0.5, 2, 0.5, vopt); %# %# vlag = interp1 (vsol.x, vsol.y, vsol.x - 2); %# plot (vsol.y, vlag); legend ("fcao (t,y,z)"); %# @end example +%# +%# @item +%# to solve the following problem with two delayed state variables +%# +%# @example +%# d y1(t)/ dt = -y1(t) +%# d y2(t)/ dt = -y2(t) + y1(t-5) +%# d y3(t)/dt = -y3(t) + y2(t-10)*y1(t-10) +%# @end example +%# +%# one might do the following +%# +%# @example +%# function f = fun (t, y, yd) +%# f(1) =-y(1); %% y1' = -y1(t) +%# f(2) =-y(2) + yd(1,1); %% y2' = -y2(t) + y1(t-lags(1)) +%# f(3) =-y(3) + yd(2,2)*yd(1,2); %% y3' = -y3(t) + y2(t- lags(2))*y1(t-lags(2)) +%# endfunction +%# T = [0,20] +%# res = ode45d (@fun, t, [1;1;1], [5, 10], ones (3,2)); +%# @end example +%# +%# @end itemize %# @end deftypefn %# %# @seealso{odepkg} Index: ode54d.m =================================================================== --- ode54d.m (revision 6438) +++ ode54d.m (revision 6439) @@ -23,11 +23,21 @@ %# %# If this function is called with no return argument then plot the solution over time in a figure window while solving the set of DDEs that are defined in a function and specified by the function handle @var{@@fun}. The second input argument @var{slot} is a double vector that defines the time slot, @var{init} is a double vector that defines the initial values of the states, @var{lags} is a double vector that describes the lags of time, @var{hist} is a double matrix and describes the history of the DDEs, @var{opt} can optionally be a structure array that keeps the options created with the command @command{odeset} and @var{par1}, @var{par2}, @dots{} can optionally be other input arguments of any type that have to be passed to the function defined by @var{@@fun}. %# +%# In other words, this function will solve a problem of the form +%# @example +%# dy/dt = fun (t, y(t), y(t-lags(1), y(t-lags(2), @dots{}))) +%# y(slot(1)) = init +%# y(slot(1)-lags(1)) = hist(1), y(slot(1)-lags(2)) = hist(2), @dots{} +%# @end example +%# %# If this function is called with one return argument then return the solution @var{sol} of type structure array after solving the set of DDEs. The solution @var{sol} has the fields @var{x} of type double column vector for the steps chosen by the solver, @var{y} of type double column vector for the solutions at each time step of @var{x}, @var{solver} of type string for the solver name and optionally the extended time stamp information @var{xe}, the extended solution information @var{ye} and the extended index information @var{ie} all of type double column vector that keep the informations of the event function if an event function handle is set in the option argument @var{opt}. %# %# If this function is called with more than one return argument then return the time stamps @var{t}, the solution values @var{y} and optionally the extended time stamp information @var{xe}, the extended solution information @var{ye} and the extended index information @var{ie} all of type double column vector. %# -%# For example, solve an anonymous implementation of a chaotic behavior +%# For example: +%# @itemize @minus +%# @item +%# the following code solves an anonymous implementation of a chaotic behavior %# @example %# fcao = @@(vt, vy, vz) [2 * vz / (1 + vz^9.65) - vy]; %# @@ -37,6 +47,29 @@ %# vlag = interp1 (vsol.x, vsol.y, vsol.x - 2); %# plot (vsol.y, vlag); legend ("fcao (t,y,z)"); %# @end example +%# +%# @item +%# to solve the following problem with two delayed state variables +%# +%# @example +%# d y1(t)/ dt = -y1(t) +%# d y2(t)/ dt = -y2(t) + y1(t-5) +%# d y3(t)/dt = -y3(t) + y2(t-10)*y1(t-10) +%# @end example +%# +%# one might do the following +%# +%# @example +%# function f = fun (t, y, yd) +%# f(1) =-y(1); %% y1' = -y1(t) +%# f(2) =-y(2) + yd(1,1); %% y2' = -y2(t) + y1(t-lags(1)) +%# f(3) =-y(3) + yd(2,2)*yd(1,2); %% y3' = -y3(t) + y2(t- lags(2))*y1(t-lags(2)) +%# endfunction +%# T = [0,20] +%# res = ode54d (@fun, t, [1;1;1], [5, 10], ones (3,2)); +%# @end example +%# +%# @end itemize %# @end deftypefn %# %# @seealso{odepkg} Index: ode78d.m =================================================================== --- ode78d.m (revision 6438) +++ ode78d.m (revision 6439) @@ -23,11 +23,21 @@ %# %# If this function is called with no return argument then plot the solution over time in a figure window while solving the set of DDEs that are defined in a function and specified by the function handle @var{@@fun}. The second input argument @var{slot} is a double vector that defines the time slot, @var{init} is a double vector that defines the initial values of the states, @var{lags} is a double vector that describes the lags of time, @var{hist} is a double matrix and describes the history of the DDEs, @var{opt} can optionally be a structure array that keeps the options created with the command @command{odeset} and @var{par1}, @var{par2}, @dots{} can optionally be other input arguments of any type that have to be passed to the function defined by @var{@@fun}. %# +%# In other words, this function will solve a problem of the form +%# @example +%# dy/dt = fun (t, y(t), y(t-lags(1), y(t-lags(2), @dots{}))) +%# y(slot(1)) = init +%# y(slot(1)-lags(1)) = hist(1), y(slot(1)-lags(2)) = hist(2), @dots{} +%# @end example +%# %# If this function is called with one return argument then return the solution @var{sol} of type structure array after solving the set of DDEs. The solution @var{sol} has the fields @var{x} of type double column vector for the steps chosen by the solver, @var{y} of type double column vector for the solutions at each time step of @var{x}, @var{solver} of type string for the solver name and optionally the extended time stamp information @var{xe}, the extended solution information @var{ye} and the extended index information @var{ie} all of type double column vector that keep the informations of the event function if an event function handle is set in the option argument @var{opt}. %# %# If this function is called with more than one return argument then return the time stamps @var{t}, the solution values @var{y} and optionally the extended time stamp information @var{xe}, the extended solution information @var{ye} and the extended index information @var{ie} all of type double column vector. %# -%# For example, solve an anonymous implementation of a chaotic behavior +%# For example: +%# @itemize @minus +%# @item +%# the following code solves an anonymous implementation of a chaotic behavior %# @example %# fcao = @@(vt, vy, vz) [2 * vz / (1 + vz^9.65) - vy]; %# @@ -37,6 +47,29 @@ %# vlag = interp1 (vsol.x, vsol.y, vsol.x - 2); %# plot (vsol.y, vlag); legend ("fcao (t,y,z)"); %# @end example +%# +%# @item +%# to solve the following problem with two delayed state variables +%# +%# @example +%# d y1(t)/ dt = -y1(t) +%# d y2(t)/ dt = -y2(t) + y1(t-5) +%# d y3(t)/dt = -y3(t) + y2(t-10)*y1(t-10) +%# @end example +%# +%# one might do the following +%# +%# @example +%# function f = fun (t, y, yd) +%# f(1) =-y(1); %% y1' = -y1(t) +%# f(2) =-y(2) + yd(1,1); %% y2' = -y2(t) + y1(t-lags(1)) +%# f(3) =-y(3) + yd(2,2)*yd(1,2); %% y3' = -y3(t) + y2(t- lags(2))*y1(t-lags(2)) +%# endfunction +%# T = [0,20] +%# res = ode78d (@fun, t, [1;1;1], [5, 10], ones (3,2)); +%# @end example +%# +%# @end itemize %# @end deftypefn %# %# @seealso{odepkg} Index: ode23d.m =================================================================== --- ode23d.m (revision 6438) +++ ode23d.m (revision 6439) @@ -23,11 +23,22 @@ %# %# If this function is called with no return argument then plot the solution over time in a figure window while solving the set of DDEs that are defined in a function and specified by the function handle @var{@@fun}. The second input argument @var{slot} is a double vector that defines the time slot, @var{init} is a double vector that defines the initial values of the states, @var{lags} is a double vector that describes the lags of time, @var{hist} is a double matrix and describes the history of the DDEs, @var{opt} can optionally be a structure array that keeps the options created with the command @command{odeset} and @var{par1}, @var{par2}, @dots{} can optionally be other input arguments of any type that have to be passed to the function defined by @var{@@fun}. %# +%# In other words, this function will solve a problem of the form +%# @example +%# dy/dt = fun (t, y(t), y(t-lags(1), y(t-lags(2), @dots{}))) +%# y(slot(1)) = init +%# y(slot(1)-lags(1)) = hist(1), y(slot(1)-lags(2)) = hist(2), @dots{} +%# @end example +%# %# If this function is called with one return argument then return the solution @var{sol} of type structure array after solving the set of DDEs. The solution @var{sol} has the fields @var{x} of type double column vector for the steps chosen by the solver, @var{y} of type double column vector for the solutions at each time step of @var{x}, @var{solver} of type string for the solver name and optionally the extended time stamp information @var{xe}, the extended solution information @var{ye} and the extended index information @var{ie} all of type double column vector that keep the informations of the event function if an event function handle is set in the option argument @var{opt}. %# %# If this function is called with more than one return argument then return the time stamps @var{t}, the solution values @var{y} and optionally the extended time stamp information @var{xe}, the extended solution information @var{ye} and the extended index information @var{ie} all of type double column vector. %# -%# For example, solve an anonymous implementation of a chaotic behavior +%# For example: +%# @itemize @minus +%# @item +%# the following code solves an anonymous implementation of a chaotic behavior +%# %# @example %# fcao = @@(vt, vy, vz) [2 * vz / (1 + vz^9.65) - vy]; %# @@ -37,6 +48,29 @@ %# vlag = interp1 (vsol.x, vsol.y, vsol.x - 2); %# plot (vsol.y, vlag); legend ("fcao (t,y,z)"); %# @end example +%# +%# @item +%# to solve the following problem with two delayed state variables +%# +%# @example +%# d y1(t)/ dt = -y1(t) +%# d y2(t)/ dt = -y2(t) + y1(t-5) +%# d y3(t)/dt = -y3(t) + y2(t-10)*y1(t-10) +%# @end example +%# +%# one might do the following +%# +%# @example +%# function f = fun (t, y, yd) +%# f(1) =-y(1); %% y1' = -y1(t) +%# f(2) =-y(2) + yd(1,1); %% y2' = -y2(t) + y1(t-lags(1)) +%# f(3) =-y(3) + yd(2,2)*yd(1,2); %% y3' = -y3(t) + y2(t- lags(2))*y1(t-lags(2)) +%# endfunction +%# T = [0,20] +%# res = ode23d (@fun, t, [1;1;1], [5, 10], ones (3,2)); +%# @end example +%# +%# @end itemize %# @end deftypefn %# %# @seealso{odepkg} From coccoinomane at gmail.com Thu Nov 5 16:00:22 2009 From: coccoinomane at gmail.com (Guido Walter Pettinari) Date: Thu, 5 Nov 2009 22:00:22 +0000 Subject: slow 'eval' function - maybe pointers would do? In-Reply-To: References: <12D4BAEF-7966-4EE4-9283-1E80708B688E@gmail.com> <5CDEBDC1-32B3-4DE4-A3A3-61310921A17F@gmail.com> Message-ID: <2631C47B-D0F6-4EE4-B5BC-C2BC9B8CCE70@gmail.com> Hello everybody! Sorry for this late reply but I had much work to do in these days. Thank you for all the answers. It was very instructive to learn all the methods to handle with field names; I find particularly useful what Benjamin pointed out, that is the possibility to create/access a field via strings by using the parentheses: for i = 1:N field = sprintf ( 'something_%d', i ); S.(field) = whatever(i); endfor In this way the structures become really flexible! @Carlo > but still I don't understand why you want to call your vectors > S.ks_ii, > I'm really curious: what's the problem with calling them KS{ii}? I want to call the vectors in that way because I want a struct where the fields are just column vectors. I like to access everything in the structure S by just typing S.k1 or S.k2 rather than S.KS{i}. This is just a personal preference, probably because I mainly program in C++ and I do not feel comfortable with cell arrays yet :) Cheers, Guido P.S. Judd, I confere on you the prize for the most twisted solution :))) On Oct 30, 2009, at 15:40 , Judd Storrs wrote: >> for j=1:N >> eval( [ 's.k', int2str(j), ' = ks ( :, j );' ] ); >> endfor > > If you want to make people shake their heads in disgust and pretend > they don't know you in public (probably also in private) while they > mutter under their breath about the coming of the end times and your > personal role as /the cause/ of hadal cooling, you can try (on linux > at least--I don't know how portable /dev/shm is to other unixen): > > fid = fopen('/dev/shm/look_ma_no_eval.m','w') ; > fprintf(fid, "s.k%d = ks ( :, %d );\n" , 1:N, 1:N); > fclose(fid) ; > source /dev/shm/look_ma_no_eval.m ; > unlink /dev/shm/look_ma_no_eval.m ; > > ;) > > > --judd > > > P.S. Don't do this. > > P.P.S. I have done this. /o\ From mjscosta at lnec.pt Fri Nov 6 02:39:56 2009 From: mjscosta at lnec.pt (=?ISO-8859-1?Q?M=E1rio_Costa?=) Date: Fri, 6 Nov 2009 08:39:56 +0000 Subject: Passing an array from java to octave In-Reply-To: <4AEF16F1.7010900@telecom.ntua.gr> References: <4AEF16F1.7010900@telecom.ntua.gr> Message-ID: <4292f1ce0911060039r578aa379u32a49e40c1551a07@mail.gmail.com> Hi, My guess would be that you must use JNI and convert a java array object to an octave array object ... Regards, M?rio On Mon, Nov 2, 2009 at 5:29 PM, George Kousiouris wrote: > Hi all, > > I want to pass a Java array to Octave, so that I can process the data > inside. Does anyone have an idea how this can be done? I have tried a > java to octave bridge (javaoctave-0.4.0.jar) however this seems to be > only for executing Octave commands inside a Java program and not > actually passing data from Java to Octave... > > Best regards, > George > > _______________________________________________ > Help-octave mailing list > Help-octave at octave.org > https://www-old.cae.wisc.edu/mailman/listinfo/help-octave > From highegg at gmail.com Fri Nov 6 03:51:23 2009 From: highegg at gmail.com (Jaroslav Hajek) Date: Fri, 6 Nov 2009 10:51:23 +0100 Subject: slow 'eval' function - maybe pointers would do? In-Reply-To: <2631C47B-D0F6-4EE4-B5BC-C2BC9B8CCE70@gmail.com> References: <12D4BAEF-7966-4EE4-9283-1E80708B688E@gmail.com> <5CDEBDC1-32B3-4DE4-A3A3-61310921A17F@gmail.com> <2631C47B-D0F6-4EE4-B5BC-C2BC9B8CCE70@gmail.com> Message-ID: <69d8d540911060151w24d05557r8a4367b4fd1263b3@mail.gmail.com> On Thu, Nov 5, 2009 at 11:00 PM, Guido Walter Pettinari wrote: > Hello everybody! > > Sorry for this late reply but I had much work to do in these days. > > Thank you for all the answers. It was very instructive to learn all > the methods to handle with field names; I find particularly useful > what Benjamin pointed out, that is the possibility to create/access a > field via strings by using the parentheses: > > for i = 1:N > field = sprintf ( 'something_%d', i ); > S.(field) = whatever(i); > endfor > > In this way the structures become really flexible! > > @Carlo >> but still I don't understand why you want to call your vectors >> S.ks_ii, >> I'm really curious: what's the problem with calling them KS{ii}? > > I want to call the vectors in that way because I want a struct where > the fields are just column vectors. I like to access everything in the > structure S by just typing S.k1 or S.k2 rather than S.KS{i}. This is > just a personal preference, probably because I mainly program in C++ > and I do not feel comfortable with cell arrays yet :) > > Cheers, > > Guido > While it probably won't matter until number get really big, you should also realize that the syntax S.ks{i} is not only more natural (requires no string manipulation whatsoever), it is also more efficient. When you give S a thousand fields ks1...ks1000, then s.ks200 requires a binary search in 1000 strings, while s.ks{i} doesn't. Your approach is asymptotically inferior. In other words, the arguments for using cell arrays are the same as for using arrays of numbers rather than name-mangled scalars. regards -- RNDr. Jaroslav Hajek computing expert & GNU Octave developer Aeronautical Research and Test Institute (VZLU) Prague, Czech Republic url: www.highegg.matfyz.cz From carlo.defalco at gmail.com Fri Nov 6 04:05:58 2009 From: carlo.defalco at gmail.com (Carlo de Falco) Date: Fri, 6 Nov 2009 11:05:58 +0100 Subject: [OT?] disabling automatic line-break in emacs octave-mode Message-ID: <83AD1D9E-26F8-4795-8B5C-3AAC63965596@gmail.com> Hi, I understand this is probably more of an emacs/lisp question but I hope someone on this list might also know a solution. I personally find the way emacs automatically breaks lines in octave- mode very annoying and I was looking for a way to disable it. Has anyone done this or know how to do it? Thanks, c. From Potorti at isti.cnr.it Fri Nov 6 04:17:05 2009 From: Potorti at isti.cnr.it (Francesco =?utf-8?Q?Potort=C3=AC?=) Date: Fri, 06 Nov 2009 11:17:05 +0100 Subject: [OT?] disabling automatic line-break in emacs octave-mode In-Reply-To: <83AD1D9E-26F8-4795-8B5C-3AAC63965596@gmail.com> References: <83AD1D9E-26F8-4795-8B5C-3AAC63965596@gmail.com> Message-ID: >I personally find the way emacs automatically breaks lines in octave- >mode very annoying and I was looking for a way to disable it. Put this into your /.emacs file: (add-hook 'octave-mode-hook (lambda () (auto-fill-mode 0))) -- Francesco Potort? (ricercatore) Voice: +39 050 315 3058 (op.2111) ISTI - Area della ricerca CNR Fax: +39 050 315 2040 via G. Moruzzi 1, I-56124 Pisa Email: Potorti at isti.cnr.it (entrance 20, 1st floor, room C71) Web: http://fly.isti.cnr.it/ From coccoinomane at gmail.com Fri Nov 6 04:28:54 2009 From: coccoinomane at gmail.com (Guido Walter Pettinari) Date: Fri, 6 Nov 2009 10:28:54 +0000 Subject: slow 'eval' function - maybe pointers would do? In-Reply-To: <69d8d540911060151w24d05557r8a4367b4fd1263b3@mail.gmail.com> References: <12D4BAEF-7966-4EE4-9283-1E80708B688E@gmail.com> <5CDEBDC1-32B3-4DE4-A3A3-61310921A17F@gmail.com> <2631C47B-D0F6-4EE4-B5BC-C2BC9B8CCE70@gmail.com> <69d8d540911060151w24d05557r8a4367b4fd1263b3@mail.gmail.com> Message-ID: <7CDD30DD-A98D-4F35-B4CF-41E5A9A1D237@gmail.com> Dear Jaroslav, I agree with you: I would never use my approach when the fields are more than, say, ~100. However, (i) I need only a few of S.ksi (ii) each of them is an array of numbers, not a scalar. I often access, modify and plot structures' fields at Octave prompt. I just feel that addressing the variables with their name (e.g. S.k1) rather than with an index (e.g. S.k{1}) is quicker to type and less prone to errors. For example, the command: plot ( S.k1, S.k2, '1x', S.k3, S.k4, '2x ) seems to me more easily typeable and readable than plot ( S.k{1}, S.k{2}, '1x', S.k{3}, S.k{4}, '2x ). Just a personal feeling :) I would like to abuse of your kindness by asking two mailing-list questions: 1) When I reply to a mailing-list message, am I supposed to reply to the sender of the post as well? For example, should I include your personal email-address in the 'to' field? 2) Is it possible to attach text files or images when sending e-mails to the mailing list? Are there limits? Thank you for your consideration. Regards, Guido On Nov 6, 2009, at 9:51 , Jaroslav Hajek wrote: > On Thu, Nov 5, 2009 at 11:00 PM, Guido Walter Pettinari > wrote: >> Hello everybody! >> >> Sorry for this late reply but I had much work to do in these days. >> >> Thank you for all the answers. It was very instructive to learn all >> the methods to handle with field names; I find particularly useful >> what Benjamin pointed out, that is the possibility to create/access a >> field via strings by using the parentheses: >> >> for i = 1:N >> field = sprintf ( 'something_%d', i ); >> S.(field) = whatever(i); >> endfor >> >> In this way the structures become really flexible! >> >> @Carlo >>> but still I don't understand why you want to call your vectors >>> S.ks_ii, >>> I'm really curious: what's the problem with calling them KS{ii}? >> >> I want to call the vectors in that way because I want a struct where >> the fields are just column vectors. I like to access everything in >> the >> structure S by just typing S.k1 or S.k2 rather than S.KS{i}. This is >> just a personal preference, probably because I mainly program in C++ >> and I do not feel comfortable with cell arrays yet :) >> >> Cheers, >> >> Guido >> > > While it probably won't matter until number get really big, you should > also realize that the syntax > S.ks{i} is not only more natural (requires no string manipulation > whatsoever), it is also more efficient. > When you give S a thousand fields ks1...ks1000, then s.ks200 requires > a binary search in 1000 strings, while > s.ks{i} doesn't. Your approach is asymptotically inferior. > In other words, the arguments for using cell arrays are the same as > for using arrays of numbers rather than name-mangled scalars. > > regards > > -- > RNDr. Jaroslav Hajek > computing expert & GNU Octave developer > Aeronautical Research and Test Institute (VZLU) > Prague, Czech Republic > url: www.highegg.matfyz.cz From carlo.defalco at gmail.com Fri Nov 6 04:38:20 2009 From: carlo.defalco at gmail.com (Carlo de Falco) Date: Fri, 6 Nov 2009 11:38:20 +0100 Subject: [OT?] disabling automatic line-break in emacs octave-mode In-Reply-To: References: <83AD1D9E-26F8-4795-8B5C-3AAC63965596@gmail.com> Message-ID: <7FEB2835-787F-4BAF-B8F5-09437D32A3E9@gmail.com> On 6 Nov 2009, at 11:17, Francesco Potort? wrote: >> I personally find the way emacs automatically breaks lines in octave- >> mode very annoying and I was looking for a way to disable it. > > Put this into your /.emacs file: > > (add-hook 'octave-mode-hook (lambda () (auto-fill-mode 0))) I found this in my .emacs: (add-hook 'octave-mode-hook (lambda () (abbrev-mode 1) (auto-fill-mode 1) (if (eq window-system 'x) (font-lock-mode 1)))) I changed (auto-fill-mode 1) to (auto-fill-mode 0) and it worked. great, thanks! c. From highegg at gmail.com Fri Nov 6 04:53:36 2009 From: highegg at gmail.com (Jaroslav Hajek) Date: Fri, 6 Nov 2009 11:53:36 +0100 Subject: slow 'eval' function - maybe pointers would do? In-Reply-To: <7CDD30DD-A98D-4F35-B4CF-41E5A9A1D237@gmail.com> References: <12D4BAEF-7966-4EE4-9283-1E80708B688E@gmail.com> <5CDEBDC1-32B3-4DE4-A3A3-61310921A17F@gmail.com> <2631C47B-D0F6-4EE4-B5BC-C2BC9B8CCE70@gmail.com> <69d8d540911060151w24d05557r8a4367b4fd1263b3@mail.gmail.com> <7CDD30DD-A98D-4F35-B4CF-41E5A9A1D237@gmail.com> Message-ID: <69d8d540911060253j27cb50c5gee1926dfec863795@mail.gmail.com> On Fri, Nov 6, 2009 at 11:28 AM, Guido Walter Pettinari wrote: > Dear Jaroslav, > > I agree with you: I would never use my approach when the fields are > more than, say, ~100. However, (i) I need only a few of S.ksi (ii) > each of them is an array of numbers, not a scalar. > > I often access, modify and plot structures' fields at Octave prompt. I > just feel that addressing the variables with their name (e.g. S.k1) > rather than with an index (e.g. S.k{1}) is quicker to type and less > prone to errors. For example, the command: > > plot ( S.k1, S.k2, '1x', S.k3, S.k4, '2x ) > > seems to me more easily typeable and readable than > > plot ( S.k{1}, S.k{2}, '1x', S.k{3}, S.k{4}, '2x ). > > Just a personal feeling :) > Easier to type, agreed. Easier to read, not. The former style conceals the fact that the numbers are in fact indices (in terms of the logic of your data). S.k_1 is already much better. > I would like to abuse of your kindness by asking two mailing-list > questions: > > 1) When I reply to a mailing-list message, am I supposed to reply to > the sender of the post as well? For example, should I include your > personal email-address in the 'to' field? I use "Reply To All", which puts your address as "To:" and the mailing list into "Cc". If you're responding to someone's else, message, it makes sense to direct the message to him and Cc the list. But writing just to the list is also possible. Sometimes the former may enable the reader to take a special action (for instance, I have a filter in Gmail that labels all messages from Octave lists, and another filter that also stars those messages that are directed to me, such as when someone replies to my comment). > 2) Is it possible to attach text files or images when sending e-mails > to the mailing list? Are there limits? Yes. Yes. I think the limit is 100kB or something like that. > Thank you for your consideration. > > Regards, > > Guido > > On Nov 6, 2009, at 9:51 , Jaroslav Hajek wrote: > >> On Thu, Nov 5, 2009 at 11:00 PM, Guido Walter Pettinari >> wrote: >>> Hello everybody! >>> >>> Sorry for this late reply but I had much work to do in these days. >>> >>> Thank you for all the answers. It was very instructive to learn all >>> the methods to handle with field names; I find particularly useful >>> what Benjamin pointed out, that is the possibility to create/access a >>> field via strings by using the parentheses: >>> >>> for i = 1:N >>> field = sprintf ( 'something_%d', i ); >>> S.(field) = whatever(i); >>> endfor >>> >>> In this way the structures become really flexible! >>> >>> @Carlo >>>> but still I don't understand why you want to call your vectors >>>> S.ks_ii, >>>> I'm really curious: what's the problem with calling them KS{ii}? >>> >>> I want to call the vectors in that way because I want a struct where >>> the fields are just column vectors. I like to access everything in >>> the >>> structure S by just typing S.k1 or S.k2 rather than S.KS{i}. This is >>> just a personal preference, probably because I mainly program in C++ >>> and I do not feel comfortable with cell arrays yet :) >>> >>> Cheers, >>> >>> Guido >>> >> >> While it probably won't matter until number get really big, you should >> also realize that the syntax >> S.ks{i} is not only more natural (requires no string manipulation >> whatsoever), it is also more efficient. >> When you give S a thousand fields ks1...ks1000, then s.ks200 requires >> a binary search in 1000 strings, while >> s.ks{i} doesn't. Your approach is asymptotically inferior. >> In other words, the arguments for using cell arrays are the same as >> for using arrays of numbers rather than name-mangled scalars. >> >> regards >> >> -- >> RNDr. Jaroslav Hajek >> computing expert & GNU Octave developer >> Aeronautical Research and Test Institute (VZLU) >> Prague, Czech Republic >> url: www.highegg.matfyz.cz > > _______________________________________________ > Help-octave mailing list > Help-octave at octave.org > https://www-old.cae.wisc.edu/mailman/listinfo/help-octave > -- RNDr. Jaroslav Hajek computing expert & GNU Octave developer Aeronautical Research and Test Institute (VZLU) Prague, Czech Republic url: www.highegg.matfyz.cz From coccoinomane at gmail.com Fri Nov 6 05:01:59 2009 From: coccoinomane at gmail.com (Guido Walter Pettinari) Date: Fri, 6 Nov 2009 11:01:59 +0000 Subject: slow 'eval' function - maybe pointers would do? In-Reply-To: <69d8d540911060253j27cb50c5gee1926dfec863795@mail.gmail.com> References: <12D4BAEF-7966-4EE4-9283-1E80708B688E@gmail.com> <5CDEBDC1-32B3-4DE4-A3A3-61310921A17F@gmail.com> <2631C47B-D0F6-4EE4-B5BC-C2BC9B8CCE70@gmail.com> <69d8d540911060151w24d05557r8a4367b4fd1263b3@mail.gmail.com> <7CDD30DD-A98D-4F35-B4CF-41E5A9A1D237@gmail.com> <69d8d540911060253j27cb50c5gee1926dfec863795@mail.gmail.com> Message-ID: <84639DC3-953C-4D5B-A02F-E01F5C4B671B@gmail.com> Thank you for the quick answer! I thought that using "Reply To All" would upset somebody, and I am happy to know that this is not the case. Cheers, Guido On 6 Nov 2009, at 10:53, Jaroslav Hajek wrote: > On Fri, Nov 6, 2009 at 11:28 AM, Guido Walter Pettinari > wrote: >> Dear Jaroslav, >> >> I agree with you: I would never use my approach when the fields are >> more than, say, ~100. However, (i) I need only a few of S.ksi (ii) >> each of them is an array of numbers, not a scalar. >> >> I often access, modify and plot structures' fields at Octave >> prompt. I >> just feel that addressing the variables with their name (e.g. S.k1) >> rather than with an index (e.g. S.k{1}) is quicker to type and less >> prone to errors. For example, the command: >> >> plot ( S.k1, S.k2, '1x', S.k3, S.k4, '2x ) >> >> seems to me more easily typeable and readable than >> >> plot ( S.k{1}, S.k{2}, '1x', S.k{3}, S.k{4}, '2x ). >> >> Just a personal feeling :) >> > > Easier to type, agreed. Easier to read, not. The former style conceals > the fact that the numbers are in fact indices (in terms of the logic > of your data). S.k_1 is already much better. > > >> I would like to abuse of your kindness by asking two mailing-list >> questions: >> >> 1) When I reply to a mailing-list message, am I supposed to reply to >> the sender of the post as well? For example, should I include your >> personal email-address in the 'to' field? > > I use "Reply To All", which puts your address as "To:" and the mailing > list into "Cc". If you're responding to someone's else, message, it > makes sense to direct the message to him and Cc the list. But writing > just to the list is also possible. > Sometimes the former may enable the reader to take a special action > (for instance, I have a filter in Gmail that labels all messages from > Octave lists, and another filter that also stars those messages that > are directed to me, such as when someone replies to my comment). > >> 2) Is it possible to attach text files or images when sending e-mails >> to the mailing list? Are there limits? > > Yes. Yes. I think the limit is 100kB or something like that. > >> Thank you for your consideration. >> >> Regards, >> >> Guido >> >> On Nov 6, 2009, at 9:51 , Jaroslav Hajek wrote: >> >>> On Thu, Nov 5, 2009 at 11:00 PM, Guido Walter Pettinari >>> wrote: >>>> Hello everybody! >>>> >>>> Sorry for this late reply but I had much work to do in these days. >>>> >>>> Thank you for all the answers. It was very instructive to learn all >>>> the methods to handle with field names; I find particularly useful >>>> what Benjamin pointed out, that is the possibility to create/ >>>> access a >>>> field via strings by using the parentheses: >>>> >>>> for i = 1:N >>>> field = sprintf ( 'something_%d', i ); >>>> S.(field) = whatever(i); >>>> endfor >>>> >>>> In this way the structures become really flexible! >>>> >>>> @Carlo >>>>> but still I don't understand why you want to call your vectors >>>>> S.ks_ii, >>>>> I'm really curious: what's the problem with calling them KS{ii}? >>>> >>>> I want to call the vectors in that way because I want a struct >>>> where >>>> the fields are just column vectors. I like to access everything in >>>> the >>>> structure S by just typing S.k1 or S.k2 rather than S.KS{i}. This >>>> is >>>> just a personal preference, probably because I mainly program in C >>>> ++ >>>> and I do not feel comfortable with cell arrays yet :) >>>> >>>> Cheers, >>>> >>>> Guido >>>> >>> >>> While it probably won't matter until number get really big, you >>> should >>> also realize that the syntax >>> S.ks{i} is not only more natural (requires no string manipulation >>> whatsoever), it is also more efficient. >>> When you give S a thousand fields ks1...ks1000, then s.ks200 >>> requires >>> a binary search in 1000 strings, while >>> s.ks{i} doesn't. Your approach is asymptotically inferior. >>> In other words, the arguments for using cell arrays are the same as >>> for using arrays of numbers rather than name-mangled scalars. >>> >>> regards >>> >>> -- >>> RNDr. Jaroslav Hajek >>> computing expert & GNU Octave developer >>> Aeronautical Research and Test Institute (VZLU) >>> Prague, Czech Republic >>> url: www.highegg.matfyz.cz >> >> _______________________________________________ >> Help-octave mailing list >> Help-octave at octave.org >> https://www-old.cae.wisc.edu/mailman/listinfo/help-octave >> > > > > -- > RNDr. Jaroslav Hajek > computing expert & GNU Octave developer > Aeronautical Research and Test Institute (VZLU) > Prague, Czech Republic > url: www.highegg.matfyz.cz From l.butler at ed.ac.uk Fri Nov 6 05:13:25 2009 From: l.butler at ed.ac.uk (Leo Butler) Date: Fri, 6 Nov 2009 11:13:25 +0000 (GMT) Subject: [OT?] disabling automatic line-break in emacs octave-mode In-Reply-To: References: <83AD1D9E-26F8-4795-8B5C-3AAC63965596@gmail.com> Message-ID: On Fri, 6 Nov 2009, Francesco Potort? wrote: < >I personally find the way emacs automatically breaks lines in octave- < >mode very annoying and I was looking for a way to disable it. < < Put this into your /.emacs file: < < (add-hook 'octave-mode-hook (lambda () (auto-fill-mode 0))) The default column width in emacs in 70 characters including the newline. This is usually pretty small. You can reset this by C-u 200 C-xf (C-u is control-u, etc.) or by the elisp command (set-fill-column 200) Both enlarge the column width to 200. auto-fill-mode is too useful in general to just turn-off, imo. So I often reset the fill-column, input some lines I don't want broken, then reset to the default. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From nuovodna at gmail.com Fri Nov 6 06:08:44 2009 From: nuovodna at gmail.com (Emanuele T.) Date: Fri, 6 Nov 2009 13:08:44 +0100 Subject: Pulse function in a LSODE system Message-ID: <1a403ba70911060408v341b0cb9rf18a74dd2d2ff22f@mail.gmail.com> Hi, i'd like to introduce in my differential equations a parameter that assumes specific value (a function of one or more solution of my sistem) every 5 time step. I attach you my code. I have no clearfull ideas on time step: if I print my variable "t" it returns me some decimal value. Thanks in advance E.T. -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091106/4eb4ebc5/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: esempio.m Type: text/x-objcsrc Size: 466 bytes Desc: not available Url : https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091106/4eb4ebc5/attachment.bin From Potorti at isti.cnr.it Fri Nov 6 06:36:35 2009 From: Potorti at isti.cnr.it (Francesco =?utf-8?Q?Potort=C3=AC?=) Date: Fri, 06 Nov 2009 13:36:35 +0100 Subject: [OT?] disabling automatic line-break in emacs octave-mode In-Reply-To: References: <83AD1D9E-26F8-4795-8B5C-3AAC63965596@gmail.com> Message-ID: >< (add-hook 'octave-mode-hook (lambda () (auto-fill-mode 0))) > >The default column width in emacs in 70 characters including the >newline. This is usually pretty small. You can reset this by > >C-u 200 C-xf > >(C-u is control-u, etc.) > >or by the elisp command > >(set-fill-column 200) > >Both enlarge the column width to 200. > >auto-fill-mode is too useful in general to just turn-off, imo. So I >often reset the fill-column, input some lines I don't want broken, then >reset to the default. I have this: (global-set-key "\C-ca" 'auto-fill-mode) I use it routinely to set and reset auto-fill-mode by hitting C-c a. -- Francesco Potort? (ricercatore) Voice: +39 050 315 3058 (op.2111) ISTI - Area della ricerca CNR Fax: +39 050 315 2040 via G. Moruzzi 1, I-56124 Pisa Email: Potorti at isti.cnr.it (entrance 20, 1st floor, room C71) Web: http://fly.isti.cnr.it/ From agl1e09 at soton.ac.uk Fri Nov 6 12:14:51 2009 From: agl1e09 at soton.ac.uk (Loengarov A.G.) Date: Fri, 6 Nov 2009 18:14:51 +0000 Subject: How to stop console outputting executable path? Message-ID: <76DC722ABC4C8840B38F55A05BBC77F463E6B82CCB@UOS-CL-EX7-L3.soton.ac.uk> Hello folks, Just a simple newbie question: after installation in Win XP, the console adds "octave-3.2.3.exe:26:C:\Octave\3.2.3_gcc4.4.0\bin" each time it outputs anything, which gets spammy. How can I change this? Thanks a lot! From l.butler at ed.ac.uk Fri Nov 6 12:30:23 2009 From: l.butler at ed.ac.uk (Leo Butler) Date: Fri, 6 Nov 2009 18:30:23 +0000 (GMT) Subject: How to stop console outputting executable path? In-Reply-To: <76DC722ABC4C8840B38F55A05BBC77F463E6B82CCB@UOS-CL-EX7-L3.soton.ac.uk> References: <76DC722ABC4C8840B38F55A05BBC77F463E6B82CCB@UOS-CL-EX7-L3.soton.ac.uk> Message-ID: On Fri, 6 Nov 2009, Loengarov A.G. wrote: < Hello folks, < < Just a simple newbie question: after installation in Win XP, the console adds "octave-3.2.3.exe:26:C:\Octave\3.2.3_gcc4.4.0\bin" each time it outputs anything, which gets spammy. How can I change this? < < Thanks a lot! Try help PS1 This will explain how to customise the prompt. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From claudio.belotti at gmail.com Fri Nov 6 15:32:45 2009 From: claudio.belotti at gmail.com (Claudio Belotti) Date: Fri, 6 Nov 2009 21:32:45 +0000 Subject: writing ncdf file with octcdf Message-ID: <85a7e6b30911061332v44d41343n4fb24581c8cb9285@mail.gmail.com> hi, I'm unable to write values to a netcdf variable as described in example_netcdf http://octave.svn.sourceforge.net/viewvc/octave/trunk/octave-forge/main/octcdf/inst/example_netcdf.m?revision=HEAD&content-type=text/plain nc{'longitude'}(:) = longitude; error: a cs-list cannot be further indexed GNU Octave, version 3.2.3 octcdf-1.0.13 any suggestion? thanks Claudio From balteo at gmail.com Sat Nov 7 01:28:19 2009 From: balteo at gmail.com (Julien Martin) Date: Sat, 7 Nov 2009 08:28:19 +0100 Subject: Beginner needs help with following syntax: Message-ID: <1460a1a20911062328n48d34ebcp30cc5b79092e5b56@mail.gmail.com> Hello, I have the following matlab code that I am trying to run under octave: *1. function B=Binaire(p) 2. U= rand; 3. B=(U<=p); 4. end* Can anyone please translate line 3. into plain English? Thanks in advance, Julien. -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091107/455a740d/attachment.html From soren at hauberg.org Sat Nov 7 02:14:10 2009 From: soren at hauberg.org (=?ISO-8859-1?Q?S=F8ren?= Hauberg) Date: Sat, 07 Nov 2009 09:14:10 +0100 Subject: Beginner needs help with following syntax: In-Reply-To: <1460a1a20911062328n48d34ebcp30cc5b79092e5b56@mail.gmail.com> References: <1460a1a20911062328n48d34ebcp30cc5b79092e5b56@mail.gmail.com> Message-ID: <1257581650.18756.1.camel@hauberg-laptop> l?r, 07 11 2009 kl. 08:28 +0100, skrev Julien Martin: > 3. B=(U<=p); This is the same as writing if (U <= p) B = 1; else B = 0; endif S?ren From highegg at gmail.com Sat Nov 7 02:32:20 2009 From: highegg at gmail.com (Jaroslav Hajek) Date: Sat, 7 Nov 2009 09:32:20 +0100 Subject: writing ncdf file with octcdf In-Reply-To: <85a7e6b30911061332v44d41343n4fb24581c8cb9285@mail.gmail.com> References: <85a7e6b30911061332v44d41343n4fb24581c8cb9285@mail.gmail.com> Message-ID: <69d8d540911070032i132f605w12765988e9ca4858@mail.gmail.com> On Fri, Nov 6, 2009 at 10:32 PM, Claudio Belotti wrote: > hi, > I'm unable to write values to a netcdf variable > as described in example_netcdf > http://octave.svn.sourceforge.net/viewvc/octave/trunk/octave-forge/main/octcdf/inst/example_netcdf.m?revision=HEAD&content-type=text/plain > > nc{'longitude'}(:) = longitude; > error: a cs-list cannot be further indexed > > GNU Octave, version 3.2.3 > octcdf-1.0.13 > > any suggestion? > thanks > Claudio > _______________________________________________ > Help-octave mailing list > Help-octave at octave.org > https://www-old.cae.wisc.edu/mailman/listinfo/help-octave > I think this problem is solved in 3.3.50+. -- RNDr. Jaroslav Hajek computing expert & GNU Octave developer Aeronautical Research and Test Institute (VZLU) Prague, Czech Republic url: www.highegg.matfyz.cz From balteo at gmail.com Sat Nov 7 02:39:17 2009 From: balteo at gmail.com (Julien Martin) Date: Sat, 7 Nov 2009 09:39:17 +0100 Subject: Beginner needs help with following syntax: In-Reply-To: <1257581650.18756.1.camel@hauberg-laptop> References: <1460a1a20911062328n48d34ebcp30cc5b79092e5b56@mail.gmail.com> <1257581650.18756.1.camel@hauberg-laptop> Message-ID: <1460a1a20911070039q5aaf2348y8e559699a7220ca3@mail.gmail.com> Thanks Soren! 2009/11/7 S?ren Hauberg > l?r, 07 11 2009 kl. 08:28 +0100, skrev Julien Martin: > > 3. B=(U<=p); > > This is the same as writing > > if (U <= p) > B = 1; > else > B = 0; > endif > > S?ren > > -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091107/37665044/attachment.html From Potorti at isti.cnr.it Sat Nov 7 02:41:10 2009 From: Potorti at isti.cnr.it (Francesco =?utf-8?Q?Potort=C3=AC?=) Date: Sat, 07 Nov 2009 09:41:10 +0100 Subject: Beginner needs help with following syntax: In-Reply-To: <1257581650.18756.1.camel@hauberg-laptop> References: <1460a1a20911062328n48d34ebcp30cc5b79092e5b56@mail.gmail.com> <1257581650.18756.1.camel@hauberg-laptop> Message-ID: >> 3. B=(U<=p); > >This is the same as writing > > if (U <= p) > B = 1; > else > B = 0; > endif Almost. In the first case, one gets: octave> typeinfo(B) ans = bool while in the second case one gets: octave> typeinfo(B) ans = scalar To be just the same, your example should be: if (U <= p) B = true; else B = false; endif -- Francesco Potort? (ricercatore) Voice: +39 050 315 3058 (op.2111) ISTI - Area della ricerca CNR Fax: +39 050 315 2040 via G. Moruzzi 1, I-56124 Pisa Email: Potorti at isti.cnr.it (entrance 20, 1st floor, room C71) Web: http://fly.isti.cnr.it/ From claudio.belotti at gmail.com Sat Nov 7 06:58:12 2009 From: claudio.belotti at gmail.com (Claudio Belotti) Date: Sat, 7 Nov 2009 12:58:12 +0000 Subject: writing ncdf file with octcdf In-Reply-To: <69d8d540911070032i132f605w12765988e9ca4858@mail.gmail.com> References: <85a7e6b30911061332v44d41343n4fb24581c8cb9285@mail.gmail.com> <69d8d540911070032i132f605w12765988e9ca4858@mail.gmail.com> Message-ID: <85a7e6b30911070458p70d87748y4e3a2fc448605977@mail.gmail.com> thanks! On Sat, Nov 7, 2009 at 08:32, Jaroslav Hajek wrote: > On Fri, Nov 6, 2009 at 10:32 PM, Claudio Belotti > wrote: >> hi, >> I'm unable to write values to a netcdf variable >> as described in example_netcdf >> http://octave.svn.sourceforge.net/viewvc/octave/trunk/octave-forge/main/octcdf/inst/example_netcdf.m?revision=HEAD&content-type=text/plain >> >> nc{'longitude'}(:) = longitude; >> error: a cs-list cannot be further indexed >> >> GNU Octave, version 3.2.3 >> octcdf-1.0.13 >> >> any suggestion? >> thanks >> Claudio >> _______________________________________________ >> Help-octave mailing list >> Help-octave at octave.org >> https://www-old.cae.wisc.edu/mailman/listinfo/help-octave >> > > I think this problem is solved in 3.3.50+. > > > -- > RNDr. Jaroslav Hajek > computing expert & GNU Octave developer > Aeronautical Research and Test Institute (VZLU) > Prague, Czech Republic > url: www.highegg.matfyz.cz > From bharat at arithos.com Sat Nov 7 08:17:59 2009 From: bharat at arithos.com (bharat pathak) Date: Sat, 7 Nov 2009 19:47:59 +0530 Subject: Beginner needs help with following syntax: References: <1460a1a20911062328n48d34ebcp30cc5b79092e5b56@mail.gmail.com> Message-ID: hello julien p is the threshold parameter that is passed as an input to the function. let us assmue it's value is 0.5 p = 0.5 now every time you call the function from main environment or m-file, a random number in the range of [0 to 1] is generated in line 2, and this value is assigned to variable U on line 3 the generated random number is compared with threshold. in this example we assume p = 0.5. hence if the generated random number U happens to be less than or equal to threshold p, then value of B is 1, else the value of B is 0. hence this code helps in generation of binary random number based on the provided threshold. regards bharat From: Julien Martin Sent: Saturday, November 07, 2009 12:58 PM To: help-octave at octave.org Subject: Beginner needs help with following syntax: Hello, I have the following matlab code that I am trying to run under octave: 1. function B=Binaire(p) 2. U= rand; 3. B=(U<=p); 4. end Can anyone please translate line 3. into plain English? Thanks in advance, Julien. -------------------------------------------------------------------------------- _______________________________________________ Help-octave mailing list Help-octave at octave.org https://www-old.cae.wisc.edu/mailman/listinfo/help-octave -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091107/095668d6/attachment-0001.html From frenk.calza at gmail.com Sat Nov 7 12:13:43 2009 From: frenk.calza at gmail.com (franco basaglia) Date: Sat, 7 Nov 2009 19:13:43 +0100 Subject: octave and delay ode's In-Reply-To: References: <59CCC399-AC46-45F9-AD93-A0643AFC0EA8@gmail.com> <55A3A9EF-0C56-4091-A6AE-8A126012CD71@gmail.com> <2ED5382C-8DFA-45C1-BD40-00DD0EE986FC@gmail.com> <4AEF326D.1070406@gmx.net> <970DCC2C-F189-43B7-AD47-8D847899D89B@gmail.com> <4AF2F3BC.8040409@gmx.net> Message-ID: Thank you all for your work. I have a last question. I'd convert my ode system to a discrete-time system with annual time step. In thsi way I can simplify my delay question. What is the octave solver to use? How can I plan the system in Octave? The discrete system is something like that: y1(t) = y1(t-1) -y1(t) y2(t) = y2(t-1) -y2(t) + y1(t-5) y3(t) = t3(t-1) -y3(t) + y2(t-10)*y1(t-10) Thank you best regards f.b. 2009/11/5 Carlo de Falco > > On 5 Nov 2009, at 16:48, Thomas Treichl wrote: > > Carlo de Falco schrieb: >> >>> Thomas, >>> On 2 Nov 2009, at 20:26, Thomas Treichl wrote: >>> >>>> Because there is an "ode" in the subject of the email, yes, but I also >>>> must say that I currently don't have the time to dig into this problem and >>>> can only provide a short answer: if the above equations form the DDE problem >>>> then Carlo's implementation does make more sense to me. >>>> >>> Thanks for your answer, I was not 100% sure I was doing things correctly >>> as >>> it seems to me that the case of mutiple delays is not fully clear from >>> the documentation (I looked at the implementation to find out the meaning of >>> LAGS). >>> So if you believe my interpretation was correct, would you mind if I >>> commit the patch below to improve the documentation of the DDE functions? >>> >> >> These changes would be an improvement. >> Can you please make these changes also for ode45d, ode54d and ode78d? >> >> Thanks, Thomas >> > > I checked-in the patch below, > c. > > Index: ode45d.m > =================================================================== > --- ode45d.m (revision 6438) > +++ ode45d.m (revision 6439) > @@ -23,20 +23,54 @@ > %# > %# If this function is called with no return argument then plot the > solution over time in a figure window while solving the set of DDEs that are > defined in a function and specified by the function handle @var{@@fun}. > The second input argument @var{slot} is a double vector that defines the > time slot, @var{init} is a double vector that defines the initial values of > the states, @var{lags} is a double vector that describes the lags of time, > @var{hist} is a double matrix and describes the history of the DDEs, > @var{opt} can optionally be a structure array that keeps the options created > with the command @command{odeset} and @var{par1}, @var{par2}, @dots{} can > optionally be other input arguments of any type that have to be passed to > the function defined by @var{@@fun}. > %# > +%# In other words, this function will solve a problem of the form > +%# @example > +%# dy/dt = fun (t, y(t), y(t-lags(1), y(t-lags(2), @dots{}))) > +%# y(slot(1)) = init > +%# y(slot(1)-lags(1)) = hist(1), y(slot(1)-lags(2)) = hist(2), @dots{} > +%# @end example > +%# > %# If this function is called with one return argument then return the > solution @var{sol} of type structure array after solving the set of DDEs. > The solution @var{sol} has the fields @var{x} of type double column vector > for the steps chosen by the solver, @var{y} of type double column vector for > the solutions at each time step of @var{x}, @var{solver} of type string for > the solver name and optionally the extended time stamp information @var{xe}, > the extended solution information @var{ye} and the extended index > information @var{ie} all of type double column vector that keep the > informations of the event function if an event function handle is set in the > option argument @var{opt}. > %# > %# If this function is called with more than one return argument then > return the time stamps @var{t}, the solution values @var{y} and optionally > the extended time stamp information @var{xe}, the extended solution > information @var{ye} and the extended index information @var{ie} all of type > double column vector. > %# > -%# For example, solve an anonymous implementation of a chaotic behavior > +%# For example: > +%# @itemize @minus > +%# @item > +%# the following code solves an anonymous implementation of a chaotic > behavior > +%# > %# @example > %# fcao = @@(vt, vy, vz) [2 * vz / (1 + vz^9.65) - vy]; > %# > -%# vopt = odeset ("NormControl", "on", "RelTol", 1e-4); > +%# vopt = odeset ("NormControl", "on", "RelTol", 1e-3); > %# vsol = ode45d (fcao, [0, 100], 0.5, 2, 0.5, vopt); > %# > %# vlag = interp1 (vsol.x, vsol.y, vsol.x - 2); > %# plot (vsol.y, vlag); legend ("fcao (t,y,z)"); > %# @end example > +%# > +%# @item > +%# to solve the following problem with two delayed state variables > +%# > +%# @example > +%# d y1(t)/ dt = -y1(t) > > +%# d y2(t)/ dt = -y2(t) + y1(t-5) > +%# d y3(t)/dt = -y3(t) + y2(t-10)*y1(t-10) > +%# @end example > +%# > +%# one might do the following > +%# > +%# @example > +%# function f = fun (t, y, yd) > > +%# f(1) =-y(1); %% y1' = -y1(t) > +%# f(2) =-y(2) + yd(1,1); %% y2' = -y2(t) + y1(t-lags(1)) > +%# f(3) =-y(3) + yd(2,2)*yd(1,2); %% y3' = -y3(t) + > y2(t-lags(2))*y1(t-lags(2)) > +%# endfunction > +%# T = [0,20] > +%# res = ode45d (@fun, t, [1;1;1], [5, 10], ones (3,2)); > +%# @end example > +%# > +%# @end itemize > %# @end deftypefn > %# > %# @seealso{odepkg} > Index: ode54d.m > =================================================================== > --- ode54d.m (revision 6438) > +++ ode54d.m (revision 6439) > @@ -23,11 +23,21 @@ > %# > %# If this function is called with no return argument then plot the > solution over time in a figure window while solving the set of DDEs that are > defined in a function and specified by the function handle @var{@@fun}. > The second input argument @var{slot} is a double vector that defines the > time slot, @var{init} is a double vector that defines the initial values of > the states, @var{lags} is a double vector that describes the lags of time, > @var{hist} is a double matrix and describes the history of the DDEs, > @var{opt} can optionally be a structure array that keeps the options created > with the command @command{odeset} and @var{par1}, @var{par2}, @dots{} can > optionally be other input arguments of any type that have to be passed to > the function defined by @var{@@fun}. > %# > +%# In other words, this function will solve a problem of the form > +%# @example > +%# dy/dt = fun (t, y(t), y(t-lags(1), y(t-lags(2), @dots{}))) > +%# y(slot(1)) = init > +%# y(slot(1)-lags(1)) = hist(1), y(slot(1)-lags(2)) = hist(2), @dots{} > +%# @end example > +%# > %# If this function is called with one return argument then return the > solution @var{sol} of type structure array after solving the set of DDEs. > The solution @var{sol} has the fields @var{x} of type double column vector > for the steps chosen by the solver, @var{y} of type double column vector for > the solutions at each time step of @var{x}, @var{solver} of type string for > the solver name and optionally the extended time stamp information @var{xe}, > the extended solution information @var{ye} and the extended index > information @var{ie} all of type double column vector that keep the > informations of the event function if an event function handle is set in the > option argument @var{opt}. > %# > %# If this function is called with more than one return argument then > return the time stamps @var{t}, the solution values @var{y} and optionally > the extended time stamp information @var{xe}, the extended solution > information @var{ye} and the extended index information @var{ie} all of type > double column vector. > %# > -%# For example, solve an anonymous implementation of a chaotic behavior > +%# For example: > +%# @itemize @minus > +%# @item > +%# the following code solves an anonymous implementation of a chaotic > behavior > %# @example > %# fcao = @@(vt, vy, vz) [2 * vz / (1 + vz^9.65) - vy]; > %# > @@ -37,6 +47,29 @@ > %# vlag = interp1 (vsol.x, vsol.y, vsol.x - 2); > %# plot (vsol.y, vlag); legend ("fcao (t,y,z)"); > %# @end example > +%# > +%# @item > +%# to solve the following problem with two delayed state variables > +%# > +%# @example > +%# d y1(t)/ dt = -y1(t) > > +%# d y2(t)/ dt = -y2(t) + y1(t-5) > +%# d y3(t)/dt = -y3(t) + y2(t-10)*y1(t-10) > +%# @end example > +%# > +%# one might do the following > +%# > +%# @example > +%# function f = fun (t, y, yd) > > +%# f(1) =-y(1); %% y1' = -y1(t) > +%# f(2) =-y(2) + yd(1,1); %% y2' = -y2(t) + y1(t-lags(1)) > +%# f(3) =-y(3) + yd(2,2)*yd(1,2); %% y3' = -y3(t) + > y2(t-lags(2))*y1(t-lags(2)) > +%# endfunction > +%# T = [0,20] > +%# res = ode54d (@fun, t, [1;1;1], [5, 10], ones (3,2)); > +%# @end example > +%# > +%# @end itemize > %# @end deftypefn > %# > %# @seealso{odepkg} > Index: ode78d.m > =================================================================== > --- ode78d.m (revision 6438) > +++ ode78d.m (revision 6439) > @@ -23,11 +23,21 @@ > %# > %# If this function is called with no return argument then plot the > solution over time in a figure window while solving the set of DDEs that are > defined in a function and specified by the function handle @var{@@fun}. > The second input argument @var{slot} is a double vector that defines the > time slot, @var{init} is a double vector that defines the initial values of > the states, @var{lags} is a double vector that describes the lags of time, > @var{hist} is a double matrix and describes the history of the DDEs, > @var{opt} can optionally be a structure array that keeps the options created > with the command @command{odeset} and @var{par1}, @var{par2}, @dots{} can > optionally be other input arguments of any type that have to be passed to > the function defined by @var{@@fun}. > %# > +%# In other words, this function will solve a problem of the form > +%# @example > +%# dy/dt = fun (t, y(t), y(t-lags(1), y(t-lags(2), @dots{}))) > +%# y(slot(1)) = init > +%# y(slot(1)-lags(1)) = hist(1), y(slot(1)-lags(2)) = hist(2), @dots{} > +%# @end example > +%# > %# If this function is called with one return argument then return the > solution @var{sol} of type structure array after solving the set of DDEs. > The solution @var{sol} has the fields @var{x} of type double column vector > for the steps chosen by the solver, @var{y} of type double column vector for > the solutions at each time step of @var{x}, @var{solver} of type string for > the solver name and optionally the extended time stamp information @var{xe}, > the extended solution information @var{ye} and the extended index > information @var{ie} all of type double column vector that keep the > informations of the event function if an event function handle is set in the > option argument @var{opt}. > %# > %# If this function is called with more than one return argument then > return the time stamps @var{t}, the solution values @var{y} and optionally > the extended time stamp information @var{xe}, the extended solution > information @var{ye} and the extended index information @var{ie} all of type > double column vector. > %# > -%# For example, solve an anonymous implementation of a chaotic behavior > +%# For example: > +%# @itemize @minus > +%# @item > +%# the following code solves an anonymous implementation of a chaotic > behavior > %# @example > %# fcao = @@(vt, vy, vz) [2 * vz / (1 + vz^9.65) - vy]; > %# > @@ -37,6 +47,29 @@ > %# vlag = interp1 (vsol.x, vsol.y, vsol.x - 2); > %# plot (vsol.y, vlag); legend ("fcao (t,y,z)"); > %# @end example > +%# > +%# @item > +%# to solve the following problem with two delayed state variables > +%# > +%# @example > +%# d y1(t)/ dt = -y1(t) > > +%# d y2(t)/ dt = -y2(t) + y1(t-5) > +%# d y3(t)/dt = -y3(t) + y2(t-10)*y1(t-10) > +%# @end example > +%# > +%# one might do the following > +%# > +%# @example > +%# function f = fun (t, y, yd) > > +%# f(1) =-y(1); %% y1' = -y1(t) > +%# f(2) =-y(2) + yd(1,1); %% y2' = -y2(t) + y1(t-lags(1)) > +%# f(3) =-y(3) + yd(2,2)*yd(1,2); %% y3' = -y3(t) + > y2(t-lags(2))*y1(t-lags(2)) > +%# endfunction > +%# T = [0,20] > +%# res = ode78d (@fun, t, [1;1;1], [5, 10], ones (3,2)); > +%# @end example > +%# > +%# @end itemize > %# @end deftypefn > %# > %# @seealso{odepkg} > Index: ode23d.m > =================================================================== > --- ode23d.m (revision 6438) > +++ ode23d.m (revision 6439) > @@ -23,11 +23,22 @@ > %# > %# If this function is called with no return argument then plot the > solution over time in a figure window while solving the set of DDEs that are > defined in a function and specified by the function handle @var{@@fun}. > The second input argument @var{slot} is a double vector that defines the > time slot, @var{init} is a double vector that defines the initial values of > the states, @var{lags} is a double vector that describes the lags of time, > @var{hist} is a double matrix and describes the history of the DDEs, > @var{opt} can optionally be a structure array that keeps the options created > with the command @command{odeset} and @var{par1}, @var{par2}, @dots{} can > optionally be other input arguments of any type that have to be passed to > the function defined by @var{@@fun}. > %# > +%# In other words, this function will solve a problem of the form > +%# @example > +%# dy/dt = fun (t, y(t), y(t-lags(1), y(t-lags(2), @dots{}))) > +%# y(slot(1)) = init > +%# y(slot(1)-lags(1)) = hist(1), y(slot(1)-lags(2)) = hist(2), @dots{} > +%# @end example > +%# > %# If this function is called with one return argument then return the > solution @var{sol} of type structure array after solving the set of DDEs. > The solution @var{sol} has the fields @var{x} of type double column vector > for the steps chosen by the solver, @var{y} of type double column vector for > the solutions at each time step of @var{x}, @var{solver} of type string for > the solver name and optionally the extended time stamp information @var{xe}, > the extended solution information @var{ye} and the extended index > information @var{ie} all of type double column vector that keep the > informations of the event function if an event function handle is set in the > option argument @var{opt}. > %# > %# If this function is called with more than one return argument then > return the time stamps @var{t}, the solution values @var{y} and optionally > the extended time stamp information @var{xe}, the extended solution > information @var{ye} and the extended index information @var{ie} all of type > double column vector. > %# > -%# For example, solve an anonymous implementation of a chaotic behavior > +%# For example: > +%# @itemize @minus > +%# @item > +%# the following code solves an anonymous implementation of a chaotic > behavior > +%# > %# @example > %# fcao = @@(vt, vy, vz) [2 * vz / (1 + vz^9.65) - vy]; > %# > @@ -37,6 +48,29 @@ > %# vlag = interp1 (vsol.x, vsol.y, vsol.x - 2); > %# plot (vsol.y, vlag); legend ("fcao (t,y,z)"); > %# @end example > +%# > +%# @item > +%# to solve the following problem with two delayed state variables > +%# > +%# @example > +%# d y1(t)/ dt = -y1(t) > > +%# d y2(t)/ dt = -y2(t) + y1(t-5) > +%# d y3(t)/dt = -y3(t) + y2(t-10)*y1(t-10) > +%# @end example > +%# > +%# one might do the following > +%# > +%# @example > +%# function f = fun (t, y, yd) > > +%# f(1) =-y(1); %% y1' = -y1(t) > +%# f(2) =-y(2) + yd(1,1); %% y2' = -y2(t) + y1(t-lags(1)) > +%# f(3) =-y(3) + yd(2,2)*yd(1,2); %% y3' = -y3(t) + > y2(t-lags(2))*y1(t-lags(2)) > +%# endfunction > +%# T = [0,20] > +%# res = ode23d (@fun, t, [1;1;1], [5, 10], ones (3,2)); > +%# @end example > +%# > +%# @end itemize > %# @end deftypefn > %# > %# @seealso{odepkg} > > -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091107/8fdc214d/attachment-0001.html From carlo.defalco at gmail.com Sat Nov 7 13:08:56 2009 From: carlo.defalco at gmail.com (Carlo de Falco) Date: Sat, 7 Nov 2009 20:08:56 +0100 Subject: octave and delay ode's In-Reply-To: References: <59CCC399-AC46-45F9-AD93-A0643AFC0EA8@gmail.com> <55A3A9EF-0C56-4091-A6AE-8A126012CD71@gmail.com> <2ED5382C-8DFA-45C1-BD40-00DD0EE986FC@gmail.com> <4AEF326D.1070406@gmx.net> <970DCC2C-F189-43B7-AD47-8D847899D89B@gmail.com> <4AF2F3BC.8040409@gmx.net> Message-ID: On 7 Nov 2009, at 19:13, franco basaglia wrote: > Thank you all for your work. > > I have a last question. > I'd convert my ode system to a discrete-time system > with annual time step. In thsi way I can simplify my delay question. > > What is the octave solver to use? How can I plan the system in > Octave? > > The discrete system is something like that: > > y1(t) = y1(t-1) -y1(t) > y2(t) = y2(t-1) -y2(t) + y1(t-5) > y3(t) = t3(t-1) -y3(t) + y2(t-10)*y1(t-10) > what you have written above is the Backward-Euler method applied to your differential system. to implement it in Octave, you need just to: 1) initialize your state variables for t<=10 2) add a cycle over t=11:T 3) solve the non-linear system at each step with e.g. "fsolve" function res = fun (y,ym1,ym5,ym10) res(1) = -y(1) + ym1(1) -y(1); res(2) = -y(2) + ym1(2) -y(2) + ym5(1); res(3) = -y(3) + ym1(3) -y(3) + ym10(2)*ym10(1); endfunction y = ones(3,10); for t = 11:100 y(:,t) = fsolve(@(x) fun(x,y(:,t-1),y(:,t-5),y(:,t-10)), y(:,t-1)); endfor and you're all set. anyway this is more or less equivalent to function f = fun (t, y, yd) f(1) =-y(1); f(2) =-y(2) + yd(1,1); f(3) =-y(3) + yd(2,2)*yd(1,2); endfunction T = [0,20]; res = ode45d (@fun, T, [1;1;1], [5, 10], ones (3,2)); but much less accurate, as you can see by running both implementations above and then typing: plot(-10:89, y) hold on plot (res.x, res.y, 'x-') it seems to me that, while it more or less captures the asymtotic behaviuor, your simplified solver damps away the initial oscillations completely. > Thank you > best regards > f.b. HTH, c. From carlo.defalco at gmail.com Sat Nov 7 13:27:51 2009 From: carlo.defalco at gmail.com (Carlo de Falco) Date: Sat, 7 Nov 2009 20:27:51 +0100 Subject: octave and delay ode's In-Reply-To: References: <59CCC399-AC46-45F9-AD93-A0643AFC0EA8@gmail.com> <55A3A9EF-0C56-4091-A6AE-8A126012CD71@gmail.com> <2ED5382C-8DFA-45C1-BD40-00DD0EE986FC@gmail.com> <4AEF326D.1070406@gmx.net> <970DCC2C-F189-43B7-AD47-8D847899D89B@gmail.com> <4AF2F3BC.8040409@gmx.net> Message-ID: On 7 Nov 2009, at 20:08, Carlo de Falco wrote: > > On 7 Nov 2009, at 19:13, franco basaglia wrote: > >> Thank you all for your work. >> >> I have a last question. >> I'd convert my ode system to a discrete-time system >> with annual time step. In thsi way I can simplify my delay question. >> >> What is the octave solver to use? How can I plan the system in >> Octave? >> >> The discrete system is something like that: >> >> y1(t) = y1(t-1) -y1(t) >> y2(t) = y2(t-1) -y2(t) + y1(t-5) >> y3(t) = t3(t-1) -y3(t) + y2(t-10)*y1(t-10) >> > > what you have written above is the Backward-Euler > method applied to your differential system. > to implement it in Octave, you need just to: > > 1) initialize your state variables for t<=10 > 2) add a cycle over t=11:T > 3) solve the non-linear system at each step with e.g. "fsolve" > > function res = fun (y,ym1,ym5,ym10) > res(1) = -y(1) + ym1(1) -y(1); > res(2) = -y(2) + ym1(2) -y(2) + ym5(1); > res(3) = -y(3) + ym1(3) -y(3) + ym10(2)*ym10(1); > endfunction > > y = ones(3,10); > for t = 11:100 > y(:,t) = fsolve(@(x) fun(x,y(:,t-1),y(:,t-5),y(:,t-10)), y(:,t-1)); > endfor > > and you're all set. > anyway this is more or less equivalent to > > function f = fun (t, y, yd) > f(1) =-y(1); > f(2) =-y(2) + yd(1,1); > f(3) =-y(3) + yd(2,2)*yd(1,2); > endfunction > T = [0,20]; > res = ode45d (@fun, T, [1;1;1], [5, 10], ones (3,2)); > > but much less accurate, as you can see by running both > implementations above and then typing: > > plot(-10:89, y) > hold on > plot (res.x, res.y, 'x-') sorry, I guess >> plot(-9:90, y) >> hold on >> plot (res.x, res.y, 'x-') is more correct > it seems to me that, while it more or less captures the asymtotic > behaviuor, > your simplified solver damps away the initial oscillations completely. > >> Thank you >> best regards >> f.b. > > HTH, > c. From highegg at gmail.com Sun Nov 8 14:14:52 2009 From: highegg at gmail.com (Jaroslav Hajek) Date: Sun, 8 Nov 2009 21:14:52 +0100 Subject: Efficient code for operating on pairwise vector diffs In-Reply-To: <4AF1DD87.2020208@webdrake.net> References: <4AEEDCBE.80901@webdrake.net> <69d8d540911020600x17797edsd19eea7afdcdc17f@mail.gmail.com> <4AF1DD87.2020208@webdrake.net> Message-ID: <69d8d540911081214k7a7f42b1j9a60b8575ad89bc7@mail.gmail.com> On Wed, Nov 4, 2009 at 9:01 PM, Joseph Wakeling wrote: > Jaroslav Hajek wrote: >> Code is always better if you want good answers. You can only extract a >> small (but working!) skeleton. Unless your co-workers are idiots, they >> won't bark at you for showing a few lines, especially if you're trying >> to improve your common work. > > Further to previous comments -- I wound up implementing pairwisediff() > as a function in its own right (attached). ?This actually uses both your > suggested solutions: the version of MATLAB I was using to test MATLAB > compatibility didn't have bsxfun included, so I put in place this check > to use either bsxfun or the alternative. > > Looking at this it occurs to me that it would be very easy to modify it > to allow pairwise diffs of either rows or columns (just add a DIM > parameter), and that it would make a nice addition to octave-forge. > This particular code has bugger-all to do with any academic worries, and > could be useful for a lot of people, so would be interested on having > comments on what needs to be added to it to make it a worthwhile submission. > Hi, sorry for the late reply. For an OctaveForge file, I think you should write an Octave-like inline docstring. Error checks (number&type of arguments) would also be nice. The dim argument also sounds good. If you target just Octave, the exist("bsxfun") check is pretty unnecessary. hth -- RNDr. Jaroslav Hajek computing expert & GNU Octave developer Aeronautical Research and Test Institute (VZLU) Prague, Czech Republic url: www.highegg.matfyz.cz From joseph.wakeling at webdrake.net Sun Nov 8 15:41:00 2009 From: joseph.wakeling at webdrake.net (Joseph Wakeling) Date: Sun, 08 Nov 2009 22:41:00 +0100 Subject: Efficient code for operating on pairwise vector diffs In-Reply-To: <69d8d540911081214k7a7f42b1j9a60b8575ad89bc7@mail.gmail.com> References: <4AEEDCBE.80901@webdrake.net> <69d8d540911020600x17797edsd19eea7afdcdc17f@mail.gmail.com> <4AF1DD87.2020208@webdrake.net> <69d8d540911081214k7a7f42b1j9a60b8575ad89bc7@mail.gmail.com> Message-ID: <4AF73AEC.4020505@webdrake.net> Jaroslav Hajek wrote: > Hi, > sorry for the late reply. For an OctaveForge file, I think you should > write an Octave-like inline docstring. Error checks (number&type of > arguments) would also be nice. The dim argument also sounds good. > If you target just Octave, the exist("bsxfun") check is pretty unnecessary. Sure, that sounds good. Just on a personal level, are you happy with the author credit in the code? It felt slightly cheeky saying '(c) me' and only thanking you -- it seemed OK in the original longer piece of code I wrote using bsxfun on one line, but less so in a function where your suggestions are the majority of the working lines :-) Brief overview of what I'd like to do with the complete code this is part of. We're preparing code to be both Octave- and MATLAB-compatible (which is why the bsxfun check is in there, only the most recent MATLAB has bsxfun). I'll probably put it onto Launchpad or GitHub as something stand-alone to be maintained, with a permissive but GPL-compatible license (BSD, I guess). Then octave-forge stuff can be derived from it. Does this sound OK? Again, sorry for not being more forthcoming with actual code examples right now, but it will get there. :-) Best wishes, -- Joe From chris at basementcode.com Sun Nov 8 18:37:09 2009 From: chris at basementcode.com (Christopher Harvey) Date: Sun, 8 Nov 2009 19:37:09 -0500 Subject: writing functions that accept arrays/(matrcies?) Message-ID: <200911081937.09118.chris@basementcode.com> Hello list, I'm pretty new to octave and I have a few questions. I'll try to keep them in list form as much as possible. Are ranges, arrays and matrices the same thing in octave? (ie the same data type?) If I write a function that accepts arrays (ranges?) like sin([1:10]) how can I check to make sure that it's not a matrix that's actually passed in? How do other built in functions handle this in octave? I would like to write a function that can accept and produce arrays, can I get a template that can do this? ie: myFunction([1:10], 1, 2, 3) that returns [x1, x2, x3....... x10] thanks for clearing this up, Chris. From elliott at l1partners.com Sun Nov 8 22:11:13 2009 From: elliott at l1partners.com (nikorey) Date: Sun, 8 Nov 2009 20:11:13 -0800 (PST) Subject: compiling java package on linux Message-ID: <26261041.post@talk.nabble.com> Just install 3.2.2 from the package manager on ubuntu 9.10 and had not problems. Now I am trying to install the java package and I get the following error: octave:2> pkg -verbose install java-1.2.6.tar.gz mkdir (/tmp/oct-22PbG9) untar (java-1.2.6.tar.gz, /tmp/oct-22PbG9) checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking for mkoctfile... mkoctfile retrieving compile and link flags from mkoctfile checking for F77_FUNC... yes checking for octave... octave checking for OCTAVE_VERSION in Octave... 3.2.2 checking for octave_config_info('canonical_host_type') in Octave... x86_64-pc-linux-gnu checking for octave_config_info('SHLEXT') in Octave... so checking whether ln -s works... yes checking for ranlib... ranlib checking for strip... strip checking for java... java checking for javac... javac checking for jar... jar checking for Java version... 1.6.0_0 configure: creating ./config.status config.status: creating Makeconf "$prefix" is /usr/share/octave/packages/3.2/java-1.2.6 "$exec_prefix" is ${prefix} octave commands will install into the following directories: m-files: /usr/share/octave/3.2.2/site/m/octave-forge oct-files: /usr/lib/octave/3.2.2/site/oct/x86_64-pc-linux-gnu/octave-forge binaries: /usr/lib/octave/3.2.2/site/exec/x86_64-pc-linux-gnu alternatives: m-files: /usr/share/octave/3.2.2/site/octave-forge-alternatives/m oct-files: /usr/lib/octave/3.2.2/site/octave-forge-alternatives/oct/x86_64-pc-linux-gnu shell commands will install into the following directories: binaries: ${exec_prefix}/bin man pages: ${datarootdir}/man libraries: ${exec_prefix}/lib headers: ${prefix}/include octave-forge is configured with octave: octave (version 3.2.2) mkoctfile: mkoctfile for Octave 2 java: yes find . -name NOINSTALL -print # shows which toolboxes won't be installed __java__.cc: In member function ?void JVMArgs::read_java_opts(const std::string&)?: __java__.cc:106: error: ?cerr? is not a member of ?std? __java__.cc: In member function ?void JVMArgs::update()?: __java__.cc:137: error: ?cout? is not a member of ?std? __java__.cc: In function ?void initialize_jvm()?: __java__.cc:384: warning: deprecated conversion from string constant to ?char*? __java__.cc: In function ?_jobject* make_java_index(JNIEnv*, const octave_value_list&)?: __java__.cc:587: error: ?class idx_vector? has no member named ?capacity? __java__.cc:589: error: ?class idx_vector? has no member named ?capacity? __java__.cc: In function ?octave_value get_array_elements(JNIEnv*, _jobject*, const octave_value_list&)?: __java__.cc:611: warning: deprecated conversion from string constant to ?char*? __java__.cc: In function ?octave_value set_array_elements(JNIEnv*, _jobject*, const octave_value_list&, const octave_value&)?: __java__.cc:633: warning: deprecated conversion from string constant to ?char*? __java__.cc: In function ?string_vector get_invoke_list(JNIEnv*, _jobject*)?: __java__.cc:679: error: ?class string_vector? has no member named ?qsort? __java__.cc: In function ?octave_value box(JNIEnv*, _jobject*, _jclass*)?: __java__.cc:782: warning: deprecated conversion from string constant to ?char*? __java__.cc:847: warning: deprecated conversion from string constant to ?char*? __java__.cc: In function ?int unbox(JNIEnv*, const octave_value&, jobject_ref&, jclass_ref&)?: __java__.cc:987: warning: deprecated conversion from string constant to ?char*? __java__.cc:1051: warning: deprecated conversion from string constant to ?char*? __java__.cc: In function ?int java_event_hook()?: __java__.cc:1116: warning: deprecated conversion from string constant to ?char*? __java__.cc: In member function ?octave_value octave_java::do_java_invoke(JNIEnv*, const std::string&, const octave_value_list&)?: __java__.cc:1695: warning: deprecated conversion from string constant to ?char*? __java__.cc: In static member function ?static octave_value octave_java::do_java_invoke(JNIEnv*, const std::string&, const std::string&, const octave_value_list&)?: __java__.cc:1720: warning: deprecated conversion from string constant to ?char*? __java__.cc: In static member function ?static octave_value octave_java::do_java_create(JNIEnv*, const std::string&, const octave_value_list&)?: __java__.cc:1745: warning: deprecated conversion from string constant to ?char*? __java__.cc: In member function ?octave_value octave_java::do_java_get(JNIEnv*, const std::string&)?: __java__.cc:1766: warning: deprecated conversion from string constant to ?char*? __java__.cc: In static member function ?static octave_value octave_java::do_java_get(JNIEnv*, const std::string&, const std::string&)?: __java__.cc:1786: warning: deprecated conversion from string constant to ?char*? __java__.cc: In member function ?octave_value octave_java::do_java_set(JNIEnv*, const std::string&, const octave_value&)?: __java__.cc:1812: warning: deprecated conversion from string constant to ?char*? __java__.cc: In static member function ?static octave_value octave_java::do_java_set(JNIEnv*, const std::string&, const std::string&, const octave_value&)?: __java__.cc:1834: warning: deprecated conversion from string constant to ?char*? make: *** [__java__.oct] Error 1 'make' returned the following error: make: Entering directory `/tmp/oct-22PbG9/java-1.2.6/src' if [ "Xamd64X" = "XX" ]; then \ mkoctfile -DHAVE_OCTAVE_32 -v -DJAVAPKG_BUILD -I/usr/lib/jvm/java-6-sun/include -I/usr/lib/jvm/java-6-sun/include/linux -o __java__.oct __java__.cc ; \ else \ mkoctfile -DHAVE_OCTAVE_32 -v -DJAVAPKG_BUILD -DJAVA_ARCH=\\\"amd64\\\" -DJAVA_HOME=\\\"/usr/lib/jvm/java-6-sun\\\" -I/usr/lib/jvm/java-6-sun/include -I/usr/lib/jvm/java-6-sun/include/linux -o __java__.oct __java__.cc ; \ fi g++ -c -fPIC -I/usr/include/octave-3.2.2 -I/usr/include/octave-3.2.2/octave -I/usr/include/freetype2 -O2 -g -I/usr/lib/jvm/java-6-sun/include -I/usr/lib/jvm/java-6-sun/include/linux -DHAVE_OCTAVE_32 -DJAVAPKG_BUILD -DJAVA_ARCH=\"amd64\" -DJAVA_HOME=\"/usr/lib/jvm/java-6-sun\" __java__.cc -o __java__.o make: Leaving directory `/tmp/oct-22PbG9/java-1.2.6/src' error: called from `pkg>configure_make' in file /usr/share/octave/3.2.2/m/pkg/pkg.m near line 1253, column 2 error: called from: error: /usr/share/octave/3.2.2/m/pkg/pkg.m at line 714, column 5 error: /usr/share/octave/3.2.2/m/pkg/pkg.m at line 287, column 7 Any ideas? thanks -- View this message in context: http://old.nabble.com/compiling-java-package-on-linux-tp26261041p26261041.html Sent from the Octave - General mailing list archive at Nabble.com. From jordigh at gmail.com Sun Nov 8 22:44:34 2009 From: jordigh at gmail.com (=?UTF-8?Q?Jordi_Guti=C3=A9rrez_Hermoso?=) Date: Sun, 8 Nov 2009 22:44:34 -0600 Subject: writing functions that accept arrays/(matrcies?) In-Reply-To: <9543b3a40911082042g5ea23334r414c26fbc93ed351@mail.gmail.com> References: <200911081937.09118.chris@basementcode.com> <9543b3a40911082042g5ea23334r414c26fbc93ed351@mail.gmail.com> Message-ID: <9543b3a40911082044v56ba145fh212ea20376542a43@mail.gmail.com> 2009/11/8 Christopher Harvey : > Are ranges, arrays and matrices the same thing in octave? (ie the same data > type?) Internally, no. For you, yes, they are; you shouldn't normally care about whatever Octave does to choose the best internal representation of each. > If I write a function that accepts arrays (ranges?) like sin([1:10]) how can I > check to make sure that it's not a matrix that's actually passed in? Octave in general has pretty weak type checking , but there are various isfoo functions you can use to check for type foo. > I would like to write a function that can accept and produce arrays, can I get > a template that can do this? ie: myFunction([1:10], 1, 2, 3) > that returns [x1, x2, x3....... x10] Just return matrices from your functions. Octave also supports returning simultaneous multiple return values from a function. From highegg at gmail.com Mon Nov 9 00:36:45 2009 From: highegg at gmail.com (Jaroslav Hajek) Date: Mon, 9 Nov 2009 07:36:45 +0100 Subject: writing functions that accept arrays/(matrcies?) In-Reply-To: <200911081937.09118.chris@basementcode.com> References: <200911081937.09118.chris@basementcode.com> Message-ID: <69d8d540911082236u73214111wfc4eb57fe69ca5e4@mail.gmail.com> On Mon, Nov 9, 2009 at 1:37 AM, Christopher Harvey wrote: > Hello list, > I'm pretty new to octave and I have a few questions. > > I'll try to keep them in list form as much as possible. > > Are ranges, arrays and matrices the same thing in octave? (ie the same data > type?) > No. Ranges are kept in a packed form until you modify them. > If I write a function that accepts arrays (ranges?) like sin([1:10]) how can I > check to make sure that it's not a matrix that's actually passed in? > How do other built in functions handle this in octave? A matrix is also an array - Octave's arrays are n-dimensional. If you only want vectors (1d arrays), check that the dimensions are 1xn or nx1 (or whatever you want to allow). > > I would like to write a function that can accept and produce arrays, can I get > a template that can do this? ie: myFunction([1:10], 1, 2, 3) > that returns [x1, x2, x3....... x10] > You can find examples in the manual or at the Octave wiki. -- RNDr. Jaroslav Hajek computing expert & GNU Octave developer Aeronautical Research and Test Institute (VZLU) Prague, Czech Republic url: www.highegg.matfyz.cz From highegg at gmail.com Mon Nov 9 00:43:57 2009 From: highegg at gmail.com (Jaroslav Hajek) Date: Mon, 9 Nov 2009 07:43:57 +0100 Subject: Efficient code for operating on pairwise vector diffs In-Reply-To: <4AF73AEC.4020505@webdrake.net> References: <4AEEDCBE.80901@webdrake.net> <69d8d540911020600x17797edsd19eea7afdcdc17f@mail.gmail.com> <4AF1DD87.2020208@webdrake.net> <69d8d540911081214k7a7f42b1j9a60b8575ad89bc7@mail.gmail.com> <4AF73AEC.4020505@webdrake.net> Message-ID: <69d8d540911082243g37535049wdf42cd7be71f4470@mail.gmail.com> On Sun, Nov 8, 2009 at 10:41 PM, Joseph Wakeling wrote: > Jaroslav Hajek wrote: >> Hi, >> sorry for the late reply. For an OctaveForge file, I think you should >> write an Octave-like inline docstring. Error checks (number&type of >> arguments) would also be nice. The dim argument also sounds good. >> If you target just Octave, the exist("bsxfun") check is pretty unnecessary. > > Sure, that sounds good. > > Just on a personal level, are you happy with the author credit in the > code? ?It felt slightly cheeky saying '(c) me' and only thanking you -- > it seemed OK in the original longer piece of code I wrote using bsxfun > on one line, but less so in a function where your suggestions are the > majority of the working lines :-) I would never claim copyright for two lines of code. And by addressing the suggestions above you'll get more code. > Brief overview of what I'd like to do with the complete code this is > part of. ?We're preparing code to be both Octave- and MATLAB-compatible > (which is why the bsxfun check is in there, only the most recent MATLAB > has bsxfun). ?I'll probably put it onto Launchpad or GitHub as something > stand-alone to be maintained, with a permissive but GPL-compatible > license (BSD, I guess). ?Then octave-forge stuff can be derived from it. > ?Does this sound OK? > I think so. Of course there's no need to include your code in OctaveForge (implying more maintenance if the primary source is elsewhere), it's just that OctaveForge is the place where people look for Octave extensions first. > > Again, sorry for not being more forthcoming with actual code examples > right now, but it will get there. :-) > > Best wishes, > > ? ?-- Joe > regards -- RNDr. Jaroslav Hajek computing expert & GNU Octave developer Aeronautical Research and Test Institute (VZLU) Prague, Czech Republic url: www.highegg.matfyz.cz From individ at acc.umu.se Mon Nov 9 01:49:59 2009 From: individ at acc.umu.se (David Grundberg) Date: Mon, 09 Nov 2009 08:49:59 +0100 Subject: writing functions that accept arrays/(matrcies?) In-Reply-To: <200911081937.09118.chris@basementcode.com> References: <200911081937.09118.chris@basementcode.com> Message-ID: <4AF7C9A7.30809@acc.umu.se> Christopher Harvey wrote: > Hello list, > I'm pretty new to octave and I have a few questions. > > I'll try to keep them in list form as much as possible. > > Are ranges, arrays and matrices the same thing in octave? (ie the same data > type?) > Ranges (e.g. 1:4), cellarrays ({}) and matrices ([1 2 3]) are all arrays. As an example, all arrays can be indexed with (), which returns an array of the same type. But cellarrays have a different class from matrices, so they store different things. Note that ranges and matrices both return "double" from the class() function, so they are compatible in every way. If you use typeinfo(), you can see what internal representation Octave chosen. typeinfo() is more for helping C++ developers debug than it is useful for m-file developers. > If I write a function that accepts arrays (ranges?) like sin([1:10]) how can I > check to make sure that it's not a matrix that's actually passed in? > How do other built in functions handle this in octave? > You cannot make a difference between ranges and double matrices, except if you cheat and use typeinfo(). But I consider that bad style, because ranges and matrices belong to the same class. If you have a lot of parameters and want to have error checking, you can use is*() functions, which checks the class. That way you are not dependent on the internal representation in Octave. > I would like to write a function that can accept and produce arrays, can I get > a template that can do this? ie: myFunction([1:10], 1, 2, 3) > that returns [x1, x2, x3....... x10] > Something like this function y = linearfunc(x, k, m) y = x .* k + m; endfunction > thanks for clearing this up, > Chris. > _______________________________________________ > Help-octave mailing list > Help-octave at octave.org > https://www-old.cae.wisc.edu/mailman/listinfo/help-octave > From olaf.till at uni-jena.de Mon Nov 9 01:14:58 2009 From: olaf.till at uni-jena.de (Olaf Till) Date: Mon, 9 Nov 2009 08:14:58 +0100 Subject: Pulse function in a LSODE system In-Reply-To: <1a403ba70911060408v341b0cb9rf18a74dd2d2ff22f@mail.gmail.com> References: <1a403ba70911060408v341b0cb9rf18a74dd2d2ff22f@mail.gmail.com> Message-ID: <20091109071458.GA22740@olaf> On Fri, Nov 06, 2009 at 01:08:44PM +0100, Emanuele T. wrote: > Hi, i'd like to introduce in my differential equations a parameter that > assumes specific value (a function of one or more solution of my sistem) > every 5 time step. I attach you my code. I have no clearfull ideas on time > step: if I print my variable "t" it returns me some decimal value. > Thanks in advance > > E.T. Hi Emanuele, lsode uses adaptive time stepping (I believe there was a similar thread just a few days ago), so you can't rely on a specific time step (you give lsode a vector of times, but the solution values for these will be interpolated, so you do not determine the time step). You can, however, change the parameter at a certain time (not a certain time step). Be warned, this will cause methods with adaptive time stepping to take a long time at each parameter change, while methods with fixed time stepping will possibly yield bad solutions. It may be better to change the parameter in a continuous way, e.g. with some sigmoid function of time. Regards, Olaf From peter at sonderport.dk Mon Nov 9 07:13:59 2009 From: peter at sonderport.dk (Peter L. =?ISO-8859-1?Q?S=F8ndergaard?=) Date: Mon, 09 Nov 2009 14:13:59 +0100 Subject: single/double precision in C++ Message-ID: <1257772439.2557.10.camel@localhost.localdomain> Hello everyone, I am writing Octave interfaces for a library I have developed (see LTFAT on sourceforge). The interface should be able to handle both real and complex input in both single and double precision. This leads to code like the one further down this email. The code works, but there is a lot of duplication, because I end up having 4 different cases to handle all situations. In the end, something like this is necessary, because I need to call 4 different C functions, but still I would hope that there was a more clever way of writing the function. Any suggestions would be most welcome, because I have to do it for around 20 different functions. Cheers, Peter. And here is the current code: #include #include "config.h" #include "ltfat.h" DEFUN_DLD (comp_dgt_fac, args, , "This function calls the C-library\n\ c=comp_dgt_fac(f,gf,a,M);\n\ Yeah.") { const bool f_is_complex = args(0).is_complex_type(); const int a = args(2).int_value(); const int M = args(3).int_value(); if (f_is_complex) { if (args(0).is_double_type()) { const ComplexMatrix f = args(0).complex_matrix_value(); const ComplexMatrix gf = args(1).complex_matrix_value(); const int L = f.rows(); const int W = f.columns(); const int R = gf.rows()*gf.columns()/L; const int N = L/a; ComplexMatrix cout(M,N*W*R); dgt_fac((ltfat_complex*)f.data(),(ltfat_complex*)gf.data(), L, W, R, a, M,(ltfat_complex*)cout.data()); return octave_value (cout); } else { const FloatComplexMatrix f = args(0).float_complex_matrix_value(); const FloatComplexMatrix gf = args(1).float_complex_matrix_value(); const int L = f.rows(); const int W = f.columns(); const int R = gf.rows()*gf.columns()/L; const int N = L/a; FloatComplexMatrix cout(M,N*W*R); sdgt_fac((ltfat_scomplex*)f.data(),(ltfat_scomplex*)gf.data(), L, W, R, a, M,(ltfat_scomplex*)cout.data()); return octave_value (cout); } } else { if (args(0).is_double_type()) { const Matrix f = args(0).matrix_value(); const ComplexMatrix gf = args(1).complex_matrix_value(); const int L = f.rows(); const int W = f.columns(); const int R = gf.rows()*gf.columns()/L; const int N = L/a; ComplexMatrix cout(M,N*W*R); dgt_fac_r((double*)f.data(),(ltfat_complex*)gf.data(), L, W, R, a, M,(ltfat_complex*)cout.data()); return octave_value (cout); } else { const FloatMatrix f = args(0).float_matrix_value(); const FloatComplexMatrix gf = args(1).float_complex_matrix_value(); const int L = f.rows(); const int W = f.columns(); const int R = gf.rows()*gf.columns()/L; const int N = L/a; FloatComplexMatrix cout(M,N*W*R); sdgt_fac_r((float*)f.data(),(ltfat_scomplex*)gf.data(), L, W, R, a, M,(ltfat_scomplex*)cout.data()); return octave_value (cout); } } } From sanjeevkumarece at yahoo.co.in Mon Nov 9 02:29:18 2009 From: sanjeevkumarece at yahoo.co.in (sanjeeva kumar) Date: Mon, 9 Nov 2009 00:29:18 -0800 (PST) Subject: image compression Message-ID: <26262728.post@talk.nabble.com> hi to all, this is sanjeev (m.tech) and i am doing project on radar data and image compression using wavelet programing on octave tool. please can any body help me for code (programme) to this data and image compression thanking you,sanjeevkumarece at yahoo.co.in -- View this message in context: http://old.nabble.com/image-compression-tp26262728p26262728.html Sent from the Octave - General mailing list archive at Nabble.com. From soren at hauberg.org Mon Nov 9 08:20:18 2009 From: soren at hauberg.org (=?ISO-8859-1?Q?S=F8ren?= Hauberg) Date: Mon, 09 Nov 2009 15:20:18 +0100 Subject: image compression In-Reply-To: <26262728.post@talk.nabble.com> References: <26262728.post@talk.nabble.com> Message-ID: <1257776418.8964.35.camel@hauberg-laptop> man, 09 11 2009 kl. 00:29 -0800, skrev sanjeeva kumar: > this is sanjeev (m.tech) and i am doing project on radar data and image > compression using wavelet programing on octave tool. please can any body > help me for code (programme) to this data and image compression If you are using wavelets, then I guess you should look at wavelab: http://wiki.octave.org/wiki.pl?WavelabOnOctave I have no experience with this package, though. S?ren From highegg at gmail.com Mon Nov 9 08:37:34 2009 From: highegg at gmail.com (Jaroslav Hajek) Date: Mon, 9 Nov 2009 15:37:34 +0100 Subject: single/double precision in C++ In-Reply-To: <1257772439.2557.10.camel@localhost.localdomain> References: <1257772439.2557.10.camel@localhost.localdomain> Message-ID: <69d8d540911090637i579fc3e2t8154efd102c34dfc@mail.gmail.com> On Mon, Nov 9, 2009 at 2:13 PM, Peter L. wrote: > Hello everyone, > > I am writing Octave interfaces for a library I have developed (see LTFAT > on sourceforge). The interface should be able to handle both real and > complex input in both single and double precision. > > This leads to code like the one further down this email. The code works, > but there is a lot of duplication, because I end up having 4 different > cases to handle all situations. In the end, something like this is > necessary, because I need to call 4 different C functions, but still I > would hope that there was a more clever way of writing the function. > > Any suggestions would be most welcome, because I have to do it for > around 20 different functions. > > Cheers, > > Peter. > Templates could help you here. Octave 3.3.50+ provides a templatized function octave_value_extract that extracts a specified matrix type from an octave_value. If you want to target the 3.2.x series as well (which you probably do), you can steal these from the development sources and define them conditionally. Using octave_value_extract, you could write something like: template static octave_value do_comp_dgt_fac (const octave_value_list& args, const int a, const int M, void (*lib_func) (/* TODO */)) { const MT1 f = octave_value_extract args(0); const MT2 gf = octave_value_extract args(0); const int L = f.rows(); const int W = f.columns(); const int R = gf.rows()*gf.columns()/L; const int N = L/a; MT2 cout(M,N*W*R); lib_func (...); return cout; } and then call it for the 4 cases return do_comp_dgt_fac (args, a, m, dgt_fac_r); etc The C prototypes pose another problem as these use different complex number type than Octave (Octave uses std::complex and assumes the layout conforms to Fortran and C99). A quick solution is to let these types be implied by the template, but that is quite unsafe, as it will silently crash if you misspell a function's name. A better solution is to provide a trait class converting Octave's types to LTFAT's. A possibly yet better solution is to alter ltfat.h in such a manner that it will use a user-defined complex type if one is provided via a #define: #include #define LTFAT_USER_COMPLEX Complex #define LTFAT_USER_SCOMPLEX FloatComplex #include "ltfat.h" // will now use Complex and FloatComplex for the prototypes this can be useful in general when interfacing with other software. hth -- RNDr. Jaroslav Hajek computing expert & GNU Octave developer Aeronautical Research and Test Institute (VZLU) Prague, Czech Republic url: www.highegg.matfyz.cz From joseph.wakeling at webdrake.net Mon Nov 9 11:19:01 2009 From: joseph.wakeling at webdrake.net (Joseph Wakeling) Date: Mon, 09 Nov 2009 18:19:01 +0100 Subject: Efficient code for operating on pairwise vector diffs In-Reply-To: <69d8d540911082243g37535049wdf42cd7be71f4470@mail.gmail.com> References: <4AEEDCBE.80901@webdrake.net> <69d8d540911020600x17797edsd19eea7afdcdc17f@mail.gmail.com> <4AF1DD87.2020208@webdrake.net> <69d8d540911081214k7a7f42b1j9a60b8575ad89bc7@mail.gmail.com> <4AF73AEC.4020505@webdrake.net> <69d8d540911082243g37535049wdf42cd7be71f4470@mail.gmail.com> Message-ID: <4AF84F05.7040903@webdrake.net> Jaroslav Hajek wrote: > I think so. Of course there's no need to include your code in > OctaveForge (implying more maintenance if the primary source is > elsewhere), it's just that OctaveForge is the place where people look > for Octave extensions first. No, I definitely want it in octave-forge. I've never got over the pleasure of discovering that information-theoretic functions I contributed had made their way into the official packages of the Linux distribution I use. :-) I just have to be conscientious to all the poor scientists out there who have never used anything other than MATLAB ... From sergstesh at yahoo.com Mon Nov 9 13:57:37 2009 From: sergstesh at yahoo.com (Sergei Steshenko) Date: Mon, 9 Nov 2009 11:57:37 -0800 (PST) Subject: single/double precision in C++ In-Reply-To: <1257772439.2557.10.camel@localhost.localdomain> Message-ID: <926849.97029.qm@web112110.mail.gq1.yahoo.com> --- On Mon, 11/9/09, Peter L. S?ndergaard wrote: > From: Peter L. S?ndergaard > Subject: single/double precision in C++ > To: "Octave users list" > Date: Monday, November 9, 2009, 5:13 AM > Hello everyone, > > I am writing Octave interfaces for a library I have > developed (see LTFAT > on sourceforge). The interface should be able to handle > both real and > complex input in both single and double precision. > > This leads to code like the one further down this email. > The code works, > but there is a lot of duplication, because I end up having > 4 different > cases to handle all situations. In the end, something like > this is > necessary, because I need to call 4 different C functions, > but still I > would hope that there was a more clever way of writing the > function. > > Any suggestions would be most welcome, because I have to do > it for > around 20 different functions. > > Cheers, > > Peter. > > And here is the current code: > > > #include > #include "config.h" > #include "ltfat.h" > > DEFUN_DLD (comp_dgt_fac, args, , > ? "This function calls the C-library\n\ > ? c=comp_dgt_fac(f,gf,a,M);\n\ > ? Yeah.") > { > > ? const bool f_is_complex? = > args(0).is_complex_type(); > > ? const int a = args(2).int_value(); > ? const int M = args(3).int_value(); > > ? if (f_is_complex) > ? { > > ? ???if (args(0).is_double_type()) > ? ???{ > ??? const ComplexMatrix f = > args(0).complex_matrix_value(); > ??? const ComplexMatrix gf = > args(1).complex_matrix_value(); > ??? > ??? const int L = f.rows(); > ??? const int W = f.columns(); > ??? const int R = gf.rows()*gf.columns()/L; > ??? > ??? const int N = L/a; > ??? > ??? ComplexMatrix cout(M,N*W*R);? > ??? > ??? > dgt_fac((ltfat_complex*)f.data(),(ltfat_complex*)gf.data(), > ??? ??? L, W, R, a, > M,(ltfat_complex*)cout.data()); > ??? > ??? return octave_value (cout); > ? ??? > ? ???} > ? ???else > ? ???{ > > ??? const FloatComplexMatrix f = > args(0).float_complex_matrix_value(); > ??? const FloatComplexMatrix gf = > args(1).float_complex_matrix_value(); > ??? > ??? const int L = f.rows(); > ??? const int W = f.columns(); > ??? const int R = gf.rows()*gf.columns()/L; > ??? > ??? const int N = L/a; > ??? > ??? FloatComplexMatrix cout(M,N*W*R);? > > ??? > ??? > sdgt_fac((ltfat_scomplex*)f.data(),(ltfat_scomplex*)gf.data(), > ??? ??? L, W, R, a, > M,(ltfat_scomplex*)cout.data()); > ??? > ??? return octave_value (cout); > ??? > ? ???} > > ? } > ? else > ? { > > ? ???if (args(0).is_double_type()) > ? ???{ > > ??? const Matrix f = > args(0).matrix_value(); > ??? const ComplexMatrix gf = > args(1).complex_matrix_value(); > ??? > ??? const int L = f.rows(); > ??? const int W = f.columns(); > ??? const int R = gf.rows()*gf.columns()/L; > ??? > ??? const int N = L/a; > ??? > ??? ComplexMatrix cout(M,N*W*R);? > ??? > ??? > dgt_fac_r((double*)f.data(),(ltfat_complex*)gf.data(), > ??? ??? ? L, W, R, a, > M,(ltfat_complex*)cout.data()); > ??? > ??? return octave_value (cout); > ??? > ? ???} > ? ???else > ? ???{ > ??? const FloatMatrix f = > args(0).float_matrix_value(); > ??? const FloatComplexMatrix gf = > args(1).float_complex_matrix_value(); > ??? > ??? const int L = f.rows(); > ??? const int W = f.columns(); > ??? const int R = gf.rows()*gf.columns()/L; > ??? > ??? const int N = L/a; > ??? > ??? FloatComplexMatrix cout(M,N*W*R);? > > ??? > ??? > sdgt_fac_r((float*)f.data(),(ltfat_scomplex*)gf.data(), > ??? ??? ? L, W, R, a, > M,(ltfat_scomplex*)cout.data()); > ??? > ??? return octave_value (cout); > ??? > ? ???}? > ? } > > } > I would write a macro (and in C++, I think, it is possible to write a "fancier" template class/function, though I'm not an expert in C++). I have a similar (float/double, float complex/double complex) situattion in my (non-octave) code, and macros serve me pretty well. Regards, Sergei. From thomas.weber.mail at gmail.com Mon Nov 9 14:20:47 2009 From: thomas.weber.mail at gmail.com (Thomas Weber) Date: Mon, 9 Nov 2009 21:20:47 +0100 Subject: compiling java package on linux In-Reply-To: <26261041.post@talk.nabble.com> References: <26261041.post@talk.nabble.com> Message-ID: <20091109202047.GA6967@atlan> On Sun, Nov 08, 2009 at 08:11:13PM -0800, nikorey wrote: > > Just install 3.2.2 from the package manager on ubuntu 9.10 and had not > problems. Now I am trying to install the java package and I get the > following error: > > octave:2> pkg -verbose install java-1.2.6.tar.gz > __java__.cc: In member function ?void JVMArgs::read_java_opts(const > std::string&)?: > __java__.cc:106: error: ?cerr? is not a member of ?std? > __java__.cc: In member function ?void JVMArgs::update()?: > __java__.cc:137: error: ?cout? is not a member of ?std? > __java__.cc: In function ?void initialize_jvm()?: > __java__.cc:384: warning: deprecated conversion from string constant to > ?char*? Please post the output of gcc --version I suspect a 4.4 version, which doesn't include quite some header files by default. Thomas From michael.goffioul at gmail.com Mon Nov 9 16:03:00 2009 From: michael.goffioul at gmail.com (Michael Goffioul) Date: Mon, 9 Nov 2009 22:03:00 +0000 Subject: compiling java package on linux In-Reply-To: <26261041.post@talk.nabble.com> References: <26261041.post@talk.nabble.com> Message-ID: <128f38bd0911091403l194d24d4ud5579a97430c1a62@mail.gmail.com> This is fixed in SVN. But there's been any new package release yet. However, you can grab the __java__.cc source file by browsing the source repository and update your package archive with it. Michael. On Mon, Nov 9, 2009 at 4:11 AM, nikorey wrote: > > Just install 3.2.2 from the package manager on ubuntu 9.10 and had not > problems. Now I am trying to install the java package and I get the > following error: > > octave:2> pkg -verbose ?install java-1.2.6.tar.gz > mkdir (/tmp/oct-22PbG9) > untar (java-1.2.6.tar.gz, /tmp/oct-22PbG9) > checking for gcc... gcc > checking for C compiler default output file name... a.out > checking whether the C compiler works... yes > checking whether we are cross compiling... no > checking for suffix of executables... > checking for suffix of object files... o > checking whether we are using the GNU C compiler... yes > checking whether gcc accepts -g... yes > checking for gcc option to accept ISO C89... none needed > checking for mkoctfile... mkoctfile > retrieving compile and link flags from mkoctfile > checking for F77_FUNC... yes > checking for octave... octave > checking for OCTAVE_VERSION in Octave... 3.2.2 > checking for octave_config_info('canonical_host_type') in Octave... > x86_64-pc-linux-gnu > checking for octave_config_info('SHLEXT') in Octave... so > checking whether ln -s works... yes > checking for ranlib... ranlib > checking for strip... strip > checking for java... java > checking for javac... javac > checking for jar... jar > checking for Java version... 1.6.0_0 > configure: creating ./config.status > config.status: creating Makeconf > > ?"$prefix" is /usr/share/octave/packages/3.2/java-1.2.6 > ?"$exec_prefix" is ${prefix} > > octave commands will install into the following directories: > ? m-files: ? /usr/share/octave/3.2.2/site/m/octave-forge > ? oct-files: > /usr/lib/octave/3.2.2/site/oct/x86_64-pc-linux-gnu/octave-forge > ? binaries: ?/usr/lib/octave/3.2.2/site/exec/x86_64-pc-linux-gnu > alternatives: > ? m-files: ? /usr/share/octave/3.2.2/site/octave-forge-alternatives/m > ? oct-files: > /usr/lib/octave/3.2.2/site/octave-forge-alternatives/oct/x86_64-pc-linux-gnu > > shell commands will install into the following directories: > ? binaries: ?${exec_prefix}/bin > ? man pages: ${datarootdir}/man > ? libraries: ${exec_prefix}/lib > ? headers: ? ${prefix}/include > > octave-forge is configured with > ? octave: ? ? ?octave (version 3.2.2) > ? mkoctfile: ? mkoctfile for Octave 2 > ? java: ? ? ? ?yes > > find . -name NOINSTALL -print ? ?# shows which toolboxes won't be installed > > __java__.cc: In member function ?void JVMArgs::read_java_opts(const > std::string&)?: > __java__.cc:106: error: ?cerr? is not a member of ?std? > __java__.cc: In member function ?void JVMArgs::update()?: > __java__.cc:137: error: ?cout? is not a member of ?std? > __java__.cc: In function ?void initialize_jvm()?: > __java__.cc:384: warning: deprecated conversion from string constant to > ?char*? > __java__.cc: In function ?_jobject* make_java_index(JNIEnv*, const > octave_value_list&)?: > __java__.cc:587: error: ?class idx_vector? has no member named ?capacity? > __java__.cc:589: error: ?class idx_vector? has no member named ?capacity? > __java__.cc: In function ?octave_value get_array_elements(JNIEnv*, > _jobject*, const octave_value_list&)?: > __java__.cc:611: warning: deprecated conversion from string constant to > ?char*? > __java__.cc: In function ?octave_value set_array_elements(JNIEnv*, > _jobject*, const octave_value_list&, const octave_value&)?: > __java__.cc:633: warning: deprecated conversion from string constant to > ?char*? > __java__.cc: In function ?string_vector get_invoke_list(JNIEnv*, > _jobject*)?: > __java__.cc:679: error: ?class string_vector? has no member named ?qsort? > __java__.cc: In function ?octave_value box(JNIEnv*, _jobject*, _jclass*)?: > __java__.cc:782: warning: deprecated conversion from string constant to > ?char*? > __java__.cc:847: warning: deprecated conversion from string constant to > ?char*? > __java__.cc: In function ?int unbox(JNIEnv*, const octave_value&, > jobject_ref&, jclass_ref&)?: > __java__.cc:987: warning: deprecated conversion from string constant to > ?char*? > __java__.cc:1051: warning: deprecated conversion from string constant to > ?char*? > __java__.cc: In function ?int java_event_hook()?: > __java__.cc:1116: warning: deprecated conversion from string constant to > ?char*? > __java__.cc: In member function ?octave_value > octave_java::do_java_invoke(JNIEnv*, const std::string&, const > octave_value_list&)?: > __java__.cc:1695: warning: deprecated conversion from string constant to > ?char*? > __java__.cc: In static member function ?static octave_value > octave_java::do_java_invoke(JNIEnv*, const std::string&, const std::string&, > const octave_value_list&)?: > __java__.cc:1720: warning: deprecated conversion from string constant to > ?char*? > __java__.cc: In static member function ?static octave_value > octave_java::do_java_create(JNIEnv*, const std::string&, const > octave_value_list&)?: > __java__.cc:1745: warning: deprecated conversion from string constant to > ?char*? > __java__.cc: In member function ?octave_value > octave_java::do_java_get(JNIEnv*, const std::string&)?: > __java__.cc:1766: warning: deprecated conversion from string constant to > ?char*? > __java__.cc: In static member function ?static octave_value > octave_java::do_java_get(JNIEnv*, const std::string&, const std::string&)?: > __java__.cc:1786: warning: deprecated conversion from string constant to > ?char*? > __java__.cc: In member function ?octave_value > octave_java::do_java_set(JNIEnv*, const std::string&, const octave_value&)?: > __java__.cc:1812: warning: deprecated conversion from string constant to > ?char*? > __java__.cc: In static member function ?static octave_value > octave_java::do_java_set(JNIEnv*, const std::string&, const std::string&, > const octave_value&)?: > __java__.cc:1834: warning: deprecated conversion from string constant to > ?char*? > make: *** [__java__.oct] Error 1 > 'make' returned the following error: make: Entering directory > `/tmp/oct-22PbG9/java-1.2.6/src' > if [ "Xamd64X" = "XX" ]; then \ > ? ? ? ? ? ? ? ?mkoctfile -DHAVE_OCTAVE_32 -v -DJAVAPKG_BUILD > -I/usr/lib/jvm/java-6-sun/include -I/usr/lib/jvm/java-6-sun/include/linux -o > __java__.oct __java__.cc ; \ > ? ? ? ?else \ > ? ? ? ? ? ? ? ?mkoctfile -DHAVE_OCTAVE_32 -v -DJAVAPKG_BUILD -DJAVA_ARCH=\\\"amd64\\\" > -DJAVA_HOME=\\\"/usr/lib/jvm/java-6-sun\\\" > -I/usr/lib/jvm/java-6-sun/include -I/usr/lib/jvm/java-6-sun/include/linux -o > __java__.oct __java__.cc ; \ > ? ? ? ?fi > g++ -c -fPIC -I/usr/include/octave-3.2.2 -I/usr/include/octave-3.2.2/octave > -I/usr/include/freetype2 -O2 -g -I/usr/lib/jvm/java-6-sun/include > -I/usr/lib/jvm/java-6-sun/include/linux -DHAVE_OCTAVE_32 -DJAVAPKG_BUILD > -DJAVA_ARCH=\"amd64\" -DJAVA_HOME=\"/usr/lib/jvm/java-6-sun\" __java__.cc -o > __java__.o > make: Leaving directory `/tmp/oct-22PbG9/java-1.2.6/src' > error: called from `pkg>configure_make' in file > /usr/share/octave/3.2.2/m/pkg/pkg.m near line 1253, column 2 > error: called from: > error: ? /usr/share/octave/3.2.2/m/pkg/pkg.m at line 714, column 5 > error: ? /usr/share/octave/3.2.2/m/pkg/pkg.m at line 287, column 7 > > Any ideas? > > thanks > > -- > View this message in context: http://old.nabble.com/compiling-java-package-on-linux-tp26261041p26261041.html > Sent from the Octave - General mailing list archive at Nabble.com. > > > _______________________________________________ > Help-octave mailing list > Help-octave at octave.org > https://www-old.cae.wisc.edu/mailman/listinfo/help-octave > From coccoinomane at gmail.com Mon Nov 9 18:21:51 2009 From: coccoinomane at gmail.com (coccoinomane) Date: Mon, 9 Nov 2009 16:21:51 -0800 (PST) Subject: [SOLVED] Re: qtoctave on Mac Os X 10.6 Snow Leopard - menus not working In-Reply-To: <3CBDFF69-245B-499B-AC11-5B4C6B7CE359@gmail.com> References: <3CBDFF69-245B-499B-AC11-5B4C6B7CE359@gmail.com> Message-ID: <26276222.post@talk.nabble.com> Hello everybody, just to point out that I solved my problem with menus in qtoctave. The merit goes to Ted Rippert, who in http://groups.google.com/group/qtoctave-english/browse_thread/thread/19187ee734e316cf/8344a04b4189a0e3?lnk=gst&q=qtoctave#8344a04b4189a0e3 suggested this solution: Just make 2 changes to mainwindow.cpp in the src directory of the unzipped code. change line 216 to: menubar = new QMenuBar(0); comment out line 237: //setMenuBar(menubar); That's all it took. Works great. You could probably put an if_define switch in the code to make this only happen on macs if you wanted to put a patch into the main code version. By the way, I did install easy_plot and it works fine, but I had to make sure that I had set the environment variable GNUTERM=x11. If it's set to aqua, then you just get an empty window in easy_plot. Hope it helps :) ... and I swear this is my last post on qtoctave! Cheers, G. coccoinomane wrote: > > Hi all! > > I succesfully installed and compiled qtoctave > (http://qtoctave.wordpress.com/ > ) in my MacBook Pro running Mac Os X 10.6 aka Snow Leopard with QT > 4.5.3. I strongly suggest this gui, it has functionality which in my > opinion are, to some extent, even better than Matlab gui. > > Everythink is working fine, but I have two problems: > > 1) Menus won?t load; both default ones in /usr/local/share/qtoctave/ > menus and custom ones in ~/.qtoctave/menus won?t show up in the menu > bar. The only entry is the useless ?qtoctave?. The only exception is > when the focus is on the editor window, where I can see the defualt > editing menus (View, File, Edit, Run, Tools, Config). I can use > qtoctave without menus, but I really would like to enable them; > > 2) I do not know how to use easy_plot. This is not a bug, it is just > my ignorance :) > > On a side note, did anybody manage to install the QT terminal for > gnuplot on Snow Leopard? I get plenty of errors when compiling gnuplot > witht the ?eneable-qt option? > > Thank you very much for any help! > > Guido > _______________________________________________ > Help-octave mailing list > Help-octave at octave.org > https://www-old.cae.wisc.edu/mailman/listinfo/help-octave > > -- View this message in context: http://old.nabble.com/qtoctave-on-Mac-Os-X-10.6-Snow-Leopard---menus-not-working-tp26095966p26276222.html Sent from the Octave - General mailing list archive at Nabble.com. From elliott at l1partners.com Mon Nov 9 18:44:47 2009 From: elliott at l1partners.com (nikorey) Date: Mon, 9 Nov 2009 16:44:47 -0800 (PST) Subject: compiling java package on linux In-Reply-To: <128f38bd0911091403l194d24d4ud5579a97430c1a62@mail.gmail.com> References: <26261041.post@talk.nabble.com> <128f38bd0911091403l194d24d4ud5579a97430c1a62@mail.gmail.com> Message-ID: <26276410.post@talk.nabble.com> Thanks Michael. Besides replacing the __java__.cc file, I was able to get it working after the following 2 additional steps: 1) change the permissions of the /usr/lib/octave and /usr/share/octave directories to allow the writing of the generated directories and files (I tried installing the java package after starting octave with sudo but all the environment variables such as JAVA_HOME get lost when you do that) 2) created a directory called client under $JAVA_HOME/jre/lib/amd64 and then create a symlink from $JAVA_HOME/jre/lib/amd64/server/libjvm.so to $JAVA_HOME/jre/lib/amd64/client/libjvm.so Thanks, Niko Michael Goffioul-2 wrote: > > This is fixed in SVN. But there's been any new package release > yet. However, you can grab the __java__.cc source file by browsing > the source repository and update your package archive with it. > > Michael. > > On Mon, Nov 9, 2009 at 4:11 AM, nikorey wrote: >> >> Just install 3.2.2 from the package manager on ubuntu 9.10 and had not >> problems. Now I am trying to install the java package and I get the >> following error: >> >> octave:2> pkg -verbose ?install java-1.2.6.tar.gz >> mkdir (/tmp/oct-22PbG9) >> untar (java-1.2.6.tar.gz, /tmp/oct-22PbG9) >> checking for gcc... gcc >> checking for C compiler default output file name... a.out >> checking whether the C compiler works... yes >> checking whether we are cross compiling... no >> checking for suffix of executables... >> checking for suffix of object files... o >> checking whether we are using the GNU C compiler... yes >> checking whether gcc accepts -g... yes >> checking for gcc option to accept ISO C89... none needed >> checking for mkoctfile... mkoctfile >> retrieving compile and link flags from mkoctfile >> checking for F77_FUNC... yes >> checking for octave... octave >> checking for OCTAVE_VERSION in Octave... 3.2.2 >> checking for octave_config_info('canonical_host_type') in Octave... >> x86_64-pc-linux-gnu >> checking for octave_config_info('SHLEXT') in Octave... so >> checking whether ln -s works... yes >> checking for ranlib... ranlib >> checking for strip... strip >> checking for java... java >> checking for javac... javac >> checking for jar... jar >> checking for Java version... 1.6.0_0 >> configure: creating ./config.status >> config.status: creating Makeconf >> >> ?"$prefix" is /usr/share/octave/packages/3.2/java-1.2.6 >> ?"$exec_prefix" is ${prefix} >> >> octave commands will install into the following directories: >> ? m-files: ? /usr/share/octave/3.2.2/site/m/octave-forge >> ? oct-files: >> /usr/lib/octave/3.2.2/site/oct/x86_64-pc-linux-gnu/octave-forge >> ? binaries: ?/usr/lib/octave/3.2.2/site/exec/x86_64-pc-linux-gnu >> alternatives: >> ? m-files: ? /usr/share/octave/3.2.2/site/octave-forge-alternatives/m >> ? oct-files: >> /usr/lib/octave/3.2.2/site/octave-forge-alternatives/oct/x86_64-pc-linux-gnu >> >> shell commands will install into the following directories: >> ? binaries: ?${exec_prefix}/bin >> ? man pages: ${datarootdir}/man >> ? libraries: ${exec_prefix}/lib >> ? headers: ? ${prefix}/include >> >> octave-forge is configured with >> ? octave: ? ? ?octave (version 3.2.2) >> ? mkoctfile: ? mkoctfile for Octave 2 >> ? java: ? ? ? ?yes >> >> find . -name NOINSTALL -print ? ?# shows which toolboxes won't be >> installed >> >> __java__.cc: In member function ?void JVMArgs::read_java_opts(const >> std::string&)?: >> __java__.cc:106: error: ?cerr? is not a member of ?std? >> __java__.cc: In member function ?void JVMArgs::update()?: >> __java__.cc:137: error: ?cout? is not a member of ?std? >> __java__.cc: In function ?void initialize_jvm()?: >> __java__.cc:384: warning: deprecated conversion from string constant to >> ?char*? >> __java__.cc: In function ?_jobject* make_java_index(JNIEnv*, const >> octave_value_list&)?: >> __java__.cc:587: error: ?class idx_vector? has no member named ?capacity? >> __java__.cc:589: error: ?class idx_vector? has no member named ?capacity? >> __java__.cc: In function ?octave_value get_array_elements(JNIEnv*, >> _jobject*, const octave_value_list&)?: >> __java__.cc:611: warning: deprecated conversion from string constant to >> ?char*? >> __java__.cc: In function ?octave_value set_array_elements(JNIEnv*, >> _jobject*, const octave_value_list&, const octave_value&)?: >> __java__.cc:633: warning: deprecated conversion from string constant to >> ?char*? >> __java__.cc: In function ?string_vector get_invoke_list(JNIEnv*, >> _jobject*)?: >> __java__.cc:679: error: ?class string_vector? has no member named ?qsort? >> __java__.cc: In function ?octave_value box(JNIEnv*, _jobject*, >> _jclass*)?: >> __java__.cc:782: warning: deprecated conversion from string constant to >> ?char*? >> __java__.cc:847: warning: deprecated conversion from string constant to >> ?char*? >> __java__.cc: In function ?int unbox(JNIEnv*, const octave_value&, >> jobject_ref&, jclass_ref&)?: >> __java__.cc:987: warning: deprecated conversion from string constant to >> ?char*? >> __java__.cc:1051: warning: deprecated conversion from string constant to >> ?char*? >> __java__.cc: In function ?int java_event_hook()?: >> __java__.cc:1116: warning: deprecated conversion from string constant to >> ?char*? >> __java__.cc: In member function ?octave_value >> octave_java::do_java_invoke(JNIEnv*, const std::string&, const >> octave_value_list&)?: >> __java__.cc:1695: warning: deprecated conversion from string constant to >> ?char*? >> __java__.cc: In static member function ?static octave_value >> octave_java::do_java_invoke(JNIEnv*, const std::string&, const >> std::string&, >> const octave_value_list&)?: >> __java__.cc:1720: warning: deprecated conversion from string constant to >> ?char*? >> __java__.cc: In static member function ?static octave_value >> octave_java::do_java_create(JNIEnv*, const std::string&, const >> octave_value_list&)?: >> __java__.cc:1745: warning: deprecated conversion from string constant to >> ?char*? >> __java__.cc: In member function ?octave_value >> octave_java::do_java_get(JNIEnv*, const std::string&)?: >> __java__.cc:1766: warning: deprecated conversion from string constant to >> ?char*? >> __java__.cc: In static member function ?static octave_value >> octave_java::do_java_get(JNIEnv*, const std::string&, const >> std::string&)?: >> __java__.cc:1786: warning: deprecated conversion from string constant to >> ?char*? >> __java__.cc: In member function ?octave_value >> octave_java::do_java_set(JNIEnv*, const std::string&, const >> octave_value&)?: >> __java__.cc:1812: warning: deprecated conversion from string constant to >> ?char*? >> __java__.cc: In static member function ?static octave_value >> octave_java::do_java_set(JNIEnv*, const std::string&, const std::string&, >> const octave_value&)?: >> __java__.cc:1834: warning: deprecated conversion from string constant to >> ?char*? >> make: *** [__java__.oct] Error 1 >> 'make' returned the following error: make: Entering directory >> `/tmp/oct-22PbG9/java-1.2.6/src' >> if [ "Xamd64X" = "XX" ]; then \ >> ? ? ? ? ? ? ? ?mkoctfile -DHAVE_OCTAVE_32 -v -DJAVAPKG_BUILD >> -I/usr/lib/jvm/java-6-sun/include -I/usr/lib/jvm/java-6-sun/include/linux >> -o >> __java__.oct __java__.cc ; \ >> ? ? ? ?else \ >> ? ? ? ? ? ? ? ?mkoctfile -DHAVE_OCTAVE_32 -v -DJAVAPKG_BUILD >> -DJAVA_ARCH=\\\"amd64\\\" >> -DJAVA_HOME=\\\"/usr/lib/jvm/java-6-sun\\\" >> -I/usr/lib/jvm/java-6-sun/include -I/usr/lib/jvm/java-6-sun/include/linux >> -o >> __java__.oct __java__.cc ; \ >> ? ? ? ?fi >> g++ -c -fPIC -I/usr/include/octave-3.2.2 >> -I/usr/include/octave-3.2.2/octave >> -I/usr/include/freetype2 -O2 -g -I/usr/lib/jvm/java-6-sun/include >> -I/usr/lib/jvm/java-6-sun/include/linux -DHAVE_OCTAVE_32 -DJAVAPKG_BUILD >> -DJAVA_ARCH=\"amd64\" -DJAVA_HOME=\"/usr/lib/jvm/java-6-sun\" __java__.cc >> -o >> __java__.o >> make: Leaving directory `/tmp/oct-22PbG9/java-1.2.6/src' >> error: called from `pkg>configure_make' in file >> /usr/share/octave/3.2.2/m/pkg/pkg.m near line 1253, column 2 >> error: called from: >> error: ? /usr/share/octave/3.2.2/m/pkg/pkg.m at line 714, column 5 >> error: ? /usr/share/octave/3.2.2/m/pkg/pkg.m at line 287, column 7 >> >> Any ideas? >> >> thanks >> >> -- >> View this message in context: >> http://old.nabble.com/compiling-java-package-on-linux-tp26261041p26261041.html >> Sent from the Octave - General mailing list archive at Nabble.com. >> >> >> _______________________________________________ >> Help-octave mailing list >> Help-octave at octave.org >> https://www-old.cae.wisc.edu/mailman/listinfo/help-octave >> > > _______________________________________________ > Help-octave mailing list > Help-octave at octave.org > https://www-old.cae.wisc.edu/mailman/listinfo/help-octave > > -- View this message in context: http://old.nabble.com/compiling-java-package-on-linux-tp26261041p26276410.html Sent from the Octave - General mailing list archive at Nabble.com. From peter at sonderport.dk Tue Nov 10 04:48:45 2009 From: peter at sonderport.dk (Peter L. =?ISO-8859-1?Q?S=F8ndergaard?=) Date: Tue, 10 Nov 2009 11:48:45 +0100 Subject: single/double precision in C++ In-Reply-To: <69d8d540911090637i579fc3e2t8154efd102c34dfc@mail.gmail.com> References: <1257772439.2557.10.camel@localhost.localdomain> <69d8d540911090637i579fc3e2t8154efd102c34dfc@mail.gmail.com> Message-ID: <1257850125.17115.16.camel@localhost.localdomain> > Templates could help you here. Octave 3.3.50+ provides a templatized function > octave_value_extract that extracts a specified matrix type from an octave_value. > If you want to target the 3.2.x series as well (which you probably > do), you can steal these from the development sources and define them > conditionally. > > Using octave_value_extract, you could write something like: > template > static octave_value do_comp_dgt_fac (const octave_value_list& args, > const int a, const int M, > void > (*lib_func) (/* TODO */)) > { > const MT1 f = octave_value_extract args(0); > const MT2 gf = octave_value_extract args(0); > > > const int L = f.rows(); > const int W = f.columns(); > const int R = gf.rows()*gf.columns()/L; > > const int N = L/a; > > MT2 cout(M,N*W*R); > > lib_func (...); > > return cout; > } > > and then call it for the 4 cases > return do_comp_dgt_fac (args, a, m, dgt_fac_r); > etc Thanks for the suggestion, this is just the sort of stuff I don't know about. This made me read up on trait classes. > The C prototypes pose another problem as these use different complex > number type than Octave (Octave uses std::complex and assumes the > layout conforms to Fortran and C99). > > A quick solution is to let these types be implied by the template, but > that is quite unsafe, as it will silently crash if you misspell a > function's name. A better solution is to provide a trait class > converting Octave's types to LTFAT's. A possibly yet better solution > is to alter ltfat.h in such a manner that it will use a user-defined > complex type if one is provided via a #define: > > #include > #define LTFAT_USER_COMPLEX Complex > #define LTFAT_USER_SCOMPLEX FloatComplex > #include "ltfat.h" // will now use Complex and FloatComplex for the prototypes > > this can be useful in general when interfacing with other software. This is actually what is already being done: typedef fftw_complex ltfat_complex; so the complex type is bit-compatible with Octave's. Is there a way of getting around the (ltfat_complex*)f.data() construction when ever I need a pointer to the actual data? It should be easy as you suggest to change the typedef "ltfat_complex" to point to the correct Octave complex format, so perhaps the ugly typecast in the above line could go away. Cheers, Peter. From highegg at gmail.com Tue Nov 10 05:22:30 2009 From: highegg at gmail.com (Jaroslav Hajek) Date: Tue, 10 Nov 2009 12:22:30 +0100 Subject: single/double precision in C++ In-Reply-To: <1257850125.17115.16.camel@localhost.localdomain> References: <1257772439.2557.10.camel@localhost.localdomain> <69d8d540911090637i579fc3e2t8154efd102c34dfc@mail.gmail.com> <1257850125.17115.16.camel@localhost.localdomain> Message-ID: <69d8d540911100322w539803b2s343f70986925b7b0@mail.gmail.com> On Tue, Nov 10, 2009 at 11:48 AM, Peter L. wrote: >> Templates could help you here. Octave 3.3.50+ provides a templatized function >> octave_value_extract that extracts a specified matrix type from an octave_value. >> If you want to target the 3.2.x series as well (which you probably >> do), you can steal these from the development sources and define them >> conditionally. >> >> Using octave_value_extract, you could write something like: >> template >> static octave_value do_comp_dgt_fac (const octave_value_list& args, >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?const int a, const int M, >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?void >> (*lib_func) (/* TODO */)) >> { >> ? const MT1 f = octave_value_extract args(0); >> ? const MT2 gf = octave_value_extract args(0); >> >> >> ? ? ? ?const int L = f.rows(); >> ? ? ? ?const int W = f.columns(); >> ? ? ? ?const int R = gf.rows()*gf.columns()/L; >> >> ? ? ? ?const int N = L/a; >> >> ? ? ? ?MT2 cout(M,N*W*R); >> >> ? ?lib_func (...); >> >> ? return cout; >> } >> >> and then call it for the 4 cases >> return do_comp_dgt_fac (args, a, m, dgt_fac_r); >> etc > > Thanks for the suggestion, this is just the sort of stuff I don't know > about. This made me read up on trait classes. > >> The C prototypes pose another problem as these use different complex >> number type than Octave (Octave uses std::complex and assumes the >> layout conforms to Fortran and C99). >> >> A quick solution is to let these types be implied by the template, but >> that is quite unsafe, as it will silently crash if you misspell a >> function's name. A better solution is to provide a trait class >> converting Octave's types to LTFAT's. A possibly yet better solution >> is to alter ltfat.h in such a manner that it will use a user-defined >> complex type if one is provided via a #define: >> >> #include >> #define LTFAT_USER_COMPLEX Complex >> #define LTFAT_USER_SCOMPLEX FloatComplex >> #include "ltfat.h" // will now use Complex and FloatComplex for the prototypes >> >> this can be useful in general when interfacing with other software. > This is actually what is already being done: > > ? typedef fftw_complex ?ltfat_complex; > > so the complex type is bit-compatible with Octave's. > Yes, that is the assumption (it's not actually guaranteed by C++, but Octave uses the same assumption), but being compatible is not enough - C++ still won't allow you to implicitly convert fftw_complex to std::complex. I checked out ltfat and hacked together a patch (not actually tested) demonstrating my meaning: Index: comp_dgt_fac.cc =================================================================== --- comp_dgt_fac.cc (revision 879) +++ comp_dgt_fac.cc (working copy) @@ -2,57 +2,64 @@ #include "config.h" #include "ltfat.h" +template +static octave_value +do_comp_dgt_fac (const octave_value_list& args, + const int a, const int M, + void (*lib_func) (typename MT1::element_type *, + typename MT2::element_type *, + const int, const int, + const int, const int, + const int, + typename MT2::element_type *)) +{ + typedef typename MT1::element_type T1; + typedef typename MT2::element_type T2; + + const MT1 f = octave_value_extract args(0); + const MT2 gf = octave_value_extract args(1); + + const int L = f.rows(); + const int W = f.columns(); + const int R = gf.rows()*gf.columns()/L; + + const int N = L/a; + + MT2 cout(M,N*W*R); + + // const_casts are necessary because LTFAT doesn't specify const on input data. + lib_func (const_cast(f.fortran_vec ()), const_cast(gf.fortran_vec ()), + L, W, R, a, M, cout.fortran_vec ()); + + return cout; +} + +template DEFUN_DLD (comp_dgt_fac, args, , "This function calls the C-library\n\ c=comp_dgt_fac(f,gf,a,M);\n\ Yeah.") { + octave_value_list retval; const bool f_is_complex = args(0).is_complex_type(); const int a = args(2).int_value(); const int M = args(3).int_value(); - if (f_is_complex) - { - - const ComplexMatrix f = args(0).complex_matrix_value(); - const ComplexMatrix gf = args(1).complex_matrix_value(); - - const int L = f.rows(); - const int W = f.columns(); - const int R = gf.rows()*gf.columns()/L; - - const int N = L/a; - - ComplexMatrix cout(M,N*W*R); - - dgt_fac((ltfat_complex*)f.data(),(ltfat_complex*)gf.data(), - L, W, R, a, M,(ltfat_complex*)cout.data()); - - return octave_value (cout); - - - } + if (args(0).is_single_type ()) + { + if (f_is_complex) + do_comp_dgt_fac (args, a, M, sdgt_fac); + else + do_comp_dgt_fac (args, a, M, sdgt_fac_r); + } else - { + { + if (f_is_complex) + do_comp_dgt_fac (args, a, M, dgt_fac); + else + do_comp_dgt_fac (args, a, M, dgt_fac_r); + } - const Matrix f = args(0).matrix_value(); - const ComplexMatrix gf = args(1).complex_matrix_value(); - - const int L = f.rows(); - const int W = f.columns(); - const int R = gf.rows()*gf.columns()/L; - - const int N = L/a; - - ComplexMatrix cout(M,N*W*R); - - dgt_fac_r((double*)f.data(),(ltfat_complex*)gf.data(), - L, W, R, a, M,(ltfat_complex*)cout.data()); - - return octave_value (cout); - - } - } Index: config.h =================================================================== --- config.h (revision 879) +++ config.h (working copy) @@ -5,13 +5,15 @@ #define CONFIG_H 1 #include "fftw3.h" + +#define LTFAT_USER_COMPLEX +typedef Complex ltfat_complex; +typedef FloatComplex ltfat_scomplex; + #include "ltfat.h" #define FFTW_OPTITYPE FFTW_ESTIMATE -typedef fftw_complex ltfat_complex; -typedef fftwf_complex ltfat_scomplex; - void* ltfat_malloc (size_t n) { return fftw_malloc(n); in this manner, you write the bulk of the interfacing code just once, in a template, then instantiate the template 4 times. The trick in ltfat.h is used to map the correct Octave complex types into the prototypes. Note that there are still const_casts for the first two arguments, because the prototypes in LTFAT do not specify const input pointers (assuming the input data is unchanged). You can get rid of them (and get even better prototype checking) by augmenting the prototypes in ltfat_typeindependent.h by CONST (#defined to const or nothing) specifiers where a const pointer is only needed. Another option is to not specify const for f and gf, but that way you'll get a useless copy of the data (if you query a writable pointer for Octave's matrix types, the data is internally unshared). hth -- RNDr. Jaroslav Hajek computing expert & GNU Octave developer Aeronautical Research and Test Institute (VZLU) Prague, Czech Republic url: www.highegg.matfyz.cz From highegg at gmail.com Tue Nov 10 05:27:10 2009 From: highegg at gmail.com (Jaroslav Hajek) Date: Tue, 10 Nov 2009 12:27:10 +0100 Subject: single/double precision in C++ In-Reply-To: <69d8d540911100322w539803b2s343f70986925b7b0@mail.gmail.com> References: <1257772439.2557.10.camel@localhost.localdomain> <69d8d540911090637i579fc3e2t8154efd102c34dfc@mail.gmail.com> <1257850125.17115.16.camel@localhost.localdomain> <69d8d540911100322w539803b2s343f70986925b7b0@mail.gmail.com> Message-ID: <69d8d540911100327r36ef64ect45b6c4ed8055f619@mail.gmail.com> On Tue, Nov 10, 2009 at 12:22 PM, Jaroslav Hajek wrote: > On Tue, Nov 10, 2009 at 11:48 AM, Peter L. wrote: >>> Templates could help you here. Octave 3.3.50+ provides a templatized function >>> octave_value_extract that extracts a specified matrix type from an octave_value. >>> If you want to target the 3.2.x series as well (which you probably >>> do), you can steal these from the development sources and define them >>> conditionally. >>> >>> Using octave_value_extract, you could write something like: >>> template >>> static octave_value do_comp_dgt_fac (const octave_value_list& args, >>> const int a, const int M, >>> void >>> (*lib_func) (/* TODO */)) >>> { >>> const MT1 f = octave_value_extract args(0); >>> const MT2 gf = octave_value_extract args(0); >>> >>> >>> const int L = f.rows(); >>> const int W = f.columns(); >>> const int R = gf.rows()*gf.columns()/L; >>> >>> const int N = L/a; >>> >>> MT2 cout(M,N*W*R); >>> >>> lib_func (...); >>> >>> return cout; >>> } >>> >>> and then call it for the 4 cases >>> return do_comp_dgt_fac (args, a, m, dgt_fac_r); >>> etc >> >> Thanks for the suggestion, this is just the sort of stuff I don't know >> about. This made me read up on trait classes. >> >>> The C prototypes pose another problem as these use different complex >>> number type than Octave (Octave uses std::complex and assumes the >>> layout conforms to Fortran and C99). >>> >>> A quick solution is to let these types be implied by the template, but >>> that is quite unsafe, as it will silently crash if you misspell a >>> function's name. A better solution is to provide a trait class >>> converting Octave's types to LTFAT's. A possibly yet better solution >>> is to alter ltfat.h in such a manner that it will use a user-defined >>> complex type if one is provided via a #define: >>> >>> #include >>> #define LTFAT_USER_COMPLEX Complex >>> #define LTFAT_USER_SCOMPLEX FloatComplex >>> #include "ltfat.h" // will now use Complex and FloatComplex for the prototypes >>> >>> this can be useful in general when interfacing with other software. >> This is actually what is already being done: >> >> typedef fftw_complex ltfat_complex; >> >> so the complex type is bit-compatible with Octave's. >> > > Yes, that is the assumption (it's not actually guaranteed by C++, but > Octave uses the same assumption), but being compatible is not enough - > C++ still won't allow you to implicitly convert fftw_complex to > std::complex. > > I checked out ltfat and hacked together a patch (not actually tested) > demonstrating my meaning: > Once more, this time complete and not garbled (attached). hth -- RNDr. Jaroslav Hajek computing expert & GNU Octave developer Aeronautical Research and Test Institute (VZLU) Prague, Czech Republic url: www.highegg.matfyz.cz -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091110/4af8be0f/attachment-0001.html -------------- next part -------------- A non-text attachment was scrubbed... Name: ltfat.diff Type: text/x-patch Size: 3992 bytes Desc: not available Url : https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091110/4af8be0f/attachment-0001.bin From jwe at octave.org Tue Nov 10 05:56:30 2009 From: jwe at octave.org (John W. Eaton) Date: Tue, 10 Nov 2009 06:56:30 -0500 Subject: single/double precision in C++ In-Reply-To: <69d8d540911100322w539803b2s343f70986925b7b0@mail.gmail.com> References: <1257772439.2557.10.camel@localhost.localdomain> <69d8d540911090637i579fc3e2t8154efd102c34dfc@mail.gmail.com> <1257850125.17115.16.camel@localhost.localdomain> <69d8d540911100322w539803b2s343f70986925b7b0@mail.gmail.com> Message-ID: <19193.21742.524356.649040@segfault.lan> On 10-Nov-2009, Jaroslav Hajek wrote: | + // const_casts are necessary because LTFAT doesn't specify const on input data. | + lib_func (const_cast(f.fortran_vec ()), const_cast(gf.fortran_vec ()), | + L, W, R, a, M, cout.fortran_vec ()); Maybe I'm missing something, but I don't see why the const_cast is necessary here. The result of fortran_vec is not const. The following compiles cleanly for me: #include static void bar (double *) { } DEFUN_DLD (foo, , , "") { Matrix m; bar (m.fortran_vec ()); return octave_value_list (); } Changing the above to use bar (m.data ()); would be a compile-time error because the data method returns a const pointer. But casting away const there would not be the thing to do unless you know that the called function does not modify its argument. And in that case, you should really fix the prototype for the called function, not cast away const. jwe From highegg at gmail.com Tue Nov 10 06:00:44 2009 From: highegg at gmail.com (Jaroslav Hajek) Date: Tue, 10 Nov 2009 13:00:44 +0100 Subject: single/double precision in C++ In-Reply-To: <19193.21742.524356.649040@segfault.lan> References: <1257772439.2557.10.camel@localhost.localdomain> <69d8d540911090637i579fc3e2t8154efd102c34dfc@mail.gmail.com> <1257850125.17115.16.camel@localhost.localdomain> <69d8d540911100322w539803b2s343f70986925b7b0@mail.gmail.com> <19193.21742.524356.649040@segfault.lan> Message-ID: <69d8d540911100400h490111c5x392f84d3d5e2b457@mail.gmail.com> On Tue, Nov 10, 2009 at 12:56 PM, John W. Eaton wrote: > On 10-Nov-2009, Jaroslav Hajek wrote: > > | + // const_casts are necessary because LTFAT doesn't specify const on > input data. > | + lib_func (const_cast(f.fortran_vec ()), const_cast *>(gf.fortran_vec ()), > | + L, W, R, a, M, cout.fortran_vec ()); > > Maybe I'm missing something, but I don't see why the const_cast is > necessary here. The result of fortran_vec is not const. > > The result of fortran_vec *is* const when called on a const variable, which is the case here. In this sense, fortran_vec behaves just like the elem() functions. data () is a const-only method. -- RNDr. Jaroslav Hajek computing expert & GNU Octave developer Aeronautical Research and Test Institute (VZLU) Prague, Czech Republic url: www.highegg.matfyz.cz -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091110/e007940c/attachment.html From jwe at octave.org Tue Nov 10 06:14:10 2009 From: jwe at octave.org (John W. Eaton) Date: Tue, 10 Nov 2009 07:14:10 -0500 Subject: single/double precision in C++ In-Reply-To: <69d8d540911100400h490111c5x392f84d3d5e2b457@mail.gmail.com> References: <1257772439.2557.10.camel@localhost.localdomain> <69d8d540911090637i579fc3e2t8154efd102c34dfc@mail.gmail.com> <1257850125.17115.16.camel@localhost.localdomain> <69d8d540911100322w539803b2s343f70986925b7b0@mail.gmail.com> <19193.21742.524356.649040@segfault.lan> <69d8d540911100400h490111c5x392f84d3d5e2b457@mail.gmail.com> Message-ID: <19193.22802.947089.734810@segfault.lan> On 10-Nov-2009, Jaroslav Hajek wrote: | On Tue, Nov 10, 2009 at 12:56 PM, John W. Eaton wrote: | | > On 10-Nov-2009, Jaroslav Hajek wrote: | > | > | + // const_casts are necessary because LTFAT doesn't specify const on | > input data. | > | + lib_func (const_cast(f.fortran_vec ()), const_cast *>(gf.fortran_vec ()), | > | + L, W, R, a, M, cout.fortran_vec ()); | > | > Maybe I'm missing something, but I don't see why the const_cast is | > necessary here. The result of fortran_vec is not const. | > | > | The result of fortran_vec *is* const when called on a const variable, which | is the case here. In this sense, fortran_vec behaves just like the elem() | functions. data () is a const-only method. OK, so I was missing something. :-) But I would still not recommend getting in the habit of casting away const... jwe From highegg at gmail.com Tue Nov 10 06:29:17 2009 From: highegg at gmail.com (Jaroslav Hajek) Date: Tue, 10 Nov 2009 13:29:17 +0100 Subject: single/double precision in C++ In-Reply-To: <19193.22802.947089.734810@segfault.lan> References: <1257772439.2557.10.camel@localhost.localdomain> <69d8d540911090637i579fc3e2t8154efd102c34dfc@mail.gmail.com> <1257850125.17115.16.camel@localhost.localdomain> <69d8d540911100322w539803b2s343f70986925b7b0@mail.gmail.com> <19193.21742.524356.649040@segfault.lan> <69d8d540911100400h490111c5x392f84d3d5e2b457@mail.gmail.com> <19193.22802.947089.734810@segfault.lan> Message-ID: <69d8d540911100429v77f73e32ne76ea4c5e9f206ed@mail.gmail.com> On Tue, Nov 10, 2009 at 1:14 PM, John W. Eaton wrote: > On 10-Nov-2009, Jaroslav Hajek wrote: > > | On Tue, Nov 10, 2009 at 12:56 PM, John W. Eaton wrote: > | > | > On 10-Nov-2009, Jaroslav Hajek wrote: > | > > | > | + // const_casts are necessary because LTFAT doesn't specify const on > | > input data. > | > | + lib_func (const_cast(f.fortran_vec ()), const_cast | > *>(gf.fortran_vec ()), > | > | + L, W, R, a, M, cout.fortran_vec ()); > | > > | > Maybe I'm missing something, but I don't see why the const_cast is > | > necessary here. The result of fortran_vec is not const. > | > > | > > | The result of fortran_vec *is* const when called on a const variable, > which > | is the case here. In this sense, fortran_vec behaves just like the elem() > | functions. data () is a const-only method. > > OK, so I was missing something. :-) > > But I would still not recommend getting in the habit of casting away > const... > Neither would I - that's why I recommended to improve the ltfat headers. But when you're dealing with legacy code... Of course, an alternative is to bother the extra copy and just get a writable pointer. But that doesn't work if you're a little obsessed by performance, like me :) regards -- RNDr. Jaroslav Hajek computing expert & GNU Octave developer Aeronautical Research and Test Institute (VZLU) Prague, Czech Republic url: www.highegg.matfyz.cz -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091110/75040628/attachment.html From dustin.brothers at computer.org Tue Nov 10 10:11:10 2009 From: dustin.brothers at computer.org (Dustin Brothers) Date: Tue, 10 Nov 2009 09:11:10 -0700 Subject: rlocus Step Size Change Message-ID: Octave Gurus, I am trying to change the step size and range of the "gain" of my system while using rlocus and cannot seem to get it to function properly. I have the following packages installed (control and signal), and am using qtoctave as a GUI front-end. According to your *documentation*, I should be able to change the step size following the syntax: rlocus(sys, [step,min,max]); Yet, I am getting errors. Is this possible another way, utilizing a k-vector and multiplying into the system transfer function prior to using rlocus? Or am I using this wrong (very likely :])? Any help you can give me would be great! Thanks. Dustin Brothers MSCD Engineering -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091110/7a61fe4b/attachment.html From dastew at sympatico.ca Tue Nov 10 11:01:02 2009 From: dastew at sympatico.ca (dastew at sympatico.ca) Date: Tue, 10 Nov 2009 17:01:02 +0000 Subject: rlocus Step Size Change In-Reply-To: References: Message-ID: Date: Tue, 10 Nov 2009 09:11:10 -0700 Subject: rlocus Step Size Change From: dustin.brothers at computer.org To: help at octave.org Octave Gurus, I am trying to change the step size and range of the "gain" of my system while using rlocus and cannot seem to get it to function properly. I have the following packages installed (control and signal), and am using qtoctave as a GUI front-end. According to your documentation, I should be able to change the step size following the syntax: rlocus(sys, [step,min,max]); Yet, I am getting errors. Is this possible another way, utilizing a k-vector and multiplying into the system transfer function prior to using rlocus? Or am I using this wrong (very likely :])? Any help you can give me would be great! Thanks. Dustin Brothers MSCD Engineering try rlocus(sys, step,min,max); no [] brackets Doug -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091110/4cddcc30/attachment.html From rpf at gmx.li Tue Nov 10 11:34:09 2009 From: rpf at gmx.li (rpf at gmx.li) Date: Tue, 10 Nov 2009 18:34:09 +0100 Subject: gnuplot 4.5 Message-ID: I would like to use gnuplot 4.5 compiled from source with octave (from ubuntu-repositories). I have compiled it into my $HOME/usr directory. Is there any way to tell octave to use the gnuplot in my $HOME/usr instead of the one in /usr ? thanks! --h From soren at hauberg.org Tue Nov 10 11:49:59 2009 From: soren at hauberg.org (=?ISO-8859-1?Q?S=F8ren?= Hauberg) Date: Tue, 10 Nov 2009 18:49:59 +0100 Subject: gnuplot 4.5 In-Reply-To: References: Message-ID: <1257875399.2851.29.camel@hauberg-laptop> Look at the 'gnuplot_binary' function. S?ren tir, 10 11 2009 kl. 18:34 +0100, skrev rpf at gmx.li: > I would like to use gnuplot 4.5 compiled from source with octave (from > ubuntu-repositories). I have compiled it into my $HOME/usr directory. > Is there any way to tell octave to use the gnuplot in my $HOME/usr > instead of the one in /usr ? > > thanks! > --h > _______________________________________________ > Help-octave mailing list > Help-octave at octave.org > https://www-old.cae.wisc.edu/mailman/listinfo/help-octave From l.butler at ed.ac.uk Tue Nov 10 11:53:06 2009 From: l.butler at ed.ac.uk (Leo Butler) Date: Tue, 10 Nov 2009 17:53:06 +0000 (GMT) Subject: gnuplot 4.5 In-Reply-To: References: Message-ID: On Tue, 10 Nov 2009, rpf at gmx.li wrote: < I would like to use gnuplot 4.5 compiled from source with octave (from < ubuntu-repositories). I have compiled it into my $HOME/usr directory. < Is there any way to tell octave to use the gnuplot in my $HOME/usr < instead of the one in /usr ? Try help gnuplot_binary for this info. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From peter at sonderport.dk Tue Nov 10 12:50:14 2009 From: peter at sonderport.dk (Peter =?ISO-8859-1?Q?S=F8ndergaard?=) Date: Tue, 10 Nov 2009 19:50:14 +0100 Subject: single/double precision in C++ In-Reply-To: <69d8d540911100429v77f73e32ne76ea4c5e9f206ed@mail.gmail.com> References: <1257772439.2557.10.camel@localhost.localdomain> <69d8d540911090637i579fc3e2t8154efd102c34dfc@mail.gmail.com> <1257850125.17115.16.camel@localhost.localdomain> <69d8d540911100322w539803b2s343f70986925b7b0@mail.gmail.com> <19193.21742.524356.649040@segfault.lan> <69d8d540911100400h490111c5x392f84d3d5e2b457@mail.gmail.com> <19193.22802.947089.734810@segfault.lan> <69d8d540911100429v77f73e32ne76ea4c5e9f206ed@mail.gmail.com> Message-ID: <1257879014.5765.1.camel@peter-laptop> > Neither would I - that's why I recommended to improve the ltfat > headers. But when you're dealing with legacy code... > Of course, an alternative is to bother the extra copy and just get a > writable pointer. But that doesn't work if you're a little obsessed by > performance, like me :) > No worries :-), I will put in CONST as suggested. Cheers, Peter. > regards > > -- > RNDr. Jaroslav Hajek > computing expert & GNU Octave developer > Aeronautical Research and Test Institute (VZLU) > Prague, Czech Republic > url: www.highegg.matfyz.cz From rpf at gmx.li Tue Nov 10 12:53:49 2009 From: rpf at gmx.li (rpf at gmx.li) Date: Tue, 10 Nov 2009 19:53:49 +0100 Subject: gnuplot 4.5 In-Reply-To: References: Message-ID: thanks for the fast answer! When I now set the path to the gnuplot 4.5 executable with gnuplot_binary("/my/home/usr/bin/gnuplot") , I still cannot get the zoom to work. The zooming does work, when I just run gnuplot by itself, so the problem is within octave. When I call __gnuplot_version__ in octave, I get 4.2 - What am I missing? On Tue, Nov 10, 2009 at 6:53 PM, Leo Butler wrote: > > > On Tue, 10 Nov 2009, rpf at gmx.li wrote: > > < I would like to use gnuplot 4.5 compiled from source with octave (from > < ubuntu-repositories). I have compiled it into my $HOME/usr directory. > < Is there any way to tell octave to use the gnuplot in my $HOME/usr > < instead of the one in /usr ? > > Try > > help gnuplot_binary > > for this info. > > Leo > > -- > The University of Edinburgh is a charitable body, registered in > Scotland, with registration number SC005336. > > From soren at hauberg.org Tue Nov 10 13:11:56 2009 From: soren at hauberg.org (=?ISO-8859-1?Q?S=F8ren?= Hauberg) Date: Tue, 10 Nov 2009 20:11:56 +0100 Subject: gnuplot 4.5 In-Reply-To: References: Message-ID: <1257880316.2851.34.camel@hauberg-laptop> tir, 10 11 2009 kl. 19:53 +0100, skrev rpf at gmx.li: > When I now set the path to the gnuplot 4.5 executable with > gnuplot_binary("/my/home/usr/bin/gnuplot") , I still cannot get the > zoom to work. The zooming does work, when I just run gnuplot by > itself, so the problem is within octave. When I call > __gnuplot_version__ in octave, I get 4.2 - Did you plot anything before calling 'gnuplot_binary'? The version information is cached inside '__gnuplot_version__' meaning that it will only be computed the first time you plot something. You might want to try to call clear __gnuplot_version__ after calling 'gnuplot_binary'. Perhaps this should be done automatically when you call 'gnuplot_binary', but I'm unsure if this would have unwanted side-effects. S?ren From dastew at sympatico.ca Tue Nov 10 18:45:38 2009 From: dastew at sympatico.ca (dastew at sympatico.ca) Date: Wed, 11 Nov 2009 00:45:38 +0000 Subject: rlocus Step Size Change In-Reply-To: References: Message-ID: Date: Tue, 10 Nov 2009 17:31:38 -0700 Subject: Re: rlocus Step Size Change From: dustin.brothers at computer.org To: dastew at sympatico.ca Doug, That didn't work, it pulled my locus off the real plane for some reason (which shouldn't happen as I have one zero at +infiniti and my single pole is real). I also just tried adding the step size: rlocus(sys, stepsize); which resulted in the same effect as your suggestion. Any other thoughts? Thanks for your help! -Dustin B On Tue, Nov 10, 2009 at 10:01 AM, wrote: Date: Tue, 10 Nov 2009 09:11:10 -0700 Subject: rlocus Step Size Change From: dustin.brothers at computer.org To: help at octave.org Octave Gurus, I am trying to change the step size and range of the "gain" of my system while using rlocus and cannot seem to get it to function properly. I have the following packages installed (control and signal), and am using qtoctave as a GUI front-end. According to your documentation, I should be able to change the step size following the syntax: rlocus(sys, [step,min,max]); Yet, I am getting errors. Is this possible another way, utilizing a k-vector and multiplying into the system transfer function prior to using rlocus? Or am I using this wrong (very likely :])? Any help you can give me would be great! Thanks. Dustin Brothers MSCD Engineering try rlocus(sys, step,min,max); no [] brackets Doug Please send me your sys or your code. Doug -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091111/71747b5c/attachment.html From ihsanmrasheed at yahoo.com Tue Nov 10 22:23:11 2009 From: ihsanmrasheed at yahoo.com (Ihsan Rasheed) Date: Tue, 10 Nov 2009 20:23:11 -0800 (PST) Subject: save Message-ID: <424220.43284.qm@web50803.mail.re2.yahoo.com> i want to save all commands in a file, my os is winxp, with octave 3.2.3 ? -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091110/77fba537/attachment.html From michael at grossbach.org Wed Nov 11 04:15:29 2009 From: michael at grossbach.org (Michael Grossbach) Date: Wed, 11 Nov 2009 11:15:29 +0100 Subject: save In-Reply-To: <424220.43284.qm@web50803.mail.re2.yahoo.com> References: <424220.43284.qm@web50803.mail.re2.yahoo.com> Message-ID: <4AFA8EC1.1040501@grossbach.org> Ihsan Rasheed wrote: > i want to save all commands in a file, my os is winxp, with octave 3.2.3 > help diary From rpf at gmx.li Wed Nov 11 05:19:23 2009 From: rpf at gmx.li (rpf at gmx.li) Date: Wed, 11 Nov 2009 12:19:23 +0100 Subject: gnuplot 4.5 In-Reply-To: <1257880316.2851.34.camel@hauberg-laptop> References: <1257880316.2851.34.camel@hauberg-laptop> Message-ID: thanks for the help - I got the right gnuplot to work now. However, I still have a problem understand which version of gnuplot octave uses. On startup, it says gnuplot_binary ans = gnuplot When I run which gnuplot on my terminal, I get /my/home/usr/bin/gnuplot which is exactly the version 4.5 executable I want octave to use. However, if I don't call gnuplot_binary("/my/home/usr/bin/gnuplot"), octave uses the gnuplot 4.2 executable from /usr/bin ! I thought I could avoid that problem by adding gnuplot_binary(/my/home/usr/bin/gnuplot") to my .octaverc , but I ran into another problem: whichever variable gnuplot_binary writes to, this variable is deleted by "clear all". Most of my scripts start with clear all, so all the plotting in those scripts is done in gnuplot 4.2 again! Can someone explain this behaviour to me and maybe suggest an easy way to deal with it? - thanks --h On Tue, Nov 10, 2009 at 8:11 PM, S?ren Hauberg wrote: > tir, 10 11 2009 kl. 19:53 +0100, skrev rpf at gmx.li: >> When I now set the path to the gnuplot 4.5 executable with >> gnuplot_binary("/my/home/usr/bin/gnuplot") , I still cannot get the >> zoom to work. The zooming does work, when I just run gnuplot by >> itself, so the problem is within octave. When I call >> __gnuplot_version__ in octave, I get 4.2 - > > Did you plot anything before calling 'gnuplot_binary'? The version > information is cached inside '__gnuplot_version__' meaning that it will > only be computed the first time you plot something. > > You might want to try to call > > ?clear __gnuplot_version__ > > after calling 'gnuplot_binary'. Perhaps this should be done > automatically when you call 'gnuplot_binary', but I'm unsure if this > would have unwanted side-effects. > > S?ren > > > From bpabbott at mac.com Wed Nov 11 06:58:40 2009 From: bpabbott at mac.com (Ben Abbott) Date: Wed, 11 Nov 2009 07:58:40 -0500 Subject: gnuplot 4.5 In-Reply-To: References: <1257880316.2851.34.camel@hauberg-laptop> Message-ID: <82C3671D-E5D0-4746-96FD-AFE9F672744E@mac.com> On Nov 11, 2009, at 6:19 AM, rpf at gmx.li wrote: > > On Tue, Nov 10, 2009 at 8:11 PM, S?ren Hauberg wrote: >> tir, 10 11 2009 kl. 19:53 +0100, skrev rpf at gmx.li: >>> When I now set the path to the gnuplot 4.5 executable with >>> gnuplot_binary("/my/home/usr/bin/gnuplot") , I still cannot get the >>> zoom to work. The zooming does work, when I just run gnuplot by >>> itself, so the problem is within octave. When I call >>> __gnuplot_version__ in octave, I get 4.2 - >> >> Did you plot anything before calling 'gnuplot_binary'? The version >> information is cached inside '__gnuplot_version__' meaning that it will >> only be computed the first time you plot something. >> >> You might want to try to call >> >> clear __gnuplot_version__ >> >> after calling 'gnuplot_binary'. Perhaps this should be done >> automatically when you call 'gnuplot_binary', but I'm unsure if this >> would have unwanted side-effects. >> >> S?ren >> > thanks for the help - I got the right gnuplot to work now. > > However, I still have a problem understand which version of gnuplot > octave uses. On startup, it says > > gnuplot_binary > ans = gnuplot > > When I run > > which gnuplot > > on my terminal, I get > > /my/home/usr/bin/gnuplot > > which is exactly the version 4.5 executable I want octave to use. > However, if I don't call gnuplot_binary("/my/home/usr/bin/gnuplot"), > octave uses the gnuplot 4.2 executable from /usr/bin ! I thought I > could avoid that problem by adding > gnuplot_binary(/my/home/usr/bin/gnuplot") to my .octaverc , but I ran > into another problem: whichever variable gnuplot_binary writes to, > this variable is deleted by "clear all". Most of my scripts start with > clear all, so all the plotting in those scripts is done in gnuplot 4.2 > again! > > Can someone explain this behaviour to me and maybe suggest an easy way > to deal with it? - > > thanks > --h Perhaps the path in Octave's shell is not the same are at your terminal prompt? >From Octave, try [status, output] = system ("which gnuplot") Ben From l.butler at ed.ac.uk Wed Nov 11 08:04:37 2009 From: l.butler at ed.ac.uk (Leo Butler) Date: Wed, 11 Nov 2009 14:04:37 +0000 (GMT) Subject: gnuplot 4.5 In-Reply-To: References: <1257880316.2851.34.camel@hauberg-laptop> Message-ID: On Wed, 11 Nov 2009, rpf at gmx.li wrote: < thanks for the help - I got the right gnuplot to work now. < < However, I still have a problem understand which version of gnuplot < octave uses. On startup, it says < < gnuplot_binary < ans = gnuplot < < When I run < < which gnuplot < < on my terminal, I get < < /my/home/usr/bin/gnuplot < < which is exactly the version 4.5 executable I want octave to use. < However, if I don't call gnuplot_binary("/my/home/usr/bin/gnuplot"), < octave uses the gnuplot 4.2 executable from /usr/bin ! I thought I < could avoid that problem by adding < gnuplot_binary(/my/home/usr/bin/gnuplot") to my .octaverc , but I ran < into another problem: whichever variable gnuplot_binary writes to, < this variable is deleted by "clear all". Most of my scripts start with < clear all, so all the plotting in those scripts is done in gnuplot 4.2 < again! < < Can someone explain this behaviour to me and maybe suggest an easy way < to deal with it? - Try clear -x gnuplot_binary in place of clear all. For more, look at help clear Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From jwe at octave.org Wed Nov 11 08:22:35 2009 From: jwe at octave.org (John W. Eaton) Date: Wed, 11 Nov 2009 09:22:35 -0500 Subject: gnuplot 4.5 In-Reply-To: References: <1257880316.2851.34.camel@hauberg-laptop> Message-ID: <19194.51371.80322.25748@segfault.lan> On 11-Nov-2009, Leo Butler wrote: | < Can someone explain this behaviour to me and maybe suggest an easy way | < to deal with it? - The problem is that gnuplot_binary is not a built-in function, so it can be cleared like any other user-defined function. | Try | | clear -x gnuplot_binary | | in place of clear all. Maybe a better solution would be to put a call to mlock in the gnuplot_binary function? jwe From rpf at gmx.li Wed Nov 11 08:35:20 2009 From: rpf at gmx.li (rpf at gmx.li) Date: Wed, 11 Nov 2009 15:35:20 +0100 Subject: gnuplot 4.5 In-Reply-To: <82C3671D-E5D0-4746-96FD-AFE9F672744E@mac.com> References: <1257880316.2851.34.camel@hauberg-laptop> <82C3671D-E5D0-4746-96FD-AFE9F672744E@mac.com> Message-ID: You're right : octave:1> [status,output] = system("which gnuplot") status = 0 output = /usr/bin/gnuplot Then I tried octave:3> [status,output] = system("echo $PATH") which yields status = 0 output = /usr/lib/octave/3.0.1/site/exec/x86_64-pc-linux-gnu:/usr/lib/octave/api-v32/site/exec/x86_64-pc-linux-gnu:/usr/lib/octave/site/exec/x86_64-pc-linux-gnu:/usr/lib/octave/3.0.1/exec/x86_64-pc-linux-gnu:/usr/bin:$PATH Where $PATH is the variable set in my .bashrc. Why does octave add /usr/bin to my path? That is what is causing the "wrong" gnuplot to be called. On Wed, Nov 11, 2009 at 1:58 PM, Ben Abbott wrote: > > On Nov 11, 2009, at 6:19 AM, rpf at gmx.li wrote: > >> >> On Tue, Nov 10, 2009 at 8:11 PM, S?ren Hauberg wrote: >>> tir, 10 11 2009 kl. 19:53 +0100, skrev rpf at gmx.li: >>>> When I now set the path to the gnuplot 4.5 executable with >>>> gnuplot_binary("/my/home/usr/bin/gnuplot") , I still cannot get the >>>> zoom to work. The zooming does work, when I just run gnuplot by >>>> itself, so the problem is within octave. When I call >>>> __gnuplot_version__ in octave, I get 4.2 - >>> >>> Did you plot anything before calling 'gnuplot_binary'? The version >>> information is cached inside '__gnuplot_version__' meaning that it will >>> only be computed the first time you plot something. >>> >>> You might want to try to call >>> >>> ?clear __gnuplot_version__ >>> >>> after calling 'gnuplot_binary'. Perhaps this should be done >>> automatically when you call 'gnuplot_binary', but I'm unsure if this >>> would have unwanted side-effects. >>> >>> S?ren >>> >> thanks for the help - I got the right gnuplot to work now. >> >> However, I still have a problem understand which version of gnuplot >> octave uses. On startup, it says >> >> gnuplot_binary >> ans = gnuplot >> >> When I run >> >> which gnuplot >> >> on my terminal, I get >> >> /my/home/usr/bin/gnuplot >> >> which is exactly the version 4.5 executable I want octave to use. >> However, if I don't call gnuplot_binary("/my/home/usr/bin/gnuplot"), >> octave uses the gnuplot 4.2 executable from /usr/bin ! I thought I >> could avoid that problem by adding >> gnuplot_binary(/my/home/usr/bin/gnuplot") to my .octaverc , but I ran >> into another problem: whichever variable gnuplot_binary writes to, >> this variable is deleted by "clear all". Most of my scripts start with >> clear all, so all the plotting in those scripts is done in gnuplot 4.2 >> again! >> >> Can someone explain this behaviour to me and maybe suggest an easy way >> to deal with it? - >> >> thanks >> --h > > Perhaps the path in Octave's shell is not the same are at your terminal prompt? > > From Octave, try > > ? ? ? ?[status, output] = system ("which gnuplot") > > Ben > > From jwe at octave.org Wed Nov 11 09:14:57 2009 From: jwe at octave.org (John W. Eaton) Date: Wed, 11 Nov 2009 10:14:57 -0500 Subject: gnuplot 4.5 In-Reply-To: References: <1257880316.2851.34.camel@hauberg-laptop> <82C3671D-E5D0-4746-96FD-AFE9F672744E@mac.com> Message-ID: <19194.54513.804047.629421@segfault.lan> On 11-Nov-2009, rpf at gmx.li wrote: | You're right : | | octave:1> [status,output] = system("which gnuplot") | status = 0 | output = /usr/bin/gnuplot | | Then I tried | | octave:3> [status,output] = system("echo $PATH") | | which yields | | status = 0 | output = /usr/lib/octave/3.0.1/site/exec/x86_64-pc-linux-gnu:/usr/lib/octave/api-v32/site/exec/x86_64-pc-linux-gnu:/usr/lib/octave/site/exec/x86_64-pc-linux-gnu:/usr/lib/octave/3.0.1/exec/x86_64-pc-linux-gnu:/usr/bin:$PATH | | Where $PATH is the variable set in my .bashrc. Why does octave add | /usr/bin to my path? That is what is causing the "wrong" gnuplot to be | called. I don't remember precisely, but I'm guessing now that the reason was so that the mkoctfile and octave-bug script could be found even if the directory where they (and Octave) are installed is not in your PATH when you start Octave. The directory /usr/bin is actually $bindir, which may be something else like /usr/local/bin or /opt/bin depending on the value of the --prefix option provided when Octave is configured. jwe From dastew at sympatico.ca Wed Nov 11 09:34:13 2009 From: dastew at sympatico.ca (dastew at sympatico.ca) Date: Wed, 11 Nov 2009 15:34:13 +0000 Subject: rlocus Step Size Change In-Reply-To: References: , , , , Message-ID: On Tue, Nov 10, 2009 at 5:45 PM, wrote: Date: Tue, 10 Nov 2009 17:31:38 -0700 Subject: Re: rlocus Step Size Change From: dustin.brothers at computer.org To: dastew at sympatico.ca Doug, That didn't work, it pulled my locus off the real plane for some reason (which shouldn't happen as I have one zero at +infiniti and my single pole is real). I also just tried adding the step size: rlocus(sys, stepsize); which resulted in the same effect as your suggestion. Any other thoughts? Thanks for your help! -Dustin B On Tue, Nov 10, 2009 at 10:01 AM, wrote: Date: Tue, 10 Nov 2009 09:11:10 -0700 Subject: rlocus Step Size Change From: dustin.brothers at computer.org To: help at octave.org Octave Gurus, I am trying to change the step size and range of the "gain" of my system while using rlocus and cannot seem to get it to function properly. I have the following packages installed (control and signal), and am using qtoctave as a GUI front-end. According to your documentation, I should be able to change the step size following the syntax: rlocus(sys, [step,min,max]); Yet, I am getting errors. Is this possible another way, utilizing a k-vector and multiplying into the system transfer function prior to using rlocus? Or am I using this wrong (very likely :])? Any help you can give me would be great! Thanks. Dustin Brothers MSCD Engineering try rlocus(sys, step,min,max); no [] brackets Doug Please send me your sys or your code. Doug Date: Wed, 11 Nov 2009 07:45:53 -0700 Subject: Re: rlocus Step Size Change From: dustin.brothers at computer.org To: dastew at sympatico.ca Doug, I've attached my code. Thanks for all your help! -Dustin B I looked at your code and found that if you change r=rlocus(gs,.1,.1,50); to r=rlocus(gs,.1,.1,16); It works. I will look into why there is this restriction on the size later but for now you should be OK. Doug -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091111/971a1a29/attachment.html From arnoques at gmail.com Wed Nov 11 10:30:40 2009 From: arnoques at gmail.com (Pablo) Date: Wed, 11 Nov 2009 11:30:40 -0500 Subject: Sharing editable plots with non-octave users Message-ID: <4AFAE6B0.1030509@gmail.com> Hi, everyone! I know this question is a bit hard, so I don't expect a solution that fixes everything. I just want to know what your recommendations/experiences are. I've recently switched to Octave for my data analysis and plotting needs, but I often need to show plots to my advisor. She uses primarily Origin, and is somewhat familiar with Matlab. I've been printing plots to png to send them to her, but obviously that means she can't zoom, edit them, or try to fit the data by herself. Is there any better way to do things? It's important that it should be as little cumbersome for her as possible. All I could think of is to save the post-processed data in a file, make some script to plot them in Matlab and send her the data, script and a png plot. It's not an ideal solution, because I need to edit the script for each plot (to set the zoom, titles and whatnot) and I don't always have Matlab available to test it, but it's doable. Any other suggestions? Thanks in advance, Arnoques From joseph.wakeling at webdrake.net Wed Nov 11 10:46:59 2009 From: joseph.wakeling at webdrake.net (Joseph Wakeling) Date: Wed, 11 Nov 2009 17:46:59 +0100 Subject: Sharing editable plots with non-octave users In-Reply-To: <4AFAE6B0.1030509@gmail.com> References: <4AFAE6B0.1030509@gmail.com> Message-ID: <4AFAEA83.6020401@webdrake.net> Pablo wrote: > All I could think of is to save the post-processed data in a file, make > some script to plot them in Matlab and send her the data, script and a > png plot. It's not an ideal solution, because I need to edit the script > for each plot (to set the zoom, titles and whatnot) and I don't always > have Matlab available to test it, but it's doable. The typical process I noticed among biomed colleagues was to export the figure in EPS format (meaning zoom issues go away), then import it into CorelDraw or similar and edit there -- usually they would prettify title, axes, legends etc. and use it to create beautiful multi-panel figures. (You also get beautiful typos from this process...:-) Of course, you still lose the dynamic aspects of what you want to achieve -- the ability to do data analysis, fitting, etc. I don't really see a way round that beyond actually sharing the data and code, and taking care to make sure that your Octave code is MATLAB-compatible (not too difficult, but occasionally irritating to be sure). From lidia.bressan at unibo.it Wed Nov 11 11:12:17 2009 From: lidia.bressan at unibo.it (Lidia Bressan) Date: Wed, 11 Nov 2009 18:12:17 +0100 Subject: find command sometimes doesn't work in script Message-ID: <1257959537.23498.57.camel@labtinti1:localdomain> I am havig problems with find. I use ubuntu and I just upgraded to 9.10 Karmic Koala ubuntu. I use 'find' to look for a particular value in a matrix, inside a for loop. Values of matrix B column 5 go from 1.0 to 5.0 (or to 4.0) with 0.05 step. Some values might be repeated. I want to check where in matrix B, column 5 there are more times the same value. In that case, I want to select the row with the smallest positive value of column 6, and compose in this way matrix C. The problem is that for some values 'find' in script doesn't work and return an empty vector, while in terminal I get the right result. Is there an error in my for loop or what could be the problem? Matrix B is composed reading some files and then rearranging it. Here after I write the code I use. Do you have any suggestions, please? In script: C=[]; if( (max(BB(:,5))-min(BB(:,5)))/0.05 +1!=size(BB,1)) for jj=1.0000:0.0500:max(BB(:,5)) clear doubleval; doubleval=find(BB(:,5)==jj); if(size(doubleval,1)>1) clear rbay rbax mval=min(max(BB(doubleval,6),0)); mvalx=find(BB(doubleval,6)==mval); C=[C; BB(doubleval(mvalx),:)]; elseif(size(doubleval,1)==1) C=[C; BB(doubleval,:)]; elseif(size(doubleval,1)==0) disp(jj) endif endfor else C=BB; endif 1.6500 1.9000 2.0500 2.3000 2.5500 2.8000 3.0500 3.3000 3.4000 3.5500 3.6500 3.8000 3.9000 4.1000 4.3500 4.6000 4.8500 In terminal: octave:102> jj=2.05; octave:103> doubleval=find(BB(:,5)==jj) doubleval = 58 Lidia Bressan From Potorti at isti.cnr.it Wed Nov 11 11:16:41 2009 From: Potorti at isti.cnr.it (Francesco =?utf-8?Q?Potort=C3=AC?=) Date: Wed, 11 Nov 2009 18:16:41 +0100 Subject: Sharing editable plots with non-octave users In-Reply-To: <4AFAE6B0.1030509@gmail.com> References: <4AFAE6B0.1030509@gmail.com> Message-ID: >Origin, and is somewhat familiar with Matlab. I've been printing plots >to png to send them to her, but obviously that means she can't zoom, >edit them, or try to fit the data by herself. Is there any better way to >do things? It's important that it should be as little cumbersome for her >as possible. As for zooming, a vector format like ps or pdf is enough. As for fitting or editing, you'll have to provide the numbers. Just print them in columnar format: any package able to draw graphs and fit data is able to read column text format. -- Francesco Potort? (ricercatore) Voice: +39 050 315 3058 (op.2111) ISTI - Area della ricerca CNR Fax: +39 050 315 2040 via G. Moruzzi 1, I-56124 Pisa Email: Potorti at isti.cnr.it (entrance 20, 1st floor, room C71) Web: http://fly.isti.cnr.it/ From highegg at gmail.com Wed Nov 11 14:39:13 2009 From: highegg at gmail.com (Jaroslav Hajek) Date: Wed, 11 Nov 2009 21:39:13 +0100 Subject: find command sometimes doesn't work in script In-Reply-To: <-1596727648911815413@unknownmsgid> References: <-1596727648911815413@unknownmsgid> Message-ID: <69d8d540911111239x66ccf95di2d3f109b3eb99f65@mail.gmail.com> On Wed, Nov 11, 2009 at 6:12 PM, Lidia Bressan wrote: > I am havig problems with find. > > I use ubuntu and I just upgraded to 9.10 Karmic Koala ubuntu. > > I use 'find' to look for a particular value in a matrix, inside a for > loop. > Values of matrix B column 5 go from 1.0 to 5.0 (or to 4.0) with 0.05 > step. Some values might be repeated. > I want to check where in matrix B, column 5 there are more times the > same value. In that case, I want to select the row with the smallest > positive value of column 6, and compose in this way matrix C. > > The problem is that for some values 'find' in script doesn't work and > return an empty vector, while in terminal I get the right result. > Is there an error in my for loop or what could be the problem? Matrix B > is composed reading some files and then rearranging it. > > Here after I write the code I use. > > Do you have any suggestions, please? > > > > In script: > > C=[]; > if( (max(BB(:,5))-min(BB(:,5)))/0.05 +1!=size(BB,1)) > > for jj=1.0000:0.0500:max(BB(:,5)) > clear doubleval; doubleval=find(BB(:,5)==jj); > if(size(doubleval,1)>1) > clear rbay rbax > mval=min(max(BB(doubleval,6),0)); > mvalx=find(BB(doubleval,6)==mval); > C=[C; BB(doubleval(mvalx),:)]; > elseif(size(doubleval,1)==1) > C=[C; BB(doubleval,:)]; > elseif(size(doubleval,1)==0) > disp(jj) > endif > endfor > else > C=BB; > endif > > > 1.6500 > 1.9000 > 2.0500 > 2.3000 > 2.5500 > 2.8000 > 3.0500 > 3.3000 > 3.4000 > 3.5500 > 3.6500 > 3.8000 > 3.9000 > 4.1000 > 4.3500 > 4.6000 > 4.8500 > > > In terminal: > > octave:102> jj=2.05; > octave:103> doubleval=find(BB(:,5)==jj) > doubleval = 58 > > Lidia Bressan > this looks like precision issue. What does any ((1:0.05:5) == 2.05) give you? You should be aware that numbers like 2.05 cannot be represented exactly by computer floating point types. In any case it would help if you submitted a more complete report, including your Octave version & configuration, and if possible also the matrix BB that shows the problem. hth -- RNDr. Jaroslav Hajek computing expert & GNU Octave developer Aeronautical Research and Test Institute (VZLU) Prague, Czech Republic url: www.highegg.matfyz.cz -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091111/3a61200b/attachment.html From joseph.wakeling at webdrake.net Wed Nov 11 18:42:34 2009 From: joseph.wakeling at webdrake.net (Joseph Wakeling) Date: Thu, 12 Nov 2009 01:42:34 +0100 Subject: Plotting issues: arrows and label font size Message-ID: <4AFB59FA.2080203@webdrake.net> Hello all, A couple of quick plotting queries that I haven't been able to find an effective answer to browsing docs or list archives. I'm running Octave 3.0 on Ubuntu. First: is it possible to add arrowheads to plotted lines? I'm thinking of an arrow that rises from the X axis to meet a plotted curve, or goes across from the Y axis. This kind of thing: | . |--------> . | . | | . | | . | |. v ------------------ It's not so difficult to post-produce in Inkscape but would be nicer to just do it in Octave. :-) Second: axis label sizes. I think I'm doing the right thing by setting xlabel('X','fontsize',16) ... but although getting the properties of the label with get() reveals the fontsize value has been set correctly, when I use the print command to output an EPS file the font size is not changed. Is it me or Octave who is doing things wrong? :-P Thanks & best wishes, -- Joe From hassen62 at voila.fr Wed Nov 11 18:47:34 2009 From: hassen62 at voila.fr (hassen62 at voila.fr) Date: Thu, 12 Nov 2009 01:47:34 +0100 (CET) Subject: Wiener-Kolmogorov filter Message-ID: <13410179.11404961257986854891.JavaMail.www@wwinf4633> Hi friends, I would like to ask you if there is an Octave program for wiener-Kolmogorov filter for signal extraction. Thank you ____________________________________________________ Gagnez un s?jour au Maroc?en d?couvrant les sketchs d?sopilants des ReVoila sur http://www.lesrevoila.fr/ From dastew at sympatico.ca Wed Nov 11 19:10:23 2009 From: dastew at sympatico.ca (dastew at sympatico.ca) Date: Thu, 12 Nov 2009 01:10:23 +0000 Subject: Plotting issues: arrows and label font size In-Reply-To: <4AFB59FA.2080203@webdrake.net> References: <4AFB59FA.2080203@webdrake.net> Message-ID: > Date: Thu, 12 Nov 2009 01:42:34 +0100 > From: joseph.wakeling at webdrake.net > To: help-octave at octave.org > Subject: Plotting issues: arrows and label font size > > Hello all, > > A couple of quick plotting queries that I haven't been able to find an > effective answer to browsing docs or list archives. I'm running Octave > 3.0 on Ubuntu. > > First: is it possible to add arrowheads to plotted lines? I'm thinking > of an arrow that rises from the X axis to meet a plotted curve, or goes > across from the Y axis. This kind of thing: > > | . > |--------> . > | . | > | . | > | . | > |. v > ------------------ > > It's not so difficult to post-produce in Inkscape but would be nicer to > just do it in Octave. :-) > > Second: axis label sizes. I think I'm doing the right thing by setting > > xlabel('X','fontsize',16) > > ... but although getting the properties of the label with get() reveals > the fontsize value has been set correctly, when I use the print command > to output an EPS file the font size is not changed. Is it me or Octave > who is doing things wrong? :-P > > Thanks & best wishes, > > -- Joe > _______________________________________________ > Help-octave mailing list > Help-octave at octave.org > https://www-old.cae.wisc.edu/mailman/listinfo/help-octave Try the stem command for part of your answer. Doug -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091112/9882db42/attachment.html From joseph.wakeling at webdrake.net Wed Nov 11 20:16:22 2009 From: joseph.wakeling at webdrake.net (Joseph Wakeling) Date: Thu, 12 Nov 2009 03:16:22 +0100 Subject: Plotting issues: arrows and label font size In-Reply-To: References: <4AFB59FA.2080203@webdrake.net> Message-ID: <4AFB6FF6.9070606@webdrake.net> dastew at sympatico.ca wrote: > Try the stem command for part of your answer. Thanks for the suggestion (an interesting function I didn't know), but I'm not sure I see how it actually contributes a solution. First, as far as I can see 'stem' just gives you vertical lines -- not the horizontal arrows I also need -- and despite trying I've found it impossible to replace the default o marker. Again, is this an Octave 3.0 thing? I've noticed that various new functions seem to be only partially implemented in practice ... From mb78aa at yahoo.com Wed Nov 11 23:45:32 2009 From: mb78aa at yahoo.com (Mike B.) Date: Wed, 11 Nov 2009 21:45:32 -0800 (PST) Subject: Installation fails on Debian Squeeze Message-ID: <930886.30484.qm@web110006.mail.gq1.yahoo.com> Dear All, As the title implies, I can't install Octave 3.2 on Debian Squeeze. Here's the output of apt-get install octave3.2: 0 upgraded, 0 newly installed, 0 to remove and 133 not upgraded. 2 not fully installed or removed. After this operation, 0B of additional disk space will be used. Setting up octave3.2 (3.2.3-1) ... error: fclose: invalid stream number = -1 error: called from: error:?? /usr/share/octave/3.2.3/m/pkg/pkg.m at line 363, column 1 error:?? /usr/share/octave/3.2.3/m/startup/octaverc at line 25, column 1 dpkg: error processing octave3.2 (--configure): ?subprocess installed post-installation script returned error exit status 1 dpkg: dependency problems prevent configuration of shogun-octave: ?shogun-octave depends on octave3.2 (>= 3.2.3); however: ? Package octave3.2 is not configured yet. dpkg: error processing shogun-octave (--configure): ?dependency problems - leaving unconfigured Processing triggers for menu ... Errors were encountered while processing: ?octave3.2 ?shogun-octave E? :? Sub-process /usr/bin/dpkg returned an error code (1) Any ideas?. Cheers and thanks, Mike. New Email addresses available on Yahoo! Get the Email name you've always wanted on the new @ymail and @rocketmail. Hurry before someone else does! http://mail.promotions.yahoo.com/newdomains/aa/ -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091111/b2b39e09/attachment.html From lukshuntim at gmail.com Thu Nov 12 00:35:59 2009 From: lukshuntim at gmail.com (LUK ShunTim) Date: Thu, 12 Nov 2009 14:35:59 +0800 Subject: Installation fails on Debian Squeeze In-Reply-To: <930886.30484.qm@web110006.mail.gq1.yahoo.com> References: <930886.30484.qm@web110006.mail.gq1.yahoo.com> Message-ID: <4AFBACCF.3060003@gmail.com> Mike B. wrote: > Dear All, > > As the title implies, I can't install Octave 3.2 on Debian Squeeze. > Here's the output of apt-get install octave3.2: > > 0 upgraded, 0 newly installed, 0 to remove and 133 not upgraded. > 2 not fully installed or removed. > After this operation, 0B of additional disk space will be used. > Setting up octave3.2 (3.2.3-1) ... > error: fclose: invalid stream number = -1 > error: called from: > error: /usr/share/octave/3.2.3/m/pkg/pkg.m at line 363, column 1 > error: /usr/share/octave/3.2.3/m/startup/octaverc at line 25, column 1 > > dpkg: error processing octave3.2 (--configure): > subprocess installed post-installation script returned error exit status 1 > dpkg: dependency problems prevent configuration of shogun-octave: > shogun-octave depends on octave3.2 (>= 3.2.3); however: > Package octave3.2 is not configured yet. > dpkg: error processing shogun-octave (--configure): > dependency problems - leaving unconfigured > Processing triggers for menu ... > Errors were encountered while processing: > octave3.2 > shogun-octave > E : Sub-process /usr/bin/dpkg returned an error code (1) > > > Any ideas?. > > Cheers and thanks, > Mike. Are you installing both shogun-octave and octave3.2 at the same time? Can you try uninstall *both* of them and then install only octave3.2 first before shogun-octave? Regards, ST -- From mb78aa at yahoo.com Thu Nov 12 01:33:37 2009 From: mb78aa at yahoo.com (Mike B.) Date: Wed, 11 Nov 2009 23:33:37 -0800 (PST) Subject: Installation fails on Debian Squeeze In-Reply-To: <4AFBACCF.3060003@gmail.com> Message-ID: <474923.55584.qm@web56901.mail.re3.yahoo.com> Thanks for your reply. I've tried that, that is, uninstalling and then installing only octave 3.2. No go. --- On Thu, 11/12/09, LUK ShunTim wrote: From: LUK ShunTim Subject: Re: Installation fails on Debian Squeeze To: "Mike B." Cc: help-octave at octave.org Date: Thursday, November 12, 2009, 5:35 PM Mike B. wrote: >? Dear All, > > As the title implies, I can't install Octave 3.2 on Debian Squeeze. > Here's the output of apt-get install octave3.2: > > 0 upgraded, 0 newly installed, 0 to remove and 133 not upgraded. > 2 not fully installed or removed. > After this operation, 0B of additional disk space will be used. > Setting up octave3.2 (3.2.3-1) ... > error: fclose: invalid stream number = -1 > error: called from: > error:???/usr/share/octave/3.2.3/m/pkg/pkg.m at line 363, column 1 > error:???/usr/share/octave/3.2.3/m/startup/octaverc at line 25, column 1 > > dpkg: error processing octave3.2 (--configure): >? subprocess installed post-installation script returned error exit status 1 > dpkg: dependency problems prevent configuration of shogun-octave: >? shogun-octave depends on octave3.2 (>= 3.2.3); however: >???Package octave3.2 is not configured yet. > dpkg: error processing shogun-octave (--configure): >? dependency problems - leaving unconfigured > Processing triggers for menu ... > Errors were encountered while processing: >? octave3.2 >? shogun-octave > E? :? Sub-process /usr/bin/dpkg returned an error code (1) > > > Any ideas?. > > Cheers and thanks, > Mike. Are you installing both shogun-octave and octave3.2 at the same time? Can you try uninstall *both* of them and then install only octave3.2 first before shogun-octave? Regards, ST -- -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091111/e3741514/attachment-0001.html From ihsanmrasheed at yahoo.com Thu Nov 12 01:28:13 2009 From: ihsanmrasheed at yahoo.com (Ihsan Rasheed) Date: Wed, 11 Nov 2009 23:28:13 -0800 (PST) Subject: Doc Message-ID: <962943.61914.qm@web50810.mail.re2.yahoo.com> Dear sir, ? After?setup Octave3.2.3,?all shortcuts of documantation Octave3.2.3 for win xp are not work. ? ? Regards ? -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091111/d2f7919a/attachment.html From fl at ifi.uio.no Thu Nov 12 04:03:56 2009 From: fl at ifi.uio.no (Fredrik Lingvall) Date: Thu, 12 Nov 2009 11:03:56 +0100 Subject: Wiener-Kolmogorov filter In-Reply-To: <13410179.11404961257986854891.JavaMail.www@wwinf4633> References: <13410179.11404961257986854891.JavaMail.www@wwinf4633> Message-ID: <4AFBDD8C.2050708@ifi.uio.no> hassen62 at voila.fr wrote: > Hi friends, > I would like to ask you if there is an Octave program for wiener-Kolmogorov filter for signal extraction. > Thank you > > % Model: % % y = conv(h,u) + e % % where it is assued that you know the impulse response h, the noise variance (sigma_e^2) % and input signal variance (sigma_u^2). sigma_e = 1.0; sigma_u = 1.0; mu = (sigma_e/sigma_u)^2; % Length of the estimated input signal. u_len = 1000; 1) Frequency-domain deconvolution (Wiener filtering): h_c = fft(h,length(h)+length(y)-1); % Zero-pad to avoid aliasing. yc = fft(y,length(h)+length(y)-1); % Zero-pad to avoid aliasing. u_hat = real(ifft( (conj(h_c) .* yc) ./ (h_c.*conj(h_c) + mu)) ); u_hat = u_hat(1:u_len); 2) Time-domain version (u_hat = inv(H'*H + mu*I)*H'*y): % The matched filter part (U'*y): % Alt. 1: %h_t = [h_hat(:)' zeros(1,u_len-1)]; %H = toeplitz(h_t,[h_t(1) zeros(1,u_len-1)]); %Hty = H'*y; % Alt. 2: %u_t = [h(:)' zeros(1,u_len-1)]; %U = toeplitz(h_t,[h_t(1) zeros(1,u_len-1)]); %Hty = (y'*H)'; % More mem efficient. % Alt. 3: hty = fftconv(h_hat(end:-1:1),y); % Even faster fft-based method. Hty = hty(length(h_hat):length(h_hat)+u_len-1); % Pick the relevant part. % The H'*H + mu*I part: I = eye(u_len,u_len); HtH = H'*H + mu*I; % The Wiener (Linear MMSE) solution: u_hat = cholinv(HtH) * Hty; /Fredrik From lidia.bressan at unibo.it Thu Nov 12 04:10:51 2009 From: lidia.bressan at unibo.it (Lidia Bressan) Date: Thu, 12 Nov 2009 11:10:51 +0100 Subject: find command sometimes doesn't work in script In-Reply-To: <69d8d540911111239x66ccf95di2d3f109b3eb99f65@mail.gmail.com> References: <-1596727648911815413@unknownmsgid> <69d8d540911111239x66ccf95di2d3f109b3eb99f65@mail.gmail.com> Message-ID: <1258020651.29058.15.camel@labtinti1:localdomain> Sure, here I write all the information I was missing in the last email. I use GNU Octave, version 3.2.2. I'm not sure what you mean with octave configuration. Any result: octave:105> any ((1:0.05:5) == 2.05) ans = 0 and also octave:116> a=(1:0.05:5).*100 octave:117> any (a == 205) ans = 0 Is there a way to go around a precision issue? matrix BB: 1.0000 6.0000 60.0000 10.0000 1.0000 1219.0833 1.0000 6.0000 60.0000 10.0000 1.0000 2109.0833 1.0000 6.0000 60.0000 10.0000 1.0000 5099.0833 1.0000 6.0000 60.0000 10.0000 1.0500 1219.0833 1.0000 6.0000 60.0000 10.0000 1.0500 2109.0833 1.0000 6.0000 60.0000 10.0000 1.0500 5099.0833 1.0000 6.0000 60.0000 10.0000 1.1000 1219.0833 1.0000 6.0000 60.0000 10.0000 1.1000 2109.0833 1.0000 6.0000 60.0000 10.0000 1.1000 5099.0833 1.0000 6.0000 60.0000 10.0000 1.1500 1219.0833 1.0000 6.0000 60.0000 10.0000 1.1500 2109.0833 1.0000 6.0000 60.0000 10.0000 1.1500 5099.0833 1.0000 6.0000 60.0000 10.0000 1.2000 1219.0833 1.0000 6.0000 60.0000 10.0000 1.2000 2109.0833 1.0000 6.0000 60.0000 10.0000 1.2000 5099.0833 1.0000 6.0000 60.0000 10.0000 1.2500 1219.0833 1.0000 6.0000 60.0000 10.0000 1.2500 2109.0833 1.0000 6.0000 60.0000 10.0000 1.2500 5099.0833 1.0000 6.0000 60.0000 10.0000 1.3000 1219.0833 1.0000 6.0000 60.0000 10.0000 1.3000 2109.0833 1.0000 6.0000 60.0000 10.0000 1.3000 5099.0833 1.0000 6.0000 60.0000 10.0000 1.3500 1219.0833 1.0000 6.0000 60.0000 10.0000 1.3500 2109.0833 1.0000 6.0000 60.0000 10.0000 1.3500 5099.0833 1.0000 6.0000 60.0000 10.0000 1.4000 1219.0833 1.0000 6.0000 60.0000 10.0000 1.4000 2109.0833 1.0000 6.0000 60.0000 10.0000 1.4000 5099.0833 1.0000 6.0000 60.0000 10.0000 1.4500 16.0833 1.0000 6.0000 60.0000 10.0000 1.4500 209.0833 1.0000 6.0000 60.0000 10.0000 1.4500 555.0833 1.0000 6.0000 60.0000 10.0000 1.5000 16.0833 1.0000 6.0000 60.0000 10.0000 1.5000 209.0833 1.0000 6.0000 60.0000 10.0000 1.5000 555.0833 1.0000 6.0000 60.0000 10.0000 1.5500 16.0833 1.0000 6.0000 60.0000 10.0000 1.5500 209.0833 1.0000 6.0000 60.0000 10.0000 1.5500 555.0833 1.0000 6.0000 60.0000 10.0000 1.6000 209.0833 1.0000 6.0000 60.0000 10.0000 1.6000 1219.0833 1.0000 6.0000 60.0000 10.0000 1.6000 2109.0833 1.0000 6.0000 60.0000 10.0000 1.6500 209.0833 1.0000 6.0000 60.0000 10.0000 1.6500 2109.0833 1.0000 6.0000 60.0000 10.0000 1.6500 2109.0833 1.0000 6.0000 60.0000 10.0000 1.7000 209.0833 1.0000 6.0000 60.0000 10.0000 1.7000 2109.0833 1.0000 6.0000 60.0000 10.0000 1.7000 2109.0833 1.0000 6.0000 60.0000 10.0000 1.7500 209.0833 1.0000 6.0000 60.0000 10.0000 1.7500 2109.0833 1.0000 6.0000 60.0000 10.0000 1.7500 2109.0833 1.0000 6.0000 60.0000 10.0000 1.8000 209.0833 1.0000 6.0000 60.0000 10.0000 1.8000 2109.0833 1.0000 6.0000 60.0000 10.0000 1.8000 2109.0833 1.0000 6.0000 60.0000 10.0000 1.8500 209.0833 1.0000 6.0000 60.0000 10.0000 1.8500 2109.0833 1.0000 6.0000 60.0000 10.0000 1.8500 2109.0833 1.0000 6.0000 60.0000 10.0000 1.9000 -5000.0000 1.0000 6.0000 60.0000 10.0000 1.9500 -5000.0000 1.0000 6.0000 60.0000 10.0000 2.0000 -5000.0000 1.0000 6.0000 60.0000 10.0000 2.0500 -5000.0000 1.0000 6.0000 60.0000 10.0000 2.1000 -5000.0000 1.0000 6.0000 60.0000 10.0000 2.1500 -5000.0000 1.0000 6.0000 60.0000 10.0000 2.2000 -5000.0000 1.0000 6.0000 60.0000 10.0000 2.2500 -5000.0000 1.0000 6.0000 60.0000 10.0000 2.3000 -5000.0000 1.0000 6.0000 60.0000 10.0000 2.3500 -5000.0000 1.0000 6.0000 60.0000 10.0000 2.4000 -5000.0000 1.0000 6.0000 60.0000 10.0000 2.4500 -5000.0000 1.0000 6.0000 60.0000 10.0000 2.5000 -5000.0000 1.0000 6.0000 60.0000 10.0000 2.5500 -5000.0000 1.0000 6.0000 60.0000 10.0000 2.6000 -5000.0000 1.0000 6.0000 60.0000 10.0000 2.6500 -5000.0000 1.0000 6.0000 60.0000 10.0000 2.7000 -5000.0000 1.0000 6.0000 60.0000 10.0000 2.7500 -5000.0000 1.0000 6.0000 60.0000 10.0000 2.8000 -5000.0000 1.0000 6.0000 60.0000 10.0000 2.8500 -5000.0000 1.0000 6.0000 60.0000 10.0000 2.9000 -5000.0000 1.0000 6.0000 60.0000 10.0000 2.9500 -5000.0000 1.0000 6.0000 60.0000 10.0000 3.0000 -5000.0000 1.0000 6.0000 60.0000 10.0000 3.0500 -5000.0000 1.0000 6.0000 60.0000 10.0000 3.1000 -5000.0000 1.0000 6.0000 60.0000 10.0000 3.1500 -5000.0000 1.0000 6.0000 60.0000 10.0000 3.2000 -5000.0000 1.0000 6.0000 60.0000 10.0000 3.2500 -5000.0000 1.0000 6.0000 60.0000 10.0000 3.3000 -5000.0000 1.0000 6.0000 60.0000 10.0000 3.3500 -5000.0000 1.0000 6.0000 60.0000 10.0000 3.4000 -5000.0000 1.0000 6.0000 60.0000 10.0000 3.4500 -5000.0000 1.0000 6.0000 60.0000 10.0000 3.5000 -5000.0000 1.0000 6.0000 60.0000 10.0000 3.5500 -5000.0000 1.0000 6.0000 60.0000 10.0000 3.6000 -5000.0000 1.0000 6.0000 60.0000 10.0000 3.6500 -5000.0000 1.0000 6.0000 60.0000 10.0000 3.7000 -5000.0000 1.0000 6.0000 60.0000 10.0000 3.7500 -5000.0000 1.0000 6.0000 60.0000 10.0000 3.8000 -5000.0000 1.0000 6.0000 60.0000 10.0000 3.8500 -5000.0000 1.0000 6.0000 60.0000 10.0000 3.9000 -5000.0000 1.0000 6.0000 60.0000 10.0000 3.9500 -5000.0000 1.0000 6.0000 60.0000 10.0000 4.0000 -5000.0000 1.0000 6.0000 60.0000 10.0000 4.0500 -5000.0000 1.0000 6.0000 60.0000 10.0000 4.1000 -5000.0000 1.0000 6.0000 60.0000 10.0000 4.1500 -5000.0000 1.0000 6.0000 60.0000 10.0000 4.2000 -5000.0000 1.0000 6.0000 60.0000 10.0000 4.2500 -5000.0000 1.0000 6.0000 60.0000 10.0000 4.3000 -5000.0000 1.0000 6.0000 60.0000 10.0000 4.3500 -5000.0000 1.0000 6.0000 60.0000 10.0000 4.4000 -5000.0000 1.0000 6.0000 60.0000 10.0000 4.4500 -5000.0000 1.0000 6.0000 60.0000 10.0000 4.5000 -5000.0000 1.0000 6.0000 60.0000 10.0000 4.5500 -5000.0000 1.0000 6.0000 60.0000 10.0000 4.6000 -5000.0000 1.0000 6.0000 60.0000 10.0000 4.6500 -5000.0000 1.0000 6.0000 60.0000 10.0000 4.7000 -5000.0000 1.0000 6.0000 60.0000 10.0000 4.7500 -5000.0000 1.0000 6.0000 60.0000 10.0000 4.8000 -5000.0000 1.0000 6.0000 60.0000 10.0000 4.8500 -5000.0000 1.0000 6.0000 60.0000 10.0000 4.9000 -5000.0000 1.0000 6.0000 60.0000 10.0000 4.9500 -5000.0000 1.0000 6.0000 60.0000 10.0000 5.0000 -5000.0000 Thanks Lidia Il giorno mer, 11/11/2009 alle 21.39 +0100, Jaroslav Hajek ha scritto: > > > On Wed, Nov 11, 2009 at 6:12 PM, Lidia Bressan > wrote: > I am havig problems with find. > > I use ubuntu and I just upgraded to 9.10 Karmic Koala ubuntu. > > I use 'find' to look for a particular value in a matrix, > inside a for > loop. > Values of matrix B column 5 go from 1.0 to 5.0 (or to 4.0) > with 0.05 > step. Some values might be repeated. > I want to check where in matrix B, column 5 there are more > times the > same value. In that case, I want to select the row with the > smallest > positive value of column 6, and compose in this way matrix C. > > The problem is that for some values 'find' in script doesn't > work and > return an empty vector, while in terminal I get the right > result. > Is there an error in my for loop or what could be the problem? > Matrix B > is composed reading some files and then rearranging it. > > Here after I write the code I use. > > Do you have any suggestions, please? > > > > In script: > > C=[]; > if( (max(BB(:,5))-min(BB(:,5)))/0.05 +1!=size(BB,1)) > > for jj=1.0000:0.0500:max(BB(:,5)) > clear doubleval; doubleval=find(BB(:,5)==jj); > if(size(doubleval,1)>1) > clear rbay rbax > mval=min(max(BB(doubleval,6),0)); > mvalx=find(BB(doubleval,6)==mval); > C=[C; BB(doubleval(mvalx),:)]; > elseif(size(doubleval,1)==1) > C=[C; BB(doubleval,:)]; > elseif(size(doubleval,1)==0) > disp(jj) > endif > endfor > else > C=BB; > endif > > > 1.6500 > 1.9000 > 2.0500 > 2.3000 > 2.5500 > 2.8000 > 3.0500 > 3.3000 > 3.4000 > 3.5500 > 3.6500 > 3.8000 > 3.9000 > 4.1000 > 4.3500 > 4.6000 > 4.8500 > > > In terminal: > > octave:102> jj=2.05; > octave:103> doubleval=find(BB(:,5)==jj) > doubleval = 58 > > Lidia Bressan > > this looks like precision issue. What does > > any ((1:0.05:5) == 2.05) > > give you? You should be aware that numbers like 2.05 cannot be > represented exactly by computer floating point types. > > In any case it would help if you submitted a more complete report, > including your Octave version & configuration, and if possible also > the matrix BB that shows the problem. > > hth > > -- > RNDr. Jaroslav Hajek > computing expert & GNU Octave developer > Aeronautical Research and Test Institute (VZLU) > Prague, Czech Republic > url: www.highegg.matfyz.cz From highegg at gmail.com Thu Nov 12 04:29:03 2009 From: highegg at gmail.com (Jaroslav Hajek) Date: Thu, 12 Nov 2009 11:29:03 +0100 Subject: find command sometimes doesn't work in script In-Reply-To: <-2257071128307711256@unknownmsgid> References: <-1596727648911815413@unknownmsgid> <69d8d540911111239x66ccf95di2d3f109b3eb99f65@mail.gmail.com> <-2257071128307711256@unknownmsgid> Message-ID: <69d8d540911120229j77e5f40ayf56014d7e3aa24ea@mail.gmail.com> On Thu, Nov 12, 2009 at 11:10 AM, Lidia Bressan wrote: > Sure, here I write all the information I was missing in the last email. > > I use GNU Octave, version 3.2.2. I'm not sure what you mean with octave > configuration. > > Any result: > > octave:105> any ((1:0.05:5) == 2.05) > ans = 0 > > There you go. As you can see, something is wrong. I suppose the simpler equality 1 + 21 * 0.05 == 2.05 does not hold for you either (am I right)? This is because numbers like 0.05 do not have an exact representation in the FP arithmetics. When you say 0.05, Octave actually picks the closest floating-point number, which is 3602879701896397 * 2^-56. Then, when it calculates 1 + 21 * 0.05 (and it does so even in the for loop), it uses this number, and the result is a tiny bit off. > Is there a way to go around a precision issue? > Use an integer range, or don't compare for strict equality but rather with a tolerance. There is also an extension package for Octave providing fixed point numbers: http://octave.sourceforge.net/fixed/index.html hth -- RNDr. Jaroslav Hajek computing expert & GNU Octave developer Aeronautical Research and Test Institute (VZLU) Prague, Czech Republic url: www.highegg.matfyz.cz -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091112/fcd9b77d/attachment.html From lidia.bressan at unibo.it Thu Nov 12 05:33:03 2009 From: lidia.bressan at unibo.it (Lidia Bressan) Date: Thu, 12 Nov 2009 12:33:03 +0100 Subject: find command sometimes doesn't work in script In-Reply-To: <69d8d540911120229j77e5f40ayf56014d7e3aa24ea@mail.gmail.com> References: <-1596727648911815413@unknownmsgid> <69d8d540911111239x66ccf95di2d3f109b3eb99f65@mail.gmail.com> <-2257071128307711256@unknownmsgid> <69d8d540911120229j77e5f40ayf56014d7e3aa24ea@mail.gmail.com> Message-ID: <1258025583.29058.18.camel@labtinti1:localdomain> Thanks a lot for the answer! Just for curiosity, the equality you said works: octave:119> 1 + 21 * 0.05 == 2.05 ans = 1 octave:120> 1 == 1 ans = 1 Lidia Il giorno gio, 12/11/2009 alle 11.29 +0100, Jaroslav Hajek ha scritto: > > > On Thu, Nov 12, 2009 at 11:10 AM, Lidia Bressan > wrote: > Sure, here I write all the information I was missing in the > last email. > > I use GNU Octave, version 3.2.2. I'm not sure what you mean > with octave > configuration. > > Any result: > > octave:105> any ((1:0.05:5) == 2.05) > ans = 0 > > > There you go. As you can see, something is wrong. I suppose the > simpler equality > 1 + 21 * 0.05 == 2.05 > does not hold for you either (am I right)? > This is because numbers like 0.05 do not have an exact representation > in the FP arithmetics. When you say 0.05, Octave actually picks the > closest floating-point number, which is 3602879701896397 * 2^-56. > Then, when it calculates 1 + 21 * 0.05 (and it does so even in the for > loop), it uses this number, and the result is a tiny bit off. > > > Is there a way to go around a precision issue? > > Use an integer range, or don't compare for strict equality but rather > with a tolerance. > There is also an extension package for Octave providing fixed point > numbers: > http://octave.sourceforge.net/fixed/index.html > > hth > > > -- > RNDr. Jaroslav Hajek > computing expert & GNU Octave developer > Aeronautical Research and Test Institute (VZLU) > Prague, Czech Republic > url: www.highegg.matfyz.cz From highegg at gmail.com Thu Nov 12 05:43:24 2009 From: highegg at gmail.com (Jaroslav Hajek) Date: Thu, 12 Nov 2009 12:43:24 +0100 Subject: find command sometimes doesn't work in script In-Reply-To: <1427976492404843802@unknownmsgid> References: <-1596727648911815413@unknownmsgid> <69d8d540911111239x66ccf95di2d3f109b3eb99f65@mail.gmail.com> <-2257071128307711256@unknownmsgid> <69d8d540911120229j77e5f40ayf56014d7e3aa24ea@mail.gmail.com> <1427976492404843802@unknownmsgid> Message-ID: <69d8d540911120343r33498802l8fc50c3b24a3f250@mail.gmail.com> On Thu, Nov 12, 2009 at 12:33 PM, Lidia Bressan wrote: > Thanks a lot for the answer! > > Just for curiosity, the equality you said works: > > octave:119> 1 + 21 * 0.05 == 2.05 > ans = 1 > octave:120> 1 == 1 > ans = 1 > > Oh yes. Sorry, that was a nonsense. Of course this works. But it wouldn't work in C++ (which is what Octave does internally). -- RNDr. Jaroslav Hajek computing expert & GNU Octave developer Aeronautical Research and Test Institute (VZLU) Prague, Czech Republic url: www.highegg.matfyz.cz -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091112/7a72f9cd/attachment-0001.html From rpf at gmx.li Thu Nov 12 06:33:36 2009 From: rpf at gmx.li (rpf at gmx.li) Date: Thu, 12 Nov 2009 13:33:36 +0100 Subject: Plotting issues: arrows and label font size In-Reply-To: <4AFB59FA.2080203@webdrake.net> References: <4AFB59FA.2080203@webdrake.net> Message-ID: > Second: axis label sizes. ?I think I'm doing the right thing by setting > > ?xlabel('X','fontsize',16) > > ... but although getting the properties of the label with get() reveals > the fontsize value has been set correctly, when I use the print command > to output an EPS file the font size is not changed. ?Is it me or Octave > who is doing things wrong? :-P I use xlabel("X","fontsize", 16) print -deps -F:10 foo.eps and that works well. It prints the xlabel with font size 16 and the values on the axes in font size 10. (at least for octave 3.0, gnuplot 4.5 using wxt terminal) From rpf at gmx.li Thu Nov 12 06:52:55 2009 From: rpf at gmx.li (rpf at gmx.li) Date: Thu, 12 Nov 2009 13:52:55 +0100 Subject: eps size in print Message-ID: Hello all, I print my plots to eps files to include them in PDFLatex documents after using epstopdf. The print command help states that the size option, e.g. -S700,700 is only available when using PNG and SVG. When I resize the eps afterwards with epsffit or using inscludegraphics[height=5cm]{...}, the text is distorted. How can I preset the size of the image I get, or is there a way to resize the eps without loosing the textsize? thanks! From joseph.wakeling at webdrake.net Thu Nov 12 07:29:25 2009 From: joseph.wakeling at webdrake.net (Joseph Wakeling) Date: Thu, 12 Nov 2009 14:29:25 +0100 Subject: Plotting issues: arrows and label font size In-Reply-To: References: <4AFB59FA.2080203@webdrake.net> Message-ID: <4AFC0DB5.5090205@webdrake.net> rpf at gmx.li wrote: > I use > > xlabel("X","fontsize", 16) > print -deps -F:10 foo.eps > > and that works well. It prints the xlabel with font size 16 and the > values on the axes in font size 10. (at least for octave 3.0, gnuplot > 4.5 using wxt terminal) I'm still getting the same size for xlabel and axis values no matter what, but your suggestion does at least allow me to enlarge them all. Thanks! :-) For the record I'm using Octave 3.0 on Ubuntu 9.10 with gnuplot 4.2.5. So perhaps it's a gnuplot issue? I would prefer not to have to install a more recent version from source, as I like to keep within the packages my distro offers as much as possible ... From l.butler at ed.ac.uk Thu Nov 12 08:43:43 2009 From: l.butler at ed.ac.uk (Leo Butler) Date: Thu, 12 Nov 2009 14:43:43 +0000 (GMT) Subject: eps size in print In-Reply-To: References: Message-ID: On Thu, 12 Nov 2009, rpf at gmx.li wrote: < Hello all, < < I print my plots to eps files to include them in PDFLatex documents < after using epstopdf. The print command help states that the size < option, e.g. -S700,700 is only available when using PNG and SVG. When < I resize the eps afterwards with epsffit or using < inscludegraphics[height=5cm]{...}, the text is distorted. How can I < preset the size of the image I get, or is there a way to resize the < eps without loosing the textsize? Bt I prefer to use \psfrag is LaTeX to properly typeset labels and so on. Alternatively, exporting the graphic using the epslatex device does something similar. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From basiliovescio at tiscali.it Thu Nov 12 09:02:06 2009 From: basiliovescio at tiscali.it (Basilio) Date: Thu, 12 Nov 2009 07:02:06 -0800 (PST) Subject: Sparse matrices operators in C++ using liboctave Message-ID: <26320210.post@talk.nabble.com> Hi all, I'm trying to use a Sparse-to-scalar comparison operator (==) between Sparse and uint8_t, and I would like to use one of the operators in the macros from Sparse-op-defs.h, like SPARSE_SMS_CMP_OP_DECLS(M, S, API) or SPARSE_SMS_CMP_OP(M, S, API). I tried to do SPARSE_SMS_CMP_OP_DECLS (Sparse, uint8_t, OCTAVE_API) in my code, and used mx_el_eq to make the desired comparison and get the resulting sparse bool matrix. When I try to compile, it gives me a linker error, like ca2d.cc:(.text+0x1364): undefined reference to `mx_el_eq(Sparse const&, unsigned char const&)' ca2d.cc:(.text+0x15d4): undefined reference to `mx_el_eq(Sparse const&, unsigned char const&)' collect2: ld returned 1 exit status I used boolean operators mx_el_and, mx_el_or without any problem. Can anyone help me in using == and other comparison operators with Sparse? Thanks! bas -- View this message in context: http://old.nabble.com/Sparse-matrices-operators-in-C%2B%2B-using-liboctave-tp26320210p26320210.html Sent from the Octave - General mailing list archive at Nabble.com. From ohm_n at hotmail.com Thu Nov 12 03:31:33 2009 From: ohm_n at hotmail.com (zmyx) Date: Thu, 12 Nov 2009 01:31:33 -0800 (PST) Subject: using symbol in matrix Message-ID: <26315276.post@talk.nabble.com> I'm trying to create a matrix of symbols but it doesn't work. Is this possible to do with Octave? If yes, how to do it? Here is how i tried and as you can see there are error messages. > y = sym("y") y = y octave-3.2.3.exe:3:D:\Octave\3.2.3_gcc4.4.0\bin > x = [y y] error: octave_base_value::resize (): wrong type argument `ex' error: octave_base_value::resize (): wrong type argument `' This error happens both in my Linux and Windows installation of Octave. Thanks for all the help in advance! -- View this message in context: http://old.nabble.com/using-symbol-in-matrix-tp26315276p26315276.html Sent from the Octave - General mailing list archive at Nabble.com. From webrouter at hotmail.com Wed Nov 11 14:15:31 2009 From: webrouter at hotmail.com (Andy Williams) Date: Wed, 11 Nov 2009 15:15:31 -0500 Subject: Request for Quote Message-ID: Hi, I need to perform some statistical analysis on an ongoing basis for a worldwide not for profit writing contest I'm launching soon. If anyone is able to provide these six short scripts described below to run on my linux web server, I would appreciate if they would respond immediately with a quote letting me know how much it would cost and how long it would take. I need four to six short scripts to process statistical data extracted from a MySQL database. I can have someone else extract this data from the MySQL database if need be. I will need to be able to invoke these scripts be from the linux command line using a task scheduler. Display of the data on a GUI will not be required. Code: find_maxima This code should take a frequency distribution as input and attempt to fit the frequency distribution to a Gaussian curve. It should extrapolate the peak of the curve to five decimal places and return this value as the result. The frequency distribution will be a two dimensional array of values for variables x and y, with x being a rating from 1 to ten and y being the number of times the rating has been given. Cod: get_std_dev Given the frequency distribution described above, I would like a script that outputs the standard deviation of the rating. It would likely be more efficient to calculate the standard deviation as part of find_maxima, and to simply retrieve the value here. In that case this function will only be a shell or wrapper function. Code: get_avg Given the frequency distribution described above, I would like a script that outputs the avg rating. It would likely be more efficient to calculate the average as part of find_maxima, and to simply retrieve the value here. In that case this function will only be a shell or wrapper function. Code: detect_outlier Given an integer "z" representing a rating as well as the frequency distribution described above, I would like a script that calls get_std_dev to calculate the standard deviation in the ratings and then detects whether "z" is within a standard deviation of the mean rating. The script should return 1 or 'true' if the value is greater than 1 standard deviation from the mean and 0 or 'false' otherwise. It would likely be more efficient to calculate the standard deviation as part of find_maxima, and to simply retrieve the value here. Code: detect_ratings_skew Given an array of ratings made by a particular judge and given the frequency distribution of the overall ratings (described above) this code will compare the count of the judge's ratings that are within the standard deviation of the norm to count of the judge's ratings that are the determined to be outliers. If more than 32% of the judges ratings are statistical outliers then the function will indicate a skew in the individual judges ratings by returning 1 or 'true'. The function will return 0 or 'false' otherwise. Pseudocode: If outliers/(outliers+ratings_within_norm) > 0.32 then Return true Else Return false Code: adjust_ratings Given the mean and standard deviation of the overall ratings and the frequency distribution of ratings given by a particular judge, this function should adjust the ratings of that judge so that they have the same mean and standard deviation of the overall ratings. The output will be a new two dimensional array containing each rating from one to ten and the adjusted value of that rating. Best regards, Andy -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091111/6f06c195/attachment-0001.html From jwe at octave.org Thu Nov 12 09:28:03 2009 From: jwe at octave.org (John W. Eaton) Date: Thu, 12 Nov 2009 10:28:03 -0500 Subject: Plotting issues: arrows and label font size In-Reply-To: <4AFC0DB5.5090205@webdrake.net> References: <4AFB59FA.2080203@webdrake.net> <4AFC0DB5.5090205@webdrake.net> Message-ID: <19196.10627.633695.760611@segfault.lan> On 12-Nov-2009, Joseph Wakeling wrote: | For the record I'm using Octave 3.0 on Ubuntu 9.10 with gnuplot 4.2.5. | So perhaps it's a gnuplot issue? I would prefer not to have to install | a more recent version from source, as I like to keep within the packages | my distro offers as much as possible ... As I recall, there were a lot of improvements in the graphics system going frmo 3.0 to 3.2, so that might be worth upgrading. Isn't there an Ubuntu package for 3.2.3? jwe From soren at hauberg.org Thu Nov 12 09:52:23 2009 From: soren at hauberg.org (=?ISO-8859-1?Q?S=F8ren?= Hauberg) Date: Thu, 12 Nov 2009 16:52:23 +0100 Subject: using symbol in matrix In-Reply-To: <26315276.post@talk.nabble.com> References: <26315276.post@talk.nabble.com> Message-ID: <1258041143.2851.124.camel@hauberg-laptop> tor, 12 11 2009 kl. 01:31 -0800, skrev zmyx: > I'm trying to create a matrix of symbols but it doesn't work. Is this > possible to do with Octave? If yes, how to do it? > > Here is how i tried and as you can see there are error messages. > > > y = sym("y") > y = > > y > octave-3.2.3.exe:3:D:\Octave\3.2.3_gcc4.4.0\bin > > x = [y y] > error: octave_base_value::resize (): wrong type argument `ex' > error: octave_base_value::resize (): wrong type argument `' Can't you just store then in a cell array, i.e. x = {y, y}; ? S?ren From joseph.wakeling at webdrake.net Thu Nov 12 10:00:06 2009 From: joseph.wakeling at webdrake.net (Joseph Wakeling) Date: Thu, 12 Nov 2009 17:00:06 +0100 Subject: Plotting issues: arrows and label font size In-Reply-To: <19196.10627.633695.760611@segfault.lan> References: <4AFB59FA.2080203@webdrake.net> <4AFC0DB5.5090205@webdrake.net> <19196.10627.633695.760611@segfault.lan> Message-ID: <4AFC3106.4030505@webdrake.net> John W. Eaton wrote: > On 12-Nov-2009, Joseph Wakeling wrote: > > | For the record I'm using Octave 3.0 on Ubuntu 9.10 with gnuplot 4.2.5. > | So perhaps it's a gnuplot issue? I would prefer not to have to install > | a more recent version from source, as I like to keep within the packages > | my distro offers as much as possible ... > > As I recall, there were a lot of improvements in the graphics system > going frmo 3.0 to 3.2, so that might be worth upgrading. Isn't there > an Ubuntu package for 3.2.3? There is (actually it's 3.2.2, they are not completely up to date...) but there is an unfortunate clash with octave-forge packages: these require octave3.0. 3.0 and 3.2 can be installed concurrently but I guess the octave-forge stuff will still be limited to 3.0: it's installed in the 3.0 package directory. As it happens, I realise I'm not actually using any octave-forge stuff so it's not such an issue FOR ME, but it is an issue. (I did have some stuff installed, but I've not actually been using it in practise. :-P ) However, I can happily confirm that the 'fontsize' option of xlabel now does work in 3.2 :-) Thanks and best wishes, -- Joe From ohm_n at hotmail.com Thu Nov 12 10:03:04 2009 From: ohm_n at hotmail.com (zmyx) Date: Thu, 12 Nov 2009 08:03:04 -0800 (PST) Subject: using symbol in matrix In-Reply-To: <1258041143.2851.124.camel@hauberg-laptop> References: <26315276.post@talk.nabble.com> <1258041143.2851.124.camel@hauberg-laptop> Message-ID: <26321294.post@talk.nabble.com> > Can't you just store then in a cell array, i.e. > > x = {y, y}; The reason I want to put symbols in matrix because there will be lots of matrix operation afterward. Can cell array be manipulated the same way as matrix? If yes then I will have a deep look into it. Sorry if this is a newbie question. I'm still very new to Octave. -- View this message in context: http://old.nabble.com/using-symbol-in-matrix-tp26315276p26321294.html Sent from the Octave - General mailing list archive at Nabble.com. From jwe at octave.org Thu Nov 12 10:55:22 2009 From: jwe at octave.org (John W. Eaton) Date: Thu, 12 Nov 2009 11:55:22 -0500 Subject: using symbol in matrix In-Reply-To: <26321294.post@talk.nabble.com> References: <26315276.post@talk.nabble.com> <1258041143.2851.124.camel@hauberg-laptop> <26321294.post@talk.nabble.com> Message-ID: <19196.15866.713358.376076@segfault.lan> On 12-Nov-2009, zmyx wrote: | > Can't you just store then in a cell array, i.e. | > | > x = {y, y}; | | The reason I want to put symbols in matrix because there will be lots of | matrix operation afterward. Can cell array be manipulated the same way as | matrix? If yes then I will have a deep look into it. | | Sorry if this is a newbie question. I'm still very new to Octave. Symbolic objects are part of an add-on package, not a fundamental feature of Octave itself. jwe From jordigh at gmail.com Thu Nov 12 11:48:15 2009 From: jordigh at gmail.com (=?UTF-8?Q?Jordi_Guti=C3=A9rrez_Hermoso?=) Date: Thu, 12 Nov 2009 11:48:15 -0600 Subject: Installation fails on Debian Squeeze In-Reply-To: <930886.30484.qm@web110006.mail.gq1.yahoo.com> References: <930886.30484.qm@web110006.mail.gq1.yahoo.com> Message-ID: <9543b3a40911120948w6be43de5nf08a24381d93902e@mail.gmail.com> 2009/11/11 Mike B. > As the title implies, I can't install Octave 3.2 on Debian Squeeze. This looks like a Debian packaging bug not about Octave itself. Can you please submit a bug report in the Debian BTS? I'll try to reproduce and diagnose it later today. - Jordi G. H. From efuentetaja at agnitio.es Thu Nov 12 12:28:19 2009 From: efuentetaja at agnitio.es (Eduardo Fuentetaja) Date: Thu, 12 Nov 2009 19:28:19 +0100 Subject: Using octave runtime in a commercial product Message-ID: <072b01ca63c5$e9a7dd00$bcf79700$@es> Dear Octave team, I haven't been able to find an answer to my question on the Octave wiki or forums. Let me give you some context: at my company (Agnitio, we are in the voice biometric business) we use Matlab extensively for our prototyping. Recently we have been experimenting with the possibility of packaging Matlab code and call it directly in our commercial products. This is accomplished by means of the "Matlab compiler" that is able to pack .m functions into native libraries, which are executed by a Matlab runtime (the MCR, that can be distributed freely to our customers). This experiment hasn't been very successful due to compatibility problems with some third party libraries that the Matlab runtime uses. Being a closed-source product, we don't have many options there. Octave looks like a good alternative to Matlab: able to compile it from the sources we'd have a greater deal of control over third-party dependencies. Well, it seems very promising to me. The issue with Octave is that it's distributed under GPL license and being such a complex and wordy license I'm not sure if this license allows us doing what I have in mind: write some code in Octave, compile Octave as a library that will execute the Octave code under demand, distribute this library in binary format as part of our software products and sell commercially these products. Well, is this possible with Octave or is it not? I'd like to have your confirmation without continuing any further. If anyone is interested we can contribute with any modifications we made to Octave code. Thank you so much for your answer. Kind regards, Ed Fuentetaja Agnitio - SW development team -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091112/cc6730e6/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3931 bytes Desc: not available Url : https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091112/cc6730e6/attachment.bin From dbateman at dbateman.org Thu Nov 12 12:47:35 2009 From: dbateman at dbateman.org (David Bateman) Date: Thu, 12 Nov 2009 19:47:35 +0100 Subject: Sparse matrices operators in C++ using liboctave In-Reply-To: <26320210.post@talk.nabble.com> References: <26320210.post@talk.nabble.com> Message-ID: <4AFC5847.1010106@dbateman.org> Basilio wrote: > Hi all, > I'm trying to use a Sparse-to-scalar comparison operator (==) between > Sparse and uint8_t, and I would like to use one of the operators in > the macros from Sparse-op-defs.h, > like SPARSE_SMS_CMP_OP_DECLS(M, S, API) or SPARSE_SMS_CMP_OP(M, S, API). > I tried to do > SPARSE_SMS_CMP_OP_DECLS (Sparse, uint8_t, OCTAVE_API) > in my code, and used mx_el_eq to make the desired comparison and get the > resulting sparse bool matrix. > Note that DECLS stands for "declaration". So that macro gives you the declaration for the header but not the code itself that must be compiled. Try adding SPARSE_SMS_CMP_OPS (Sparse, static_cast(0), , uint8_t, static_cast(0), ) to a file that is compiled once only > When I try to compile, it gives me a linker error, like > > ca2d.cc:(.text+0x1364): undefined reference to `mx_el_eq(Sparse char> const&, unsigned char const&)' > ca2d.cc:(.text+0x15d4): undefined reference to `mx_el_eq(Sparse char> const&, unsigned char const&)' > collect2: ld returned 1 exit status > > I used boolean operators mx_el_and, mx_el_or without any problem. > Can anyone help me in using == and other comparison operators with > Sparse? > > Thanks! > > bas > -- 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) From dbateman at dbateman.org Thu Nov 12 13:26:39 2009 From: dbateman at dbateman.org (David Bateman) Date: Thu, 12 Nov 2009 20:26:39 +0100 Subject: Using octave runtime in a commercial product In-Reply-To: <072b01ca63c5$e9a7dd00$bcf79700$@es> References: <072b01ca63c5$e9a7dd00$bcf79700$@es> Message-ID: <4AFC616F.1040009@dbateman.org> Eduardo Fuentetaja wrote: > Dear Octave team, > > > > I haven't been able to find an answer to my question on the Octave wiki or > forums. Let me give you some context: at my company (Agnitio, we are in the > voice biometric business) we use Matlab extensively for our prototyping. > Recently we have been experimenting with the possibility of packaging Matlab > code and call it directly in our commercial products. This is accomplished > by means of the "Matlab compiler" that is able to pack .m functions into > native libraries, which are executed by a Matlab runtime (the MCR, that can > be distributed freely to our customers). This experiment hasn't been very > successful due to compatibility problems with some third party libraries > that the Matlab runtime uses. Being a closed-source product, we don't have > many options there. > > > > Octave looks like a good alternative to Matlab: able to compile it from the > sources we'd have a greater deal of control over third-party dependencies. > Well, it seems very promising to me. The issue with Octave is that it's > distributed under GPL license and being such a complex and wordy license I'm > not sure if this license allows us doing what I have in mind: write some > code in Octave, compile Octave as a library that will execute the Octave > code under demand, distribute this library in binary format as part of our > software products and sell commercially these products. Well, is this > possible with Octave or is it not? I'd like to have your confirmation > without continuing any further. > > > > If anyone is interested we can contribute with any modifications we made to > Octave code. > > > > Thank you so much for your answer. > > The FAQ on the website is not up to date, but this http://hg.savannah.gnu.org/hgweb/octave/file/f80c566bc751/doc/faq/OctaveFAQ.texi version contains some discussion of the issues. You probably can't do it the way you described. What are you trying to do anyway? Hide the code of your m-files? Or deliver your code under your chosen license? You can use mex and m-files under whatever license your want and deliver them with Octave and long as you supply the means for your clients to obtain the source of Octave in the form that you used to for the binary that you delivered D. From przemek.klosowski at nist.gov Thu Nov 12 13:44:41 2009 From: przemek.klosowski at nist.gov (Przemek Klosowski) Date: Thu, 12 Nov 2009 14:44:41 -0500 Subject: find command sometimes doesn't work in script In-Reply-To: <69d8d540911120343r33498802l8fc50c3b24a3f250@mail.gmail.com> References: <-1596727648911815413@unknownmsgid> <69d8d540911111239x66ccf95di2d3f109b3eb99f65@mail.gmail.com> <-2257071128307711256@unknownmsgid> <69d8d540911120229j77e5f40ayf56014d7e3aa24ea@mail.gmail.com> <1427976492404843802@unknownmsgid> <69d8d540911120343r33498802l8fc50c3b24a3f250@mail.gmail.com> Message-ID: <4AFC65A9.4090706@nist.gov> On 11/12/2009 06:43 AM, Jaroslav Hajek wrote: > > On Thu, Nov 12, 2009 at 12:33 PM, Lidia Bressan Just for curiosity, the equality you said works: > > octave:119> 1 + 21 * 0.05 == 2.05 > ans = 1 > octave:120> 1 == 1 > ans = 1 > > > Oh yes. Sorry, that was a nonsense. Of course this works. But it > wouldn't work in C++ (which is what Octave does internally). Are you saying that the expression "1+21*.05" gives a different result in Octave and C++? I thought that the difference results from the fact that 1+21*.05 and the corresponding element of [1:.05:3] are calculated by different methods--although I am not sure what is the method used by the range expression. It is instructive to display the binary representation ('format hex') for several ways of calculating 2.05: internal repr. Octave expression 4000666666666666 2.05 <-- straight number 4000666666666666 1+21*0.05 <-- simple calculation 4006666666666667 [1:.05:3](37) <-- corresp. number from the range 4006666666666666 [3:-.05:1](5) <-- just for fun, reverse range 4006666666666662 1+.05+.05+.05+.05+.05+.05+.05+.05+.05+.05+.05+.05+.05+.05+.05+.05+.05+.05+.05+.05+.05+.05+.05+.05+.05+.05+.05+.05+.05+.05+.05+.05+.05+.05+.05+.05 4006666666666668 .05+.05+.05+.05+.05+.05+.05+.05+.05+.05+.05+.05+.05+.05+.05+.05+.05+.05+.05+.05+.05+.05+.05+.05+.05+.05+.05+.05+.05+.05+.05+.05+.05+.05+.05+.05+1 From these data, I take it that 1:.05:3 is not simply computed by successive accumulation like in the fifth expression above. From efuentetaja at agnitio.es Thu Nov 12 17:06:49 2009 From: efuentetaja at agnitio.es (Eduardo Fuentetaja) Date: Fri, 13 Nov 2009 00:06:49 +0100 Subject: Using octave runtime in a commercial product In-Reply-To: <4AFC616F.1040009@dbateman.org> References: <072b01ca63c5$e9a7dd00$bcf79700$@es> <4AFC616F.1040009@dbateman.org> Message-ID: <001101ca63ec$d1efb620$75cf2260$@es> Thank you for the quick answer. That link was helpful. Yes, we'd like to protect the m-files. The idea would be to have an application A that calls a library L. This library would have embedded the Octave interpreter, that we will use to run our m-files. We wouldn't have a problem releasing the source code for the library L, but we wouldn't like to release the source code of A or the m-files as GPL. Would A be considered a derivative work from Octave? That's the question. Regards, Ed -----Mensaje original----- De: David Bateman [mailto:dbateman at dbateman.org] Enviado el: jueves, 12 de noviembre de 2009 20:27 Para: Eduardo Fuentetaja CC: help at octave.org Asunto: Re: Using octave runtime in a commercial product Eduardo Fuentetaja wrote: > Dear Octave team, > > > > I haven't been able to find an answer to my question on the Octave wiki or > forums. Let me give you some context: at my company (Agnitio, we are in the > voice biometric business) we use Matlab extensively for our prototyping. > Recently we have been experimenting with the possibility of packaging Matlab > code and call it directly in our commercial products. This is accomplished > by means of the "Matlab compiler" that is able to pack .m functions into > native libraries, which are executed by a Matlab runtime (the MCR, that can > be distributed freely to our customers). This experiment hasn't been very > successful due to compatibility problems with some third party libraries > that the Matlab runtime uses. Being a closed-source product, we don't have > many options there. > > > > Octave looks like a good alternative to Matlab: able to compile it from the > sources we'd have a greater deal of control over third-party dependencies. > Well, it seems very promising to me. The issue with Octave is that it's > distributed under GPL license and being such a complex and wordy license I'm > not sure if this license allows us doing what I have in mind: write some > code in Octave, compile Octave as a library that will execute the Octave > code under demand, distribute this library in binary format as part of our > software products and sell commercially these products. Well, is this > possible with Octave or is it not? I'd like to have your confirmation > without continuing any further. > > > > If anyone is interested we can contribute with any modifications we made to > Octave code. > > > > Thank you so much for your answer. > > The FAQ on the website is not up to date, but this http://hg.savannah.gnu.org/hgweb/octave/file/f80c566bc751/doc/faq/OctaveFAQ. texi version contains some discussion of the issues. You probably can't do it the way you described. What are you trying to do anyway? Hide the code of your m-files? Or deliver your code under your chosen license? You can use mex and m-files under whatever license your want and deliver them with Octave and long as you supply the means for your clients to obtain the source of Octave in the form that you used to for the binary that you delivered D. -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3931 bytes Desc: not available Url : https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091113/9750d144/attachment-0001.bin From dbateman at dbateman.org Thu Nov 12 18:27:33 2009 From: dbateman at dbateman.org (David Bateman) Date: Fri, 13 Nov 2009 01:27:33 +0100 Subject: Using octave runtime in a commercial product In-Reply-To: <001101ca63ec$d1efb620$75cf2260$@es> References: <072b01ca63c5$e9a7dd00$bcf79700$@es> <4AFC616F.1040009@dbateman.org> <001101ca63ec$d1efb620$75cf2260$@es> Message-ID: <4AFCA7F5.8000003@dbateman.org> Eduardo Fuentetaja wrote: > Thank you for the quick answer. That link was helpful. > > Yes, we'd like to protect the m-files. The idea would be to have an > application A that calls a library L. This library would have embedded the > Octave interpreter, that we will use to run our m-files. We wouldn't have a > problem releasing the source code for the library L, but we wouldn't like to > release the source code of A or the m-files as GPL. > > Would A be considered a derivative work from Octave? That's the question. > > Yes as embedding octave would be considered a derivative work as described in the FAQ.... If you don't mind that the source code of the m-files are visible, then they can be licensed under whatever license you like as described in the FAQ link I sent, then just use a popen2 in your application A to start an octave process, feed it the data you want and recover it however you want and I believe you could do this. Perhaps John might clarify his position though. A big note however, lots of people on this list have given enormous amounts of code into Octave free and when this community will respect your company or not will depend largely on what you give back to the community. David -- 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) From storrsjm at email.uc.edu Thu Nov 12 18:26:24 2009 From: storrsjm at email.uc.edu (Judd Storrs) Date: Thu, 12 Nov 2009 19:26:24 -0500 Subject: Using octave runtime in a commercial product In-Reply-To: <001101ca63ec$d1efb620$75cf2260$@es> References: <072b01ca63c5$e9a7dd00$bcf79700$@es> <4AFC616F.1040009@dbateman.org> <001101ca63ec$d1efb620$75cf2260$@es> Message-ID: I think the key question is going to be: Does the library A _only_ use the MEX interface? Yes: Not a derivative. No: Definitely a derivative according to the octave developers. If you use any other octave headers (i.e. any binary interface or data structure that does not also exist within Matlab), the developers of octave consider the result to be a derived work of octave. Additionally, there is the issue of how you are going to prevent the customers from reading the contents of *.m files. I don't think octave currently has any method to protect the contents of *.m files and octave also does not currently have an equivalent to the matlab compiler. --judd On Thu, Nov 12, 2009 at 6:06 PM, Eduardo Fuentetaja wrote: > Thank you for the quick answer. That link was helpful. > > Yes, we'd like to protect the m-files. The idea would be to have an > application A that calls a library L. This library would have embedded the > Octave interpreter, that we will use to run our m-files. We wouldn't have a > problem releasing the source code for the library L, but we wouldn't like to > release the source code of A or the m-files as GPL. > > Would A be considered a derivative work from Octave? That's the question. > > Regards, > > ? ? ? ?Ed > > -----Mensaje original----- > De: David Bateman [mailto:dbateman at dbateman.org] > Enviado el: jueves, 12 de noviembre de 2009 20:27 > Para: Eduardo Fuentetaja > CC: help at octave.org > Asunto: Re: Using octave runtime in a commercial product > > Eduardo Fuentetaja wrote: >> Dear Octave team, >> >> >> >> I haven't been able to find an answer to my question on the Octave wiki or >> forums. Let me give you some context: at my company (Agnitio, we are in > the >> voice biometric business) we use Matlab extensively for our prototyping. >> Recently we have been experimenting with the possibility of packaging > Matlab >> code and call it directly in our commercial products. This is accomplished >> by means of the "Matlab compiler" that is able to pack .m functions into >> native libraries, which are executed by a Matlab runtime (the MCR, that > can >> be distributed freely to our customers). This experiment hasn't been very >> successful due to compatibility problems with some third party libraries >> that the Matlab runtime uses. Being a closed-source product, we don't have >> many options there. >> >> >> >> Octave looks like a good alternative to Matlab: able to compile it from > the >> sources we'd have a greater deal of control over third-party dependencies. >> Well, it seems very promising to me. The issue with Octave is that it's >> distributed under GPL license and being such a complex and wordy license > I'm >> not sure if this license allows us doing what I have in mind: write some >> code in Octave, compile Octave as a library that will execute the Octave >> code under demand, distribute this library in binary format as part of our >> software products and sell commercially these products. Well, is this >> possible with Octave or is it not? I'd like to have your confirmation >> without continuing any further. >> >> >> >> If anyone is interested we can contribute with any modifications we made > to >> Octave code. >> >> >> >> Thank you so much for your answer. >> >> > The FAQ on the website is not up to date, but this > > http://hg.savannah.gnu.org/hgweb/octave/file/f80c566bc751/doc/faq/OctaveFAQ. > texi > > version contains some discussion of the issues. You probably can't do it > the way you described. What are you trying to do anyway? Hide the code > of your m-files? Or deliver your code under your chosen license? You can > use mex and m-files under whatever license your want and deliver them > with Octave and long as you supply the means for your clients to obtain > the source of Octave in the form that you used to for the binary that > you delivered > > D. > > _______________________________________________ > Help-octave mailing list > Help-octave at octave.org > https://www-old.cae.wisc.edu/mailman/listinfo/help-octave > > From storrsjm at email.uc.edu Thu Nov 12 18:59:35 2009 From: storrsjm at email.uc.edu (Judd Storrs) Date: Thu, 12 Nov 2009 19:59:35 -0500 Subject: Using octave runtime in a commercial product In-Reply-To: <4AFCA7F5.8000003@dbateman.org> References: <072b01ca63c5$e9a7dd00$bcf79700$@es> <4AFC616F.1040009@dbateman.org> <001101ca63ec$d1efb620$75cf2260$@es> <4AFCA7F5.8000003@dbateman.org> Message-ID: On Thu, Nov 12, 2009 at 7:27 PM, David Bateman wrote: > just use a popen2 in your application A to start an octave process, feed > it the data you want and recover it however you want and I believe you > could do this. Perhaps John might clarify his position though. Well, unfortunately this won't really protect *.m code if someone wants it. No matter how cleverly you encrypt the files on disk/wherever they will always flow as plain text through the pipe. Anyone could substitute a rogue interpreter to siphon off the code as it is filtered. Any sort of hand-shaking would have to be either covered by the GPL (i.e. available as source code) or MEX compatible (i.e. reusable by a rogue octave). It seems to me the best chance of protecting code with octave is MEX binaries with some sort of anti-disassembler tricks. Honestly, I don't think there's much you can do. In the end it's all just speed bumps. --judd From bpabbott at mac.com Thu Nov 12 19:16:57 2009 From: bpabbott at mac.com (Ben Abbott) Date: Thu, 12 Nov 2009 20:16:57 -0500 Subject: Plotting issues: arrows and label font size In-Reply-To: References: <4AFB59FA.2080203@webdrake.net> Message-ID: <32CD25CE-6719-4F32-B47D-54269F2C07A4@mac.com> On Nov 12, 2009, at 7:33 AM, rpf at gmx.li wrote: >> Second: axis label sizes. I think I'm doing the right thing by setting >> >> xlabel('X','fontsize',16) >> >> ... but although getting the properties of the label with get() reveals >> the fontsize value has been set correctly, when I use the print command >> to output an EPS file the font size is not changed. Is it me or Octave >> who is doing things wrong? :-P > > > I use > > xlabel("X","fontsize", 16) > print -deps -F:10 foo.eps > > and that works well. It prints the xlabel with font size 16 and the > values on the axes in font size 10. (at least for octave 3.0, gnuplot > 4.5 using wxt terminal) The above works for 3.0.x, but will not work for the more recent 3.2.x builds. Octave's development has been progressing toward compatibility with Matlab. However, it is not there yet. The commands below will produce a plot with 10pt fonts for the axis tick labels and for the ylabel. The xlabel will be size 16. x = 0:10; plot (x, x) set (gca, "fontsize", 20) xlabel ("fontsize=16", "fontsize", 32) ylabel ("fontsize=10", "fontsize", 20) print -depsc foo.eps The fontsizes are set to twice the targeted values as the gnuplot eps terminal scales the fontsize down by a factor of two (this is intentional, and not a bug). Ben From srinivasan.rajaraman at gmail.com Thu Nov 12 19:43:49 2009 From: srinivasan.rajaraman at gmail.com (srini) Date: Thu, 12 Nov 2009 20:43:49 -0500 Subject: Problem in installing octave-3.2.3 in Suse Linux 2.6.16.60-0.42.7 Message-ID: <508a30f80911121743u29394b2cq878a9e9d38f56c5a@mail.gmail.com> Dear member, I am a newby in Octave. I tried to install Octave-3.2.3 in Linux machine with Suse 2.6.16.60-0.42.7. The GCC version is 4.4.1 I am seeing the following errors after I Run "make." *../libcruft/libcruft.so: undefined reference to `csrot_' ../libcruft/libcruft.so: undefined reference to `zdrot_' collect2: ld returned 1 exit status make[2]: *** [octave] Error 1 make[2]: Leaving directory `/mnt/gpfs/usrpeople/srini/octave-3.2.3/src' make[1]: *** [src] Error 2 make[1]: Leaving directory `/mnt/gpfs/usrpeople/srini/octave-3.2.3' make: *** [all] Error 2* Not sure what this means. Can anybody please help me out here? Regards, Srini -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091112/21e7f940/attachment.html From bpabbott at mac.com Thu Nov 12 19:17:15 2009 From: bpabbott at mac.com (Ben Abbott) Date: Thu, 12 Nov 2009 20:17:15 -0500 Subject: eps size in print In-Reply-To: References: Message-ID: On Nov 12, 2009, at 7:52 AM, rpf at gmx.li wrote: > Hello all, > > I print my plots to eps files to include them in PDFLatex documents > after using epstopdf. The print command help states that the size > option, e.g. -S700,700 is only available when using PNG and SVG. When > I resize the eps afterwards with epsffit or using > inscludegraphics[height=5cm]{...}, the text is distorted. How can I > preset the size of the image I get, or is there a way to resize the > eps without loosing the textsize? > > thanks! Using the 3.0.x series of Octave, I do not know how to change the size of the eps output. For the 3.2.x series, the size of the output is specified by the figure property "paperposition", which is a 4 element vector. For eps output, running 3.2.2/3, the first two elements of the vector do not effect the eps output. The 2nd two define the width and height in inches. To obtain a 6x4 inch eps image set (gcf, "paperpositionsize", [0.5 0.5 6 4]) print -depsc foo.eps Ben From jordigh at gmail.com Thu Nov 12 23:02:26 2009 From: jordigh at gmail.com (=?UTF-8?Q?Jordi_Guti=C3=A9rrez_Hermoso?=) Date: Thu, 12 Nov 2009 23:02:26 -0600 Subject: Using octave runtime in a commercial product In-Reply-To: <001101ca63ec$d1efb620$75cf2260$@es> References: <072b01ca63c5$e9a7dd00$bcf79700$@es> <4AFC616F.1040009@dbateman.org> <001101ca63ec$d1efb620$75cf2260$@es> Message-ID: <9543b3a40911122102v5afb2d9dw900ae58554587365@mail.gmail.com> 2009/11/12 Eduardo Fuentetaja : > Yes, we'd like to protect the m-files. I think you mean "restrict", files aren't damaged or hurt when they're copied, distributed, or studied. If you modify them for the worse, that could arguably be something that needs to be protected against, but I don't think that's what you have in mind. Also, commercial and free aren't contradictory terms, there is much free software that is being sold for a profit, and profitably so. The antonym of commercial is gratis; the antonym of free is proprietary. These pair of antonyms lie on orthogonal axes. > The idea would be to have an application A that calls a library L. Since it's in library form, I assume you mean dynamic linking. The FSF's standing opinion is that dynamic linking constitutes a derivative work under copyright law, hence covered under the GPL, although a few people disagree with this, and nobody has successfully challenged the FSF's opinion in court. I don't recommend you attempt to challenge this opinion. If you don't want freedom, Octave isn't for you. From jordigh at gmail.com Thu Nov 12 23:12:02 2009 From: jordigh at gmail.com (=?UTF-8?Q?Jordi_Guti=C3=A9rrez_Hermoso?=) Date: Thu, 12 Nov 2009 23:12:02 -0600 Subject: Using octave runtime in a commercial product In-Reply-To: <9543b3a40911122102v5afb2d9dw900ae58554587365@mail.gmail.com> References: <072b01ca63c5$e9a7dd00$bcf79700$@es> <4AFC616F.1040009@dbateman.org> <001101ca63ec$d1efb620$75cf2260$@es> <9543b3a40911122102v5afb2d9dw900ae58554587365@mail.gmail.com> Message-ID: <9543b3a40911122112q5a9d259ci714a14559b55c417@mail.gmail.com> 2009/11/12 Jordi Guti?rrez Hermoso : > 2009/11/12 Eduardo Fuentetaja : >> Yes, we'd like to protect the m-files. > > I think you mean "restrict", I'm sorry. This came out a bit more harsh than I wanted it to sound, particularly because we speak different languages on the free/proprietary - gratis/commercial plane. Octave has a long and rich history of code sharing and community. If you want to take code and use it without giving back, some longstanding members of the Octave community might react unfavourably. I urge you to reconsider the use case you plan for Octave and consider releasing free commercial code. From fretenburg at ieee.org Fri Nov 13 00:45:23 2009 From: fretenburg at ieee.org (Russ Fretenburg) Date: Thu, 12 Nov 2009 22:45:23 -0800 Subject: Problems with dbstop command Message-ID: <2ce4b8480911122245g338abf39k7e4479162d8776b4@mail.gmail.com> Hi, I am using Octave 3.2.2 on Ubuntu 9.10 and am having trouble debugging a script using Octave's command line debugger. I set a breakpoint in my script using the dbstop command and when I run the script it stops at the correct place. No debug> prompt appears though. It just sits there blankly and my CPU gets 100% used by Octave. Here is what I see: ------------------------------------------------------------------------------------------------ RussBoxerOctave: line 427, column 2 keyboard: stopped in /home/fretenburg/Documents/PDE/Ensco/Boxer/Software/Octave/RussBoxerOctave.m at line 427 427: x=[10:5:(NumberOfFiles*5+5)]; ----------------------------------------------------------------------------------------------- It just sits there like that until I hit Cntl-C to exit. Any ideas what I am doing wrong? Best regards, Russ -- Russ Fretenburg fretenburg at ieee.org http://ca.linkedin.com/in/russfretenburg -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091112/4877ecd0/attachment-0001.html From efuentetaja at agnitio.es Fri Nov 13 01:28:02 2009 From: efuentetaja at agnitio.es (Eduardo Fuentetaja) Date: Fri, 13 Nov 2009 08:28:02 +0100 Subject: Using octave runtime in a commercial product In-Reply-To: <9543b3a40911122112q5a9d259ci714a14559b55c417@mail.gmail.com> References: <072b01ca63c5$e9a7dd00$bcf79700$@es> <4AFC616F.1040009@dbateman.org> <001101ca63ec$d1efb620$75cf2260$@es> <9543b3a40911122102v5afb2d9dw900ae58554587365@mail.gmail.com> <9543b3a40911122112q5a9d259ci714a14559b55c417@mail.gmail.com> Message-ID: <004901ca6432$d6b85ef0$84291cd0$@es> Thank you all guys for the info. I got the picture. Just for the record: I'm not an enemy of freedom. In fact I have contributed in the past a great deal of my time to some open source projects and I feel proud of it. This question was for my day job (the one that helps me pay my bills), and the last think I want for many reasons (including legal) is to take dishonest advantage of the good work you guys put in Octave. One piece of thought for your consideration: Octave's got great value and there are companies out there (like mine) that would be willing to compensate economically for the benefits of legally using Octave. Then you use that money to helping cure malaria or -another idea- to organize a Octave user day in Vegas, all expenses paid. Thanks a lot for your comments and keep up the good work. Ed -----Mensaje original----- De: Jordi Guti?rrez Hermoso [mailto:jordigh at gmail.com] Enviado el: viernes, 13 de noviembre de 2009 6:12 Para: Eduardo Fuentetaja CC: David Bateman; help at octave.org Asunto: Re: Using octave runtime in a commercial product 2009/11/12 Jordi Guti?rrez Hermoso : > 2009/11/12 Eduardo Fuentetaja : >> Yes, we'd like to protect the m-files. > > I think you mean "restrict", I'm sorry. This came out a bit more harsh than I wanted it to sound, particularly because we speak different languages on the free/proprietary - gratis/commercial plane. Octave has a long and rich history of code sharing and community. If you want to take code and use it without giving back, some longstanding members of the Octave community might react unfavourably. I urge you to reconsider the use case you plan for Octave and consider releasing free commercial code. -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3931 bytes Desc: not available Url : https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091113/90473db5/attachment.bin From soren at hauberg.org Fri Nov 13 01:40:24 2009 From: soren at hauberg.org (=?ISO-8859-1?Q?S=F8ren?= Hauberg) Date: Fri, 13 Nov 2009 08:40:24 +0100 Subject: Using octave runtime in a commercial product In-Reply-To: <004901ca6432$d6b85ef0$84291cd0$@es> References: <072b01ca63c5$e9a7dd00$bcf79700$@es> <4AFC616F.1040009@dbateman.org> <001101ca63ec$d1efb620$75cf2260$@es> <9543b3a40911122102v5afb2d9dw900ae58554587365@mail.gmail.com> <9543b3a40911122112q5a9d259ci714a14559b55c417@mail.gmail.com> <004901ca6432$d6b85ef0$84291cd0$@es> Message-ID: <1258098024.6675.6.camel@hauberg-laptop> fre, 13 11 2009 kl. 08:28 +0100, skrev Eduardo Fuentetaja: > One piece of thought for your consideration: Octave's got great value > and there are companies out there (like mine) that would be willing to > compensate economically for the benefits of legally using Octave. Then > you use that money to helping cure malaria or -another idea- to > organize a Octave user day in Vegas, all expenses paid. Are you suggesting that companies should be able to get Octave under a different license for some amount of cash? While such money would be helpful, I don't think the approach would be practical as we would have to get this accepted by all the people that have contributed to Octave during the last decade. This would be a huge task... S?ren From jwe at octave.org Fri Nov 13 01:50:27 2009 From: jwe at octave.org (John W. Eaton) Date: Fri, 13 Nov 2009 02:50:27 -0500 Subject: Using octave runtime in a commercial product In-Reply-To: <1258098024.6675.6.camel@hauberg-laptop> References: <072b01ca63c5$e9a7dd00$bcf79700$@es> <4AFC616F.1040009@dbateman.org> <001101ca63ec$d1efb620$75cf2260$@es> <9543b3a40911122102v5afb2d9dw900ae58554587365@mail.gmail.com> <9543b3a40911122112q5a9d259ci714a14559b55c417@mail.gmail.com> <004901ca6432$d6b85ef0$84291cd0$@es> <1258098024.6675.6.camel@hauberg-laptop> Message-ID: <19197.4035.93422.582538@segfault.lan> On 13-Nov-2009, S?ren Hauberg wrote: | Are you suggesting that companies should be able to get Octave under a | different license for some amount of cash? While such money would be | helpful, I don't think the approach would be practical as we would have | to get this accepted by all the people that have contributed to Octave | during the last decade. This would be a huge task... Somewhat longer than that now, almost 18 years. And some of the contributors are dead, so contacting them might prove to be difficult. jwe From highegg at gmail.com Fri Nov 13 01:57:18 2009 From: highegg at gmail.com (Jaroslav Hajek) Date: Fri, 13 Nov 2009 08:57:18 +0100 Subject: Using octave runtime in a commercial product In-Reply-To: <004901ca6432$d6b85ef0$84291cd0$@es> References: <072b01ca63c5$e9a7dd00$bcf79700$@es> <4AFC616F.1040009@dbateman.org> <001101ca63ec$d1efb620$75cf2260$@es> <9543b3a40911122102v5afb2d9dw900ae58554587365@mail.gmail.com> <9543b3a40911122112q5a9d259ci714a14559b55c417@mail.gmail.com> <004901ca6432$d6b85ef0$84291cd0$@es> Message-ID: <69d8d540911122357p3bcf811esebcf4f9926f841b6@mail.gmail.com> 2009/11/13 Eduardo Fuentetaja > Thank you all guys for the info. I got the picture. > > Just for the record: I'm not an enemy of freedom. In fact I have > contributed in the past a great deal of my time to some open source projects > and I feel proud of it. This question was for my day job (the one that helps > me pay my bills), and the last think I want for many reasons (including > legal) is to take dishonest advantage of the good work you guys put in > Octave. > > One piece of thought for your consideration: Octave's got great value and > there are companies out there (like mine) that would be willing to > compensate economically for the benefits of legally using Octave. Then you > use that money to helping cure malaria or -another idea- to organize a > Octave user day in Vegas, all expenses paid. > > Some free software projects have the dual licensing option to address such needs (and funding opportunities). However, for Octave it doesn't work because there is no company collecting copyright from contributors; you'd need to arrange the licensing with all past contributors, and there are dozens of them. There are numerous ways how you can encrypt your m-files to make unlicensed use difficult; however, as Judd noted, the decryption could always be intercepted. Maybe you're too pessimistic? Just supply the m-files with clearly stated copyright - look what MathWorks does. Why not just trust your customers? > Thanks a lot for your comments and keep up the good work. > > Ed > > -- RNDr. Jaroslav Hajek computing expert & GNU Octave developer Aeronautical Research and Test Institute (VZLU) Prague, Czech Republic url: www.highegg.matfyz.cz -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091113/eceb1316/attachment.html From efuentetaja at agnitio.es Fri Nov 13 03:48:01 2009 From: efuentetaja at agnitio.es (Eduardo Fuentetaja) Date: Fri, 13 Nov 2009 10:48:01 +0100 Subject: Using octave runtime in a commercial product In-Reply-To: <69d8d540911122357p3bcf811esebcf4f9926f841b6@mail.gmail.com> References: <072b01ca63c5$e9a7dd00$bcf79700$@es> <4AFC616F.1040009@dbateman.org> <001101ca63ec$d1efb620$75cf2260$@es> <9543b3a40911122102v5afb2d9dw900ae58554587365@mail.gmail.com> <9543b3a40911122112q5a9d259ci714a14559b55c417@mail.gmail.com> <004901ca6432$d6b85ef0$84291cd0$@es> <69d8d540911122357p3bcf811esebcf4f9926f841b6@mail.gmail.com> Message-ID: <007601ca6446$64a9ac10$2dfd0430$@es> Well, I trust our customers (mostly law enforcement organizations), but I don?t trust our competitors at all. Regards, Ed De: Jaroslav Hajek [mailto:highegg at gmail.com] Enviado el: viernes, 13 de noviembre de 2009 8:57 Para: Eduardo Fuentetaja CC: Jordi Guti?rrez Hermoso; help at octave.org Asunto: Re: Using octave runtime in a commercial product 2009/11/13 Eduardo Fuentetaja Thank you all guys for the info. I got the picture. Just for the record: I'm not an enemy of freedom. In fact I have contributed in the past a great deal of my time to some open source projects and I feel proud of it. This question was for my day job (the one that helps me pay my bills), and the last think I want for many reasons (including legal) is to take dishonest advantage of the good work you guys put in Octave. One piece of thought for your consideration: Octave's got great value and there are companies out there (like mine) that would be willing to compensate economically for the benefits of legally using Octave. Then you use that money to helping cure malaria or -another idea- to organize a Octave user day in Vegas, all expenses paid. Some free software projects have the dual licensing option to address such needs (and funding opportunities). However, for Octave it doesn't work because there is no company collecting copyright from contributors; you'd need to arrange the licensing with all past contributors, and there are dozens of them. There are numerous ways how you can encrypt your m-files to make unlicensed use difficult; however, as Judd noted, the decryption could always be intercepted. Maybe you're too pessimistic? Just supply the m-files with clearly stated copyright - look what MathWorks does. Why not just trust your customers? Thanks a lot for your comments and keep up the good work. Ed -- RNDr. Jaroslav Hajek computing expert & GNU Octave developer Aeronautical Research and Test Institute (VZLU) Prague, Czech Republic url: www.highegg.matfyz.cz -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091113/70c642fd/attachment-0001.html -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3931 bytes Desc: not available Url : https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091113/70c642fd/attachment-0001.bin From jerrywu26 at gmail.com Fri Nov 13 03:33:55 2009 From: jerrywu26 at gmail.com (Jerry Wu) Date: Fri, 13 Nov 2009 01:33:55 -0800 Subject: problem about plotting Message-ID: <3903B117-5795-42E6-A72D-F955B7169C97@gmail.com> Hi I have problem plotting the graph, It shows me the message: octave-3.2.3:4> multiplot> set palette file "-" binary record=64 using 1:2:3:4; ^ line 0: Gray scale not sorted in gradient. I use: Mac OS 10.5.8 GNU Octave, version 3.2.3 Octave was configured for "i386-apple-darwin8.11.1". G N U P L O T Version 4.2 patchlevel 6 last modified Sep 2009 System: Darwin 9.8.0 X11 - 2.3.2 So how can I fix the problem? Thanks a lot!!! From jordigh at gmail.com Fri Nov 13 07:44:59 2009 From: jordigh at gmail.com (=?UTF-8?Q?Jordi_Guti=C3=A9rrez_Hermoso?=) Date: Fri, 13 Nov 2009 07:44:59 -0600 Subject: Using octave runtime in a commercial product In-Reply-To: <007601ca6446$64a9ac10$2dfd0430$@es> References: <072b01ca63c5$e9a7dd00$bcf79700$@es> <4AFC616F.1040009@dbateman.org> <001101ca63ec$d1efb620$75cf2260$@es> <9543b3a40911122102v5afb2d9dw900ae58554587365@mail.gmail.com> <9543b3a40911122112q5a9d259ci714a14559b55c417@mail.gmail.com> <004901ca6432$d6b85ef0$84291cd0$@es> <69d8d540911122357p3bcf811esebcf4f9926f841b6@mail.gmail.com> <007601ca6446$64a9ac10$2dfd0430$@es> Message-ID: <9543b3a40911130544r4171dfe7jad6cbef8d93f7e7e@mail.gmail.com> 2009/11/13 Eduardo Fuentetaja : > Well, I trust our customers (mostly law enforcement organizations), but I > don?t trust our competitors at all. Why would your customers give your code to your competitors? And if they did, how would your competitors using that code hurt you, since it would only mean that they would have to release source as well? The GPL levels the playing field. In free code which is commercially viable (e.g. Linux), all companies contribute to the code on the same terms. IBM gives patches to Linux because it benefits IBM; Intel provides drivers for Linux because it's good for Intel to do so. This tangentially also benefits others companies, but that's not why IBM and Intel are doing it. I think Octave is equally commercially viable, but having such a huge competitor as Matlab has made it difficult so far to outshine it. From bpabbott at mac.com Fri Nov 13 08:07:15 2009 From: bpabbott at mac.com (Ben Abbott) Date: Fri, 13 Nov 2009 09:07:15 -0500 Subject: problem about plotting In-Reply-To: <3903B117-5795-42E6-A72D-F955B7169C97@gmail.com> References: <3903B117-5795-42E6-A72D-F955B7169C97@gmail.com> Message-ID: <150002670706533996093647936974172217260-Webmail@me.com> On Friday, November 13, 2009, at 04:33AM, "Jerry Wu" wrote: >Hi I have problem plotting the graph, >It shows me the message: > >octave-3.2.3:4> >multiplot> set palette file "-" binary record=64 using 1:2:3:4; > ^ > line 0: Gray scale not sorted in gradient. > > >I use: >Mac OS 10.5.8 > >GNU Octave, version 3.2.3 >Octave was configured for "i386-apple-darwin8.11.1". > >G N U P L O T > Version 4.2 patchlevel 6 > last modified Sep 2009 > System: Darwin 9.8.0 > >X11 - 2.3.2 > >So how can I fix the problem? > >Thanks a lot!!! Can you provide us with a simple example so that we may duplicate the problem? Ben From Potorti at isti.cnr.it Thu Nov 12 03:37:46 2009 From: Potorti at isti.cnr.it (Francesco =?utf-8?Q?Potort=C3=AC?=) Date: Thu, 12 Nov 2009 10:37:46 +0100 Subject: Plotting issues: arrows and label font size In-Reply-To: <4AFB59FA.2080203@webdrake.net> References: <4AFB59FA.2080203@webdrake.net> Message-ID: >First: is it possible to add arrowheads to plotted lines? No, as far as I know. You could write your own function that does it, though. Either by plotting a line going through the four points defining an arrow or, probabky better, using the line() function. -- Francesco Potort? (ricercatore) Voice: +39 050 315 3058 (op.2111) ISTI - Area della ricerca CNR Fax: +39 050 315 2040 via G. Moruzzi 1, I-56124 Pisa Email: Potorti at isti.cnr.it (entrance 20, 1st floor, room C71) Web: http://fly.isti.cnr.it/ From frenk.calza at gmail.com Fri Nov 13 09:46:29 2009 From: frenk.calza at gmail.com (franco basaglia) Date: Fri, 13 Nov 2009 16:46:29 +0100 Subject: octave and delay ode's In-Reply-To: References: <55A3A9EF-0C56-4091-A6AE-8A126012CD71@gmail.com> <2ED5382C-8DFA-45C1-BD40-00DD0EE986FC@gmail.com> <4AEF326D.1070406@gmx.net> <970DCC2C-F189-43B7-AD47-8D847899D89B@gmail.com> <4AF2F3BC.8040409@gmx.net> Message-ID: Thanks a lot Carlo. The is the best way. Using discrete system I have exactly the results like Stella. I'm happy best regards f.b. 2009/11/7 Carlo de Falco > > On 7 Nov 2009, at 19:13, franco basaglia wrote: > > Thank you all for your work. >> >> I have a last question. >> I'd convert my ode system to a discrete-time system >> with annual time step. In thsi way I can simplify my delay question. >> >> What is the octave solver to use? How can I plan the system in Octave? >> >> The discrete system is something like that: >> >> y1(t) = y1(t-1) -y1(t) >> y2(t) = y2(t-1) -y2(t) + y1(t-5) >> y3(t) = t3(t-1) -y3(t) + y2(t-10)*y1(t-10) >> >> > what you have written above is the Backward-Euler > method applied to your differential system. > to implement it in Octave, you need just to: > > 1) initialize your state variables for t<=10 > 2) add a cycle over t=11:T > 3) solve the non-linear system at each step with e.g. "fsolve" > > function res = fun (y,ym1,ym5,ym10) > res(1) = -y(1) + ym1(1) -y(1); > res(2) = -y(2) + ym1(2) -y(2) + ym5(1); > res(3) = -y(3) + ym1(3) -y(3) + ym10(2)*ym10(1); > endfunction > > y = ones(3,10); > for t = 11:100 > y(:,t) = fsolve(@(x) fun(x,y(:,t-1),y(:,t-5),y(:,t-10)), y(:,t-1)); > endfor > > and you're all set. > anyway this is more or less equivalent to > > > function f = fun (t, y, yd) > f(1) =-y(1); > f(2) =-y(2) + yd(1,1); > f(3) =-y(3) + yd(2,2)*yd(1,2); > endfunction > T = [0,20]; > res = ode45d (@fun, T, [1;1;1], [5, 10], ones (3,2)); > > but much less accurate, as you can see by running both implementations > above and then typing: > > plot(-10:89, y) > hold on > plot (res.x, res.y, 'x-') > > it seems to me that, while it more or less captures the asymtotic > behaviuor, > your simplified solver damps away the initial oscillations completely. > > > Thank you >> best regards >> f.b. >> > > HTH, > c. > -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091113/6503b14d/attachment.html From balteo at gmail.com Fri Nov 13 10:46:09 2009 From: balteo at gmail.com (Julien Martin) Date: Fri, 13 Nov 2009 17:46:09 +0100 Subject: Octave equivalent of Matlab's rand?? Message-ID: <1460a1a20911130846u645926f3o5423f7061369beef@mail.gmail.com> Hello, 1. I would like to know what is the Octave equivalent of Matlab's "*rand*" keyword (look at line 2 and note that there are no parentheses). Here is my program: *function X=GenereVariable(p1, p2, Delta1, Delta2) U = rand; X=Delta1 * (U<=p1) - Delta2 * (p1=U); end * 2. Is there a website that references all Octave/Matlab incompatibilities/differences? If so can anyone please direct me to it? Thanks in advance, Julien. -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091113/78e5a05f/attachment.html From soren at hauberg.org Fri Nov 13 10:50:22 2009 From: soren at hauberg.org (=?ISO-8859-1?Q?S=F8ren?= Hauberg) Date: Fri, 13 Nov 2009 17:50:22 +0100 Subject: Octave equivalent of Matlab's rand?? In-Reply-To: <1460a1a20911130846u645926f3o5423f7061369beef@mail.gmail.com> References: <1460a1a20911130846u645926f3o5423f7061369beef@mail.gmail.com> Message-ID: <1258131022.6675.16.camel@hauberg-laptop> fre, 13 11 2009 kl. 17:46 +0100, skrev Julien Martin: > Hello, > > 1. I would like to know what is the Octave equivalent of Matlab's > "rand" keyword (look at line 2 and note that there are no > parentheses). It's the same. > 2. Is there a website that references all Octave/Matlab > incompatibilities/differences? If so can anyone please direct me to > it? Look at the FAQ at www.octave.org: http://www.gnu.org/software/octave/FAQ.html S?ren From jwe at octave.org Fri Nov 13 10:53:43 2009 From: jwe at octave.org (John W. Eaton) Date: Fri, 13 Nov 2009 11:53:43 -0500 Subject: Octave equivalent of Matlab's rand?? In-Reply-To: <1460a1a20911130846u645926f3o5423f7061369beef@mail.gmail.com> References: <1460a1a20911130846u645926f3o5423f7061369beef@mail.gmail.com> Message-ID: <19197.36631.445762.511529@segfault.lan> On 13-Nov-2009, Julien Martin wrote: | 1. I would like to know what is the Octave equivalent of Matlab's "*rand*" | keyword (look at line 2 and note that there are no parentheses). It's not a keyword in either Matlab or Octave. Functions calls with no arguments may be written without (). Octave has a rand function, so I would expect your code to work in both Octave and Matlab. Did you try it? jwe From balteo at gmail.com Fri Nov 13 11:01:04 2009 From: balteo at gmail.com (Julien Martin) Date: Fri, 13 Nov 2009 18:01:04 +0100 Subject: Octave equivalent of Matlab's rand?? In-Reply-To: <19197.36631.445762.511529@segfault.lan> References: <1460a1a20911130846u645926f3o5423f7061369beef@mail.gmail.com> <19197.36631.445762.511529@segfault.lan> Message-ID: <1460a1a20911130901l2d91120bv74354ad160614b37@mail.gmail.com> > > Functions calls with > no arguments may be written without () > Oh, I see... Interesting! Yes I did try it but it returned an error that had nothing to do with the rand function but rather to my misunderstanding of QtOctave. Thanks a lot anyway! J. P.S. Do you think I can post question here about working with QtOctave? 2009/11/13 John W. Eaton > On 13-Nov-2009, Julien Martin wrote: > > | 1. I would like to know what is the Octave equivalent of Matlab's > "*rand*" > | keyword (look at line 2 and note that there are no parentheses). > > It's not a keyword in either Matlab or Octave. Functions calls with > no arguments may be written without (). Octave has a rand function, > so I would expect your code to work in both Octave and Matlab. Did > you try it? > > jwe > -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091113/836a7630/attachment-0001.html From balteo at gmail.com Fri Nov 13 11:20:36 2009 From: balteo at gmail.com (Julien Martin) Date: Fri, 13 Nov 2009 18:20:36 +0100 Subject: Strange error when trying to load a file... Message-ID: <1460a1a20911130920l665fc5b2p44757fccf50be98c@mail.gmail.com> Hello, When I run this from QtOctave: * load("-text","/home/julien/Documents/donn?es/finance/octave/variable-uniforme.m"); * I get this: *error: load: empty name keyword or no data found in file /home/julien/....* Can anyone help please? Julien. -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091113/613cc2b5/attachment.html From jordigh at gmail.com Fri Nov 13 11:56:56 2009 From: jordigh at gmail.com (=?UTF-8?Q?Jordi_Guti=C3=A9rrez_Hermoso?=) Date: Fri, 13 Nov 2009 11:56:56 -0600 Subject: Strange error when trying to load a file... In-Reply-To: <1460a1a20911130920l665fc5b2p44757fccf50be98c@mail.gmail.com> References: <1460a1a20911130920l665fc5b2p44757fccf50be98c@mail.gmail.com> Message-ID: <9543b3a40911130956l4df4c535oe31c2bac0dda7f57@mail.gmail.com> 2009/11/13 Julien Martin : > Hello, > > When I run this from QtOctave: I hope it's not a problem with QtOctave > load("-text","/home/julien/Documents/donn?es/finance/octave/variable-uniforme.m"); Two ideas: (1) character encoding issues (2) load is for loading data, not code. You don't need to do anything special to load code, just be in its directory. From balteo at gmail.com Fri Nov 13 11:59:55 2009 From: balteo at gmail.com (Julien Martin) Date: Fri, 13 Nov 2009 18:59:55 +0100 Subject: Strange error when trying to load a file... In-Reply-To: <1460a1a20911130920l665fc5b2p44757fccf50be98c@mail.gmail.com> References: <1460a1a20911130920l665fc5b2p44757fccf50be98c@mail.gmail.com> Message-ID: <1460a1a20911130959ufa0bb00t80e1bf78b9ff9e9b@mail.gmail.com> This seems to be a QtOctave problem only though. J. 2009/11/13 Julien Martin > Hello, > > When I run this from QtOctave: > * > load("-text","/home/julien/Documents/donn?es/finance/octave/variable-uniforme.m"); > * > > I get this: > *error: load: empty name keyword or no data found in file > /home/julien/....* > > Can anyone help please? > > Julien. > -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091113/4117dfcf/attachment.html From balteo at gmail.com Fri Nov 13 12:01:59 2009 From: balteo at gmail.com (Julien Martin) Date: Fri, 13 Nov 2009 19:01:59 +0100 Subject: Strange error when trying to load a file... In-Reply-To: <1460a1a20911130959ufa0bb00t80e1bf78b9ff9e9b@mail.gmail.com> References: <1460a1a20911130920l665fc5b2p44757fccf50be98c@mail.gmail.com> <1460a1a20911130959ufa0bb00t80e1bf78b9ff9e9b@mail.gmail.com> Message-ID: <1460a1a20911131001u6d39d956i67f7a31913afacad@mail.gmail.com> Jordi, I googled for this issue and some people have had it too with QtOctave. QtOctave seems to be a nice program though. Julien. 2009/11/13 Julien Martin > This seems to be a QtOctave problem only though. > J. > > 2009/11/13 Julien Martin > >> Hello, >> >> >> When I run this from QtOctave: >> * >> load("-text","/home/julien/Documents/donn?es/finance/octave/variable-uniforme.m"); >> * >> >> I get this: >> *error: load: empty name keyword or no data found in file >> /home/julien/....* >> >> Can anyone help please? >> >> Julien. >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091113/3d032314/attachment.html From dbateman at dbateman.org Fri Nov 13 12:06:56 2009 From: dbateman at dbateman.org (David Bateman) Date: Fri, 13 Nov 2009 19:06:56 +0100 Subject: Using octave runtime in a commercial product In-Reply-To: References: <072b01ca63c5$e9a7dd00$bcf79700$@es> <4AFC616F.1040009@dbateman.org> <001101ca63ec$d1efb620$75cf2260$@es> <4AFCA7F5.8000003@dbateman.org> Message-ID: <4AFDA040.5010001@dbateman.org> Judd Storrs wrote: > On Thu, Nov 12, 2009 at 7:27 PM, David Bateman wrote: > >> just use a popen2 in your application A to start an octave process, feed >> it the data you want and recover it however you want and I believe you >> could do this. Perhaps John might clarify his position though. >> > > Well, unfortunately this won't really protect *.m code if someone > wants it. No matter how cleverly you encrypt the files on > disk/wherever they will always flow as plain text through the pipe. > Anyone could substitute a rogue interpreter to siphon off the code as > it is filtered. Any sort of hand-shaking would have to be either > covered by the GPL (i.e. available as source code) or MEX compatible > (i.e. reusable by a rogue octave). It seems to me the best chance of > protecting code with octave is MEX binaries with some sort of > anti-disassembler tricks. Honestly, I don't think there's much you can > do. In the end it's all just speed bumps. > > > --judd > > copyright law protects it whether it is readable or not 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) From jwe at octave.org Fri Nov 13 12:03:38 2009 From: jwe at octave.org (John W. Eaton) Date: Fri, 13 Nov 2009 13:03:38 -0500 Subject: Strange error when trying to load a file... In-Reply-To: <1460a1a20911131001u6d39d956i67f7a31913afacad@mail.gmail.com> References: <1460a1a20911130920l665fc5b2p44757fccf50be98c@mail.gmail.com> <1460a1a20911130959ufa0bb00t80e1bf78b9ff9e9b@mail.gmail.com> <1460a1a20911131001u6d39d956i67f7a31913afacad@mail.gmail.com> Message-ID: <19197.40826.595037.566942@segfault.lan> On 13-Nov-2009, Julien Martin wrote: | I googled for this issue and some people have had it too with QtOctave. | QtOctave seems to be a nice program though. | Julien. | | 2009/11/13 Julien Martin | | > This seems to be a QtOctave problem only though. | > J. | > | > 2009/11/13 Julien Martin | > | >> Hello, | >> | >> | >> When I run this from QtOctave: | >> * | >> load("-text","/home/julien/Documents/donn?es/finance/octave/variable-uniforme.m"); Exactly what is in the file variable-uniforme.m? jwe From balteo at gmail.com Fri Nov 13 12:17:41 2009 From: balteo at gmail.com (Julien Martin) Date: Fri, 13 Nov 2009 19:17:41 +0100 Subject: Octave error messages localized in English rather than in French?? Message-ID: <1460a1a20911131017x42d79a74qee2092a9783804c2@mail.gmail.com> Hello, Being completely new to Octave I have a few questions about it. Sorry for being rather verbose today. *#! /usr/bin/octave -qf #my program goes here... * To my surprise, Octave displays error messages in French, (French being my locale) when run from the command line (see example of a program above). How do I switch to English please? Julien. -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091113/af1e18b9/attachment.html From balteo at gmail.com Fri Nov 13 12:19:17 2009 From: balteo at gmail.com (Julien Martin) Date: Fri, 13 Nov 2009 19:19:17 +0100 Subject: Strange error when trying to load a file... In-Reply-To: <19197.40826.595037.566942@segfault.lan> References: <1460a1a20911130920l665fc5b2p44757fccf50be98c@mail.gmail.com> <1460a1a20911130959ufa0bb00t80e1bf78b9ff9e9b@mail.gmail.com> <1460a1a20911131001u6d39d956i67f7a31913afacad@mail.gmail.com> <19197.40826.595037.566942@segfault.lan> Message-ID: <1460a1a20911131019o6a863ebcqbb6a87d1c7a7aff7@mail.gmail.com> John, function X=GenereVariable(p1, p2, Delta1, Delta2) %X prend la valeur Delta1 avec probabilit? p1 %X prend la valeur Delta2 avec probabilit? p2 %X prend la valeur 0 avec probabilit? 1-p1-p2 U = rand; X=Delta1 * (U<=p1) - Delta2 * (p1=U); end printf("%d",GenereVariable(0.5, 0.5, 0, 1)); I then added this in order to run it from a terminal only invoking the name of the file: ./variable-uniforme.m Julien. 2009/11/13 John W. Eaton > On 13-Nov-2009, Julien Martin wrote: > > | I googled for this issue and some people have had it too with QtOctave. > | QtOctave seems to be a nice program though. > | Julien. > | > | 2009/11/13 Julien Martin > | > | > This seems to be a QtOctave problem only though. > | > J. > | > > | > 2009/11/13 Julien Martin > | > > | >> Hello, > | >> > | >> > | >> When I run this from QtOctave: > | >> * > | >> > load("-text","/home/julien/Documents/donn?es/finance/octave/variable-uniforme.m"); > > Exactly what is in the file variable-uniforme.m? > > jwe > -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091113/898cbeef/attachment.html From jordigh at gmail.com Fri Nov 13 12:44:59 2009 From: jordigh at gmail.com (=?UTF-8?Q?Jordi_Guti=C3=A9rrez_Hermoso?=) Date: Fri, 13 Nov 2009 12:44:59 -0600 Subject: Octave error messages localized in English rather than in French?? In-Reply-To: <1460a1a20911131017x42d79a74qee2092a9783804c2@mail.gmail.com> References: <1460a1a20911131017x42d79a74qee2092a9783804c2@mail.gmail.com> Message-ID: <9543b3a40911131044l49a2bf31y1e6f7474a5bbdcfc@mail.gmail.com> 2009/11/13 Julien Martin : > How do I switch to English please? Switch your locale? I wasn't aware anyone had translated Octave to French, though. What exactly are you seeing in French? From jwe at octave.org Fri Nov 13 12:54:56 2009 From: jwe at octave.org (John W. Eaton) Date: Fri, 13 Nov 2009 13:54:56 -0500 Subject: Octave error messages localized in English rather than in French?? In-Reply-To: <9543b3a40911131044l49a2bf31y1e6f7474a5bbdcfc@mail.gmail.com> References: <1460a1a20911131017x42d79a74qee2092a9783804c2@mail.gmail.com> <9543b3a40911131044l49a2bf31y1e6f7474a5bbdcfc@mail.gmail.com> Message-ID: <19197.43904.839212.448981@segfault.lan> On 13-Nov-2009, Jordi Guti?rrez Hermoso wrote: | I wasn't aware anyone had translated Octave to French, though. What | exactly are you seeing in French? I'm pretty sure Octave itself is not producing error messages in anything but English. Changing your locale won't do anything. jwe From balteo at gmail.com Fri Nov 13 12:59:55 2009 From: balteo at gmail.com (Julien Martin) Date: Fri, 13 Nov 2009 19:59:55 +0100 Subject: Octave error messages localized in English rather than in French?? In-Reply-To: <19197.43904.839212.448981@segfault.lan> References: <1460a1a20911131017x42d79a74qee2092a9783804c2@mail.gmail.com> <9543b3a40911131044l49a2bf31y1e6f7474a5bbdcfc@mail.gmail.com> <19197.43904.839212.448981@segfault.lan> Message-ID: <1460a1a20911131059y4fd7d309rdf34b882f5e9cfee@mail.gmail.com> My mistake again! I had an error in the "she bang". Julien. 2009/11/13 John W. Eaton > On 13-Nov-2009, Jordi Guti?rrez Hermoso wrote: > > | I wasn't aware anyone had translated Octave to French, though. What > | exactly are you seeing in French? > > I'm pretty sure Octave itself is not producing error messages in > anything but English. Changing your locale won't do anything. > > jwe > -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091113/3e7d8611/attachment.html From Sven-Erik.Tiberg at ltu.se Fri Nov 13 15:25:23 2009 From: Sven-Erik.Tiberg at ltu.se (Sven-Erik Tiberg) Date: Fri, 13 Nov 2009 22:25:23 +0100 Subject: Win 64 bits version Message-ID: <610858C4350B6C4693B7D1AE08074D2ACCBDBAC637@VERA.personal.adp.ltu.se> Hi Would like to try octave in a win 2008 R2 server with 48G/500G+ memory and 2Xquadcore processors. Any hint on how to install octave with optimum memory and cpu core support. BTW, run the servers as Remote desktop servers, and uses one for imageprocessing and the other for more general calculations using Matlab 64-version and Comsol Multiphysics and a bit more. /Sven-Erik From tmacchant at yahoo.co.jp Fri Nov 13 16:21:59 2009 From: tmacchant at yahoo.co.jp (Tatsuro MATSUOKA) Date: Sat, 14 Nov 2009 07:21:59 +0900 (JST) Subject: [OctDev] Win 64 bits version In-Reply-To: <610858C4350B6C4693B7D1AE08074D2ACCBDBAC637@VERA.personal.adp.ltu.se> Message-ID: <20091113222203.4181.qmail@web3810.mail.bbt.yahoo.co.jp> Hello At present, there is no 64bit version of octave on windows. I hear that Benjamin Lindner, who is maintainer of octave for windows on MinGW32, personally is tring to build octave by 64 bit MinGW gcc. At present, the solution I think is 1) wait until 64 bit version octave coming up 2) try to build octave by yourself with the help of the octave ML 3) use Linux OS, in which 64 bit octave work. (I don't know which distribution supports 64 bit octave ) 4) use Matlab-64. Regards Tatsuro --- Sven-Erik Tiberg wrote: > Hi > > Would like to try octave in a win 2008 R2 server with 48G/500G+ memory and 2Xquadcore > processors. > Any hint on how to install octave with optimum memory and cpu core support. > > BTW, run the servers as Remote desktop servers, and uses one for imageprocessing and the other > for more general calculations using Matlab 64-version and Comsol Multiphysics and a bit more. > > /Sven-Erik > > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Octave-dev mailing list > Octave-dev at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/octave-dev > -------------------------------------- GyaO! - Anime, Dramas, Movies, and Music videos [FREE] http://pr.mail.yahoo.co.jp/gyao/ From bpabbott at mac.com Fri Nov 13 17:01:33 2009 From: bpabbott at mac.com (Ben Abbott) Date: Fri, 13 Nov 2009 18:01:33 -0500 Subject: problem about plotting In-Reply-To: <4ACE1F54-3B2C-47A3-B57E-DAAE2E6F79AF@gmail.com> References: <3903B117-5795-42E6-A72D-F955B7169C97@gmail.com> <150002670706533996093647936974172217260-Webmail@me.com> <4ACE1F54-3B2C-47A3-B57E-DAAE2E6F79AF@gmail.com> Message-ID: On Nov 13, 2009, at 12:49 PM, Jerry Wu wrote: > > On Nov 13, 2009, at 6:07 AM, Ben Abbott wrote: > >> On Friday, November 13, 2009, at 04:33AM, "Jerry Wu" wrote: >>> Hi I have problem plotting the graph, >>> It shows me the message: >>> >>> octave-3.2.3:4> >>> multiplot> set palette file "-" binary record=64 using 1:2:3:4; >>> ^ >>> line 0: Gray scale not sorted in gradient. >>> >>> >>> I use: >>> Mac OS 10.5.8 >>> >>> GNU Octave, version 3.2.3 >>> Octave was configured for "i386-apple-darwin8.11.1". >>> >>> G N U P L O T >>> Version 4.2 patchlevel 6 >>> last modified Sep 2009 >>> System: Darwin 9.8.0 >>> >>> X11 - 2.3.2 >>> >>> So how can I fix the problem? >>> >>> Thanks a lot!!! >> >> Can you provide us with a simple example so that we may duplicate the problem? >> >> Ben > > > I use simple equations like > > x=0:90; > plot x = sin(x) > > or from the sample from octave "help plot" > > t = 0:0.1:6.3; > plot (t, cos(t), "-;cos(t);", t, sin(t), "+3;sin(t);"); > > Thanks. The first isn't proper octave syntax. Did you mean ... x = 0:90; plot (x, sin(x)) That works fine with no error. Your 2nd example also works. When you try these two examples do they produce the message below? >>> multiplot> set palette file "-" binary record=64 using 1:2:3:4; >>> ^ >>> line 0: Gray scale not sorted in gradient. >> Ben p.s. please bottom post so that other may follow along, and take care that you reply-all. Thanks! From alain.content at ulb.ac.be Sat Nov 14 02:52:50 2009 From: alain.content at ulb.ac.be (Alain Content) Date: Sat, 14 Nov 2009 09:52:50 +0100 Subject: plot & print Message-ID: <43B3E47A-BEB1-46D0-AFD1-103BEFBD4199@ulb.ac.be> This is most likely a very stupid beginner's question, but still : I use octave to generate geometrical objects, and need accurate control of their size in pixels. The way I do that is to plot a figure and then print it. For instance, to generate, say, a 500 pixel square : plot ([-1,-1,1,1,-1], [-1,1,1,-1,-1]) # a square print ("-dpng", "-S500,500", "sq.png") # generate file However, this method generates margins around the objects, and I can't find how to control the size of those margins (or suppress them). Alternatively, could one tell me how these margins are sized ? Thanks in advance, Alain From babelproofreader at gmail.com Sat Nov 14 09:37:12 2009 From: babelproofreader at gmail.com (babelproofreader) Date: Sat, 14 Nov 2009 07:37:12 -0800 (PST) Subject: Manipulate financial data Message-ID: <26351012.post@talk.nabble.com> I have foreign exchange data in csv format in the form of 687463866,EUR/USD,2009-01-25 17:00:09.000,1.295800,1.297000,D 687463950,EUR/USD,2009-01-25 17:00:34.000,1.295900,1.297100,D 687463961,EUR/USD,2009-01-25 17:00:36.000,1.295800,1.297000,D and what I would like to do is group the data into various time frames i.e. 1 min, 5 min, 1 hour etc with a view to creating candlestick charts and calculating various indicators, but I am not sure what would be the best approach to take. At the moment my only idea is to loop over the 3rd column of data and using if statements extract the relevant data from columns 4 and 5. However, due to the format of the date/time column I am not even sure if this would be possible. Any suggestions or references to relevant parts of the manual would be appreciated. -- View this message in context: http://old.nabble.com/Manipulate-financial-data-tp26351012p26351012.html Sent from the Octave - General mailing list archive at Nabble.com. From bpabbott at mac.com Sat Nov 14 12:10:52 2009 From: bpabbott at mac.com (Ben Abbott) Date: Sat, 14 Nov 2009 13:10:52 -0500 Subject: plot & print In-Reply-To: <43B3E47A-BEB1-46D0-AFD1-103BEFBD4199@ulb.ac.be> References: <43B3E47A-BEB1-46D0-AFD1-103BEFBD4199@ulb.ac.be> Message-ID: On Nov 14, 2009, at 3:52 AM, Alain Content wrote: > This is most likely a very stupid beginner's question, but still : > > I use octave to generate geometrical objects, and need accurate control of their size in pixels. > The way I do that is to plot a figure and then print it. > For instance, to generate, say, a 500 pixel square : > plot ([-1,-1,1,1,-1], [-1,1,1,-1,-1]) # a square > print ("-dpng", "-S500,500", "sq.png") # generate file > > However, this method generates margins around the objects, and I can't find how to control the size of those margins (or suppress them). > Alternatively, could one tell me how these margins are sized ? > > Thanks in advance, > Alain The graphics backend has had a lot of changes recently. If you are running version 3.2.x then you can have the axis box fill the figure by ... plot ([-1,-1,1,1,-1], [-1,1,1,-1,-1]) # a square set (gca, "position", [0 0 1 1]) print ("-dpng", "-S500,500", "sq.png") # generate file If you are running 3.0.x, I don't know how to do what you want. Ben From bpabbott at mac.com Sat Nov 14 13:38:49 2009 From: bpabbott at mac.com (Ben Abbott) Date: Sat, 14 Nov 2009 14:38:49 -0500 Subject: plot & print In-Reply-To: References: <43B3E47A-BEB1-46D0-AFD1-103BEFBD4199@ulb.ac.be> Message-ID: <44AF5C99-9892-4B27-A5CF-47D8E013DECC@mac.com> On Nov 14, 2009, at 1:44 PM, Alain Content wrote: > > On 14 nov. 2009, at 19:10, Ben Abbott wrote: > >> >> On Nov 14, 2009, at 3:52 AM, Alain Content wrote: >> >>> This is most likely a very stupid beginner's question, but still : >>> >>> I use octave to generate geometrical objects, and need accurate control of their size in pixels. >>> The way I do that is to plot a figure and then print it. >>> For instance, to generate, say, a 500 pixel square : >>> plot ([-1,-1,1,1,-1], [-1,1,1,-1,-1]) # a square >>> print ("-dpng", "-S500,500", "sq.png") # generate file >>> >>> However, this method generates margins around the objects, and I can't find how to control the size of those margins (or suppress them). >>> Alternatively, could one tell me how these margins are sized ? >>> >>> Thanks in advance, >>> Alain >> >> The graphics backend has had a lot of changes recently. If you are running version 3.2.x then you can have the axis box fill the figure by ... >> >> plot ([-1,-1,1,1,-1], [-1,1,1,-1,-1]) # a square >> set (gca, "position", [0 0 1 1]) >> print ("-dpng", "-S500,500", "sq.png") # generate file >> >> If you are running 3.0.x, I don't know how to do what you want. >> >> Ben > > I use 3.2.3. Brilliant ! > > Two comments though : > > 1. Shouldn't the Manual say (p 249) > position A vector specifying the position of the plot, **including** titles, axes and legend. > (note that I am neither a native English speaker nor a native computer speaker ;) > > 2. I believe there is a 1 pixel bug. Here is what I did > > axis( [-1 1 -1 1]) > hold on > set (gca, "position", [0 0 1 1]) > plot ([-1/2,-1/2,1/2,1/2,-1/2], [-1/2,1/2,1/2,-1/2,-1/2]) # a square > print("-S1000,1000", "e1.png") # the square should be 500 x 500 > print("-S20,20", "e1.png") # width/height difference made more visible > > Not crucial, obviously. > And thanks for the help, > Alain The manual has been getting quite a bit of work recently, but can always use more work. However, in this instance the "position" property does *not* include the titles, ticklabels, or axis labels. Thus the language "A vector specifying the position of the plot, excluding titles, axes and legend." is a proper description of what the axes "position" is intended to represent. Regarding the pixel bug. Octave uses gnuplot as its backend. The way you are using it, the intent is to produce nice vector plots. For good control over bitmap images, please review the commands below. image_viewer imfinfo imread imwrite image imagesc impulse imshow I'm not vary familiar with the image capabilities of Octave. However, there are others who are. So please follow up with more questions. Ben From alain.content at ulb.ac.be Sat Nov 14 12:44:54 2009 From: alain.content at ulb.ac.be (Alain Content) Date: Sat, 14 Nov 2009 19:44:54 +0100 Subject: plot & print In-Reply-To: References: <43B3E47A-BEB1-46D0-AFD1-103BEFBD4199@ulb.ac.be> Message-ID: On 14 nov. 2009, at 19:10, Ben Abbott wrote: > > On Nov 14, 2009, at 3:52 AM, Alain Content wrote: > >> This is most likely a very stupid beginner's question, but still : >> >> I use octave to generate geometrical objects, and need accurate control of their size in pixels. >> The way I do that is to plot a figure and then print it. >> For instance, to generate, say, a 500 pixel square : >> plot ([-1,-1,1,1,-1], [-1,1,1,-1,-1]) # a square >> print ("-dpng", "-S500,500", "sq.png") # generate file >> >> However, this method generates margins around the objects, and I can't find how to control the size of those margins (or suppress them). >> Alternatively, could one tell me how these margins are sized ? >> >> Thanks in advance, >> Alain > > The graphics backend has had a lot of changes recently. If you are running version 3.2.x then you can have the axis box fill the figure by ... > > plot ([-1,-1,1,1,-1], [-1,1,1,-1,-1]) # a square > set (gca, "position", [0 0 1 1]) > print ("-dpng", "-S500,500", "sq.png") # generate file > > If you are running 3.0.x, I don't know how to do what you want. > > Ben I use 3.2.3. Brilliant ! Two comments though : 1. Shouldn't the Manual say (p 249) position A vector specifying the position of the plot, **including** titles, axes and legend. (note that I am neither a native English speaker nor a native computer speaker ;) 2. I believe there is a 1 pixel bug. Here is what I did axis( [-1 1 -1 1]) hold on set (gca, "position", [0 0 1 1]) plot ([-1/2,-1/2,1/2,1/2,-1/2], [-1/2,1/2,1/2,-1/2,-1/2]) # a square print("-S1000,1000", "e1.png") # the square should be 500 x 500 print("-S20,20", "e1.png") # width/height difference mademore visible Not crucial, obviously. And thanks for the help, Alain -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091114/b19c0277/attachment.html From manfredi_carmine at yahoo.it Sun Nov 15 06:43:30 2009 From: manfredi_carmine at yahoo.it (c.man) Date: Sun, 15 Nov 2009 04:43:30 -0800 (PST) Subject: Best editor Message-ID: <26357802.post@talk.nabble.com> Hi, What is the best external editor ? I know that emacs is wonderful, but exust anothers external editor like emacs ? Thanks. bye -- View this message in context: http://old.nabble.com/Best-editor-tp26357802p26357802.html Sent from the Octave - General mailing list archive at Nabble.com. From wizzard028wise at gmail.com Sun Nov 15 06:59:44 2009 From: wizzard028wise at gmail.com (Dorian) Date: Sun, 15 Nov 2009 13:59:44 +0100 Subject: Best editor In-Reply-To: <26357802.post@talk.nabble.com> References: <26357802.post@talk.nabble.com> Message-ID: <674a602a0911150459l53aa56a9l2aa75b03ec7a10cb@mail.gmail.com> Go here http://en.wikipedia.org/wiki/Category:Linux_text_editors Read and use all of them depending on what you want to edit then come back to post the difference you found . Cheers Dorian On Sun, Nov 15, 2009 at 1:43 PM, c.man wrote: > > Hi, > What is the best external editor ? > I know that emacs is wonderful, but exust anothers external editor like > emacs ? > Thanks. > bye > > -- > View this message in context: > http://old.nabble.com/Best-editor-tp26357802p26357802.html > Sent from the Octave - General mailing list archive at Nabble.com. > > _______________________________________________ > Help-octave mailing list > Help-octave at octave.org > https://www-old.cae.wisc.edu/mailman/listinfo/help-octave > -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091115/3ef599ca/attachment.html From soren at hauberg.org Sun Nov 15 07:16:31 2009 From: soren at hauberg.org (=?ISO-8859-1?Q?S=F8ren?= Hauberg) Date: Sun, 15 Nov 2009 14:16:31 +0100 Subject: Best editor In-Reply-To: <26357802.post@talk.nabble.com> References: <26357802.post@talk.nabble.com> Message-ID: <1258290991.23873.44.camel@hauberg-laptop> Hi, s?n, 15 11 2009 kl. 04:43 -0800, skrev c.man: > What is the best external editor ? For some reason people tend to get very religious about their editors, so I don't think you'll get people to agree on which editor is the best. My impression is that 'emacs' is one of the editors with the best interface to Octave, though. Personally, I use 'gedit'; not because it is a magnificent editor, but because it is simple enough that a stupid guy like myself can figure it out. The best advice is probably just to try a few different editors, and see which one suits you the best, S?ren From manfredi_carmine at yahoo.it Sun Nov 15 08:53:08 2009 From: manfredi_carmine at yahoo.it (c.man) Date: Sun, 15 Nov 2009 06:53:08 -0800 (PST) Subject: Best editor In-Reply-To: <1258290991.23873.44.camel@hauberg-laptop> References: <26357802.post@talk.nabble.com> <1258290991.23873.44.camel@hauberg-laptop> Message-ID: <26359767.post@talk.nabble.com> ok. thanks. But gedit dont have autoidentation, so If I write: If a==2 the next line isn't identated automatically. I have used for seven years Matlab, so in Octave I would like find a similar editor for m-file But, until this moment only emacs is right. Exist anothers editor with similar features ? bye S?ren Hauberg wrote: > > Hi, > > s?n, 15 11 2009 kl. 04:43 -0800, skrev c.man: >> What is the best external editor ? > > For some reason people tend to get very religious about their editors, > so I don't think you'll get people to agree on which editor is the best. > My impression is that 'emacs' is one of the editors with the best > interface to Octave, though. > > Personally, I use 'gedit'; not because it is a magnificent editor, but > because it is simple enough that a stupid guy like myself can figure it > out. > > The best advice is probably just to try a few different editors, and see > which one suits you the best, > > S?ren > > _______________________________________________ > Help-octave mailing list > Help-octave at octave.org > https://www-old.cae.wisc.edu/mailman/listinfo/help-octave > > -- View this message in context: http://old.nabble.com/Best-editor-tp26357802p26359767.html Sent from the Octave - General mailing list archive at Nabble.com. From mngwright at yahoo.com Sun Nov 15 08:35:57 2009 From: mngwright at yahoo.com (Maynard Wright) Date: Sun, 15 Nov 2009 06:35:57 -0800 (PST) Subject: Best editor In-Reply-To: <1258290991.23873.44.camel@hauberg-laptop> Message-ID: <950765.85049.qm@web110706.mail.gq1.yahoo.com> I use Kate but, again, that's personal preference. Maynard --- On Sun, 11/15/09, S?ren Hauberg wrote: From: S?ren Hauberg Subject: Re: Best editor To: "c.man" Cc: help-octave at octave.org Date: Sunday, November 15, 2009, 5:16 AM Hi, s?n, 15 11 2009 kl. 04:43 -0800, skrev c.man: > What is the best external editor ? For some reason people tend to get very religious about their editors, so I don't think you'll get people to agree on which editor is the best. My impression is that 'emacs' is one of the editors with the best interface to Octave, though. Personally, I use 'gedit'; not because it is a magnificent editor, but because it is simple enough that a stupid guy like myself can figure it out. The best advice is probably just to try a few different editors, and see which one suits you the best, S?ren _______________________________________________ Help-octave mailing list Help-octave at octave.org https://www-old.cae.wisc.edu/mailman/listinfo/help-octave -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091115/2bd74215/attachment-0001.html From macy at sfo.com Sun Nov 15 10:06:47 2009 From: macy at sfo.com (macy at sfo.com) Date: Sun, 15 Nov 2009 08:06:47 -0800 (PST) Subject: Best editor In-Reply-To: <26359767.post@talk.nabble.com> References: <26357802.post@talk.nabble.com> <1258290991.23873.44.camel@hauberg-laptop> <26359767.post@talk.nabble.com> Message-ID: <1192.66.81.161.247.1258301207.squirrel@cp01.sfo.com> I've been very happy with Scilabs Sc1 color, auto indent, use it for C++, too it's small and fast and doesn't insinuate itself all through my OS When in a hurry, I even use it to open ?? files that may be binaries, not text just to quickly check. For me, it has the most intuitive UI I've found. > > ok. thanks. > But gedit dont have autoidentation, so If I write: > > If a==2 > > the next line isn't identated automatically. > I have used for seven years Matlab, so in Octave I would like find a > similar > editor for m-file > But, until this moment only emacs is right. > Exist anothers editor with similar features ? > > bye > > > S??ren Hauberg wrote: >> >> Hi, >> >> s??n, 15 11 2009 kl. 04:43 -0800, skrev c.man: >>> What is the best external editor ? >> >> For some reason people tend to get very religious about their editors, >> so I don't think you'll get people to agree on which editor is the best. >> My impression is that 'emacs' is one of the editors with the best >> interface to Octave, though. >> >> Personally, I use 'gedit'; not because it is a magnificent editor, but >> because it is simple enough that a stupid guy like myself can figure it >> out. >> >> The best advice is probably just to try a few different editors, and see >> which one suits you the best, >> >> S??ren From tlange at gwdg.de Sun Nov 15 11:16:28 2009 From: tlange at gwdg.de (tlange at gwdg.de) Date: Sun, 15 Nov 2009 18:16:28 +0100 (CET) Subject: Best editor In-Reply-To: <26357802.post@talk.nabble.com> References: <26357802.post@talk.nabble.com> Message-ID: <49685.84.132.135.136.1258305388.squirrel@mailbox.gwdg.de> As Maynard I like using Kate too, because it's easy to integrate a console in Kate's GUI and just sending e.g. marked script lines to it. Torsten > > Hi, > What is the best external editor ? > I know that emacs is wonderful, but exust anothers external editor like > emacs ? > Thanks. > bye > > -- > View this message in context: > http://old.nabble.com/Best-editor-tp26357802p26357802.html > Sent from the Octave - General mailing list archive at Nabble.com. > > _______________________________________________ > Help-octave mailing list > Help-octave at octave.org > https://www-old.cae.wisc.edu/mailman/listinfo/help-octave > From highegg at gmail.com Sun Nov 15 14:12:55 2009 From: highegg at gmail.com (Jaroslav Hajek) Date: Sun, 15 Nov 2009 21:12:55 +0100 Subject: Best editor In-Reply-To: <26359767.post@talk.nabble.com> References: <26357802.post@talk.nabble.com> <1258290991.23873.44.camel@hauberg-laptop> <26359767.post@talk.nabble.com> Message-ID: <69d8d540911151212g268d31a7ja5821fcdb915668a@mail.gmail.com> On Sun, Nov 15, 2009 at 3:53 PM, c.man wrote: > > ok. thanks. > But gedit dont have autoidentation, so If I write: > > If a==2 > > the next line isn't identated automatically. > I have used for seven years Matlab, so in Octave I would like find a > similar > editor for m-file > But, until this moment only emacs is right. > Exist anothers editor with similar features ? You can try ViM (www.vim.org). -- RNDr. Jaroslav Hajek computing expert & GNU Octave developer Aeronautical Research and Test Institute (VZLU) Prague, Czech Republic url: www.highegg.matfyz.cz -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091115/549d9da2/attachment.html From jordigh at gmail.com Sun Nov 15 14:50:55 2009 From: jordigh at gmail.com (=?UTF-8?Q?Jordi_Guti=C3=A9rrez_Hermoso?=) Date: Sun, 15 Nov 2009 14:50:55 -0600 Subject: Best editor In-Reply-To: <26357802.post@talk.nabble.com> References: <26357802.post@talk.nabble.com> Message-ID: <9543b3a40911151250t6c3461des257742381ceef494@mail.gmail.com> 2009/11/15 c.man : > What is the best external editor ? Have you let Emacs into your heart? Are you typing in its holy name? CAN YOU FEEL ITS GLORIUS LIGHT SHINING UPON YOU? From jordigh at gmail.com Sun Nov 15 15:02:26 2009 From: jordigh at gmail.com (=?UTF-8?Q?Jordi_Guti=C3=A9rrez_Hermoso?=) Date: Sun, 15 Nov 2009 15:02:26 -0600 Subject: Problem in installing octave-3.2.3 in Suse Linux 2.6.16.60-0.42.7 In-Reply-To: <508a30f80911121743u29394b2cq878a9e9d38f56c5a@mail.gmail.com> References: <508a30f80911121743u29394b2cq878a9e9d38f56c5a@mail.gmail.com> Message-ID: <9543b3a40911151302x5abb091alab5122aae311a1ee@mail.gmail.com> 2009/11/12 srini : > ../libcruft/libcruft.so: undefined reference to `csrot_' > ../libcruft/libcruft.so: undefined reference to `zdrot_' > collect2: ld returned 1 exit status > make[2]: *** [octave] Error 1 > make[2]: Leaving directory `/mnt/gpfs/usrpeople/srini/octave-3.2.3/src' > make[1]: *** [src] Error 2 > make[1]: Leaving directory `/mnt/gpfs/usrpeople/srini/octave-3.2.3' > make: *** [all] Error 2 > > Not sure what this means. Can anybody please help me out here? These are linker errors, and if I recall correctly, those are symbols from the Fortran library. Can you provide a few more details? How are you building Octave? Output from your config.log files might be useful. Also, someone in the list was recently attempting to build Octave for SuSE. Search the list archives; some suggestions were provided therein. From sergstesh at yahoo.com Sun Nov 15 16:43:03 2009 From: sergstesh at yahoo.com (Sergei Steshenko) Date: Sun, 15 Nov 2009 14:43:03 -0800 (PST) Subject: Best editor In-Reply-To: <26357802.post@talk.nabble.com> Message-ID: <23908.47651.qm@web112114.mail.gq1.yahoo.com> --- On Sun, 11/15/09, c.man wrote: > From: c.man > Subject: Best editor > To: help-octave at octave.org > Date: Sunday, November 15, 2009, 4:43 AM > > Hi, > What is the best external editor ? > I know that emacs is wonderful, but exust anothers external > editor like > emacs ? > Thanks. > bye > > -- I like 'NEdit' very much - was pleasantly surprised to learn its development continues. Kate/Kwrite of KDE fame are also fine. Regards, Sergei. From sergstesh at yahoo.com Sun Nov 15 19:10:52 2009 From: sergstesh at yahoo.com (Sergei Steshenko) Date: Sun, 15 Nov 2009 17:10:52 -0800 (PST) Subject: ARPACK vs (BLAS + LAPACK) - build question In-Reply-To: <49685.84.132.135.136.1258305388.squirrel@mailbox.gwdg.de> Message-ID: <452989.8446.qm@web112114.mail.gq1.yahoo.com> Hello All, ARPACK README file says: " The makefile is set up to build a self-contained library which includes the needed BLAS 1/2/3 and LAPACK routines. If you already have the BLAS and LAPACK libraries installed on your system you might want to change the definition of DIRS as indicated in the ARmake.inc file. ". So, when building ARPACK for Octave how do you guys build it - using the included into ARPACK BLAS + LAPACK routines or using independently built BLAS + LAPACK ? I build BLAS + LAPACK regardless; disk space is not an issue, i.e. if the chances athat ARPACK will function more correctly with included into the tarball BLAS + LAPACK routines are better, so be it. Thanks, Sergei. From jasonkrupert at yahoo.com Sun Nov 15 20:30:17 2009 From: jasonkrupert at yahoo.com (Jason Rupert) Date: Sun, 15 Nov 2009 18:30:17 -0800 (PST) Subject: Octave interface with R Message-ID: <837917.35926.qm@web56003.mail.re3.yahoo.com> I'm a pretty new R (http://www.r-project.org/) and Octave user on Windows, and I am impressed with the functionality offered by both. Often times this functionality seems unique by design. Recently I encountered a case where it would be very helpful to load some of the Octave frequency analysis capability into R, since there doesn't appear to be package that does some of the basic frequency analysis, e.g. bode, nyquist, etc. I looked "Ten Years of Octave ? Recent Developments and Plans for the Future" document: www.ci.tuwien.ac.at/Conferences/DSC-2003/Drafts/EatonRawlings.pdf That document discusses the desire to integrate Octave with R and R with Octave. On Windows I tried the code in that document, but it did not seems to work successfully. I also looked at the following R package: http://www.omegahat.org/ROctave/ Unfortunately that package was published in 2002, so it has been surpassed by several R and Octave releases. Current recommendations from the R forum are to attempt to transfer/transpose the necessary Octave code to R code. By any chance is there another alternative to help with interfacing Octave with R or vice versa? Thanks for any insights or feedback. From srinivasan.rajaraman at gmail.com Sun Nov 15 22:09:58 2009 From: srinivasan.rajaraman at gmail.com (srini) Date: Sun, 15 Nov 2009 23:09:58 -0500 Subject: Problem in installing octave-3.2.3 in Suse Linux 2.6.16.60-0.42.7 In-Reply-To: <9543b3a40911151958j3e36d88ch9322823f6bdf42e1@mail.gmail.com> References: <508a30f80911121743u29394b2cq878a9e9d38f56c5a@mail.gmail.com> <9543b3a40911151302x5abb091alab5122aae311a1ee@mail.gmail.com> <508a30f80911151831n4aeef06ds3d343c42a02c5aea@mail.gmail.com> <9543b3a40911151958j3e36d88ch9322823f6bdf42e1@mail.gmail.com> Message-ID: <508a30f80911152009k5a0ff44dv64c16f706e8e860a@mail.gmail.com> Please find the attached zip file of the config.log file. Regards, Srini 2009/11/15 Jordi Guti?rrez Hermoso > 009/11/15 srini : > > Attached is the output of the config.log file. I'd appreciate your help a > > lot. > > Please zip it and post it to the list so that others may help. > -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091115/82c1cabb/attachment-0001.html -------------- next part -------------- A non-text attachment was scrubbed... Name: config.zip Type: application/zip Size: 44327 bytes Desc: not available Url : https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091115/82c1cabb/attachment-0001.zip From olaf.till at uni-jena.de Mon Nov 16 02:13:12 2009 From: olaf.till at uni-jena.de (Olaf Till) Date: Mon, 16 Nov 2009 09:13:12 +0100 Subject: Octave interface with R In-Reply-To: <837917.35926.qm@web56003.mail.re3.yahoo.com> References: <837917.35926.qm@web56003.mail.re3.yahoo.com> Message-ID: <20091116081312.GA23076@olaf> On Sun, Nov 15, 2009 at 06:30:17PM -0800, Jason Rupert wrote: > ... > By any chance is there another alternative to help with interfacing > Octave with R or vice versa? Some time ago, I made some functions for private use to call some regression-analysis code of R from Octave. I have not the time now to recall to me each detail, but maybe you can get an introduction from them how to do similar things. Attached Octave functions: Ropen: start R with popen2 and return an "R-object" used by all other functions Rprintf: "printf" arbitrary strings to Rs commandline Rput: install an Octave matrix as a table in R Rflushin: flush Rs stdout, necessary before collecting output from R Rdisp: display a table in R Rget: collect some output from R in Octave Rlm: combine above functions to examine data with a linear model in R Rclose: quit R and close connection HTH, Olaf -------------- next part -------------- ## Copyright (C) 2008 Olaf Till ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 2 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program; if not, write to the Free Software ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA function Rclose (robj) Rprintf (robj, "quit ();\n"); pclose (robj.in); pclose (robj.out); waitpid (robj.pid); endfunction -------------- next part -------------- ## Copyright (C) 2008 Olaf Till ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 2 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program; if not, write to the Free Software ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA function Rdisp (robj, labels, s, varargin) if (labels) s = sprintf (s, varargin{:}); Rprintf (robj, "write.table (format (%s, digits = 16, scientific = TRUE), file = """", quote = FALSE, row.names = TRUE, col.names = FALSE)\n", s); else s = sprintf (s, varargin{:}); Rprintf (robj, "write.table (format (%s, digits = 16, scientific = TRUE), file = """", quote = FALSE, row.names = FALSE, col.names = FALSE)\n", s); endif endfunction -------------- next part -------------- ## Copyright (C) 2008 Olaf Till ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 2 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program; if not, write to the Free Software ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA function Rflushin (robj) Rprintf (robj, "flush (stdout ());\n"); fflush (robj.in); endfunction -------------- next part -------------- ## Copyright (C) 2008 Olaf Till ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 2 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program; if not, write to the Free Software ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA function ret = Rget (robj, labels, nr, nc) if (labels) ## if 'Intercept' comes last, we're at the loss ... later this ## should be changed to not increment nr here, but check for an ## intercept before in the model description string rc = 0; while (rc < nr) rc++; label = fscanf (robj.out, "%s", "C"); if (label(1) == "(") label = label(2:end); endif if (label(end) == ")") label = label(1:end - 1); endif ret.(label) = fscanf (robj.out, "%e", nc); if (strcmp (label, "Intercept")) nr++; endif endwhile else ret = fscanf (robj.out, "%e", [nc, nr])'; endif endfunction -------------- next part -------------- ## Copyright (C) 2008 Olaf Till ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 2 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program; if not, write to the Free Software ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA function ret = Rlm (robj, y, x, ylabel, xlabels, Rmodel, alpha) ## ret = Rlm (robj, y, x, ylabel, xlabels, Rmodel, alpha) y = y(:); if (isvector (x)) x = x(:); endif nc = size (x, 2); Rput (robj, cat (2, y, x), "lindata", \ cat (2, {{ylabel}{:}}, {xlabels{:}})); Rprintf (robj, "linmod <- lm (%s, lindata);\n", Rmodel); Rdisp (robj, 1, "confint (linmod, level = %.16e)", 1 - alpha); Rdisp (robj, 0, "coefficients (linmod)"); Rprintf (robj, "library (car)\n"); Rdisp (robj, 0, "linear.hypothesis (linmod, c (0, 1))$Pr[2]"); Rflushin (robj); ret = Rget (robj, 1, nc, 2); ret.coeffs = Rget (robj, 0, nc + 1, 1); % is only a special case!! ret.alpha = Rget (robj, 0, 1, 1); endfunction -------------- next part -------------- ## Copyright (C) 2008 Olaf Till ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 2 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program; if not, write to the Free Software ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA function robj = Ropen () [robj.in, robj.out, robj.pid] = \ popen2 ("R", char ("--vanilla", "--slave")); fcntl (robj.out, F_SETFL, O_SYNC); endfunction -------------- next part -------------- ## Copyright (C) 2008 Olaf Till ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 2 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program; if not, write to the Free Software ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA function Rprintf (robj, s, varargin) fprintf (robj.in, s, varargin{:}); endfunction -------------- next part -------------- ## Copyright (C) 2008 Olaf Till ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 2 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program; if not, write to the Free Software ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA function Rput (robj, X, varname, labels) [nr, nc] = size (X); if (nargin > 3) cnames = sprintf (", col.names = c (""%s""", labels{1}); for id = 2:length (labels) cnames = strcat (cnames, ", """, labels{id}, """"); endfor cnames = strcat (cnames, ")"); else cnames = ""; endif fprintf (robj.in, "%s <- read.table (file = stdin (), header = FALSE, nrows = %i%s)\n", varname, nr, cnames); template = sprintf ("%%.16e%s\n", repmat (" %.16e", 1, nc - 1)); fprintf (robj.in, template, X'); endfunction From lorenzotrojan at yahoo.it Mon Nov 16 07:18:41 2009 From: lorenzotrojan at yahoo.it (Lorenzo Trojan) Date: Mon, 16 Nov 2009 13:18:41 +0000 (GMT) Subject: R: Best editor In-Reply-To: <26357802.post@talk.nabble.com> Message-ID: <603899.80574.qm@web25408.mail.ukl.yahoo.com> hi sorry, but if you're satisfied with emacs why do you need another editor with similar features? I mean, i guess matlab editor works perfectly well with m-files cause it was written with that purpose in mind whereas no editor has been yet developed for octave files only. Anyway, I personally use gedit cause it is well integrated in gnome (tabs, filetype recognition, and it is easier to reach all the features than emacs I think). a bit annoying the lack of auto-indentation though... --- Dom 15/11/09, c.man ha scritto: > Da: c.man > Oggetto: Best editor > A: help-octave at octave.org > Data: Domenica 15 novembre 2009, 13:43 > > Hi, > What is the best external editor ? > I know that emacs is wonderful, but exust anothers external > editor like > emacs ? > Thanks. > bye > > -- > View this message in context: http://old.nabble.com/Best-editor-tp26357802p26357802.html > Sent from the Octave - General mailing list archive at > Nabble.com. > > _______________________________________________ > Help-octave mailing list > Help-octave at octave.org > https://www-old.cae.wisc.edu/mailman/listinfo/help-octave > From dotancohen at gmail.com Mon Nov 16 08:09:53 2009 From: dotancohen at gmail.com (Dotan Cohen) Date: Mon, 16 Nov 2009 16:09:53 +0200 Subject: R: Best editor In-Reply-To: <603899.80574.qm@web25408.mail.ukl.yahoo.com> References: <26357802.post@talk.nabble.com> <603899.80574.qm@web25408.mail.ukl.yahoo.com> Message-ID: <880dece00911160609t8913f72g546864f1aef6c35d@mail.gmail.com> 2009/11/16 Lorenzo Trojan : > hi > > sorry, but if you're satisfied with emacs why do you need another editor with similar features? I mean, i guess matlab editor works perfectly well with m-files cause it was written with that purpose in mind whereas no editor has been yet developed for octave files only. > > Anyway, I personally use gedit cause it is well integrated in gnome (tabs, filetype recognition, and it is easier to reach all the features than emacs I think). a bit annoying the lack of auto-indentation though... > Have you looked at Kate? It has auto-indent, and even a VI mode. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il From sergstesh at yahoo.com Mon Nov 16 17:47:04 2009 From: sergstesh at yahoo.com (Sergei Steshenko) Date: Mon, 16 Nov 2009 15:47:04 -0800 (PST) Subject: R: Best editor In-Reply-To: <880dece00911160609t8913f72g546864f1aef6c35d@mail.gmail.com> Message-ID: <213981.75361.qm@web112115.mail.gq1.yahoo.com> --- On Mon, 11/16/09, Dotan Cohen wrote: > From: Dotan Cohen > Subject: Re: R: Best editor > To: "Lorenzo Trojan" > Cc: help-octave at octave.org > Date: Monday, November 16, 2009, 6:09 AM > 2009/11/16 Lorenzo Trojan : > > hi > > > > sorry, but if you're satisfied with emacs why do you > need another editor with similar features? I mean, i guess > matlab editor works perfectly well with m-files cause it was > written with that purpose in mind whereas no editor has been > yet developed for octave files only. > > > > Anyway, I personally use gedit cause it is well > integrated in gnome (tabs, filetype recognition, and it is > easier to reach all the features than emacs I think). a bit > annoying the lack of auto-indentation though... > > > > Have you looked at Kate? It has auto-indent, and even a VI > mode. > > -- > Dotan Cohen > > http://what-is-what.com > http://gibberish.co.il > > _______________________________________________ Already mentioned NEdit also has auto-indent. Regards, Sergei. From jasonkrupert at yahoo.com Mon Nov 16 20:44:05 2009 From: jasonkrupert at yahoo.com (Jason Rupert) Date: Mon, 16 Nov 2009 18:44:05 -0800 (PST) Subject: Newbie Question: Launching Octave Control Systems Toolbox Message-ID: <834660.20128.qm@web56005.mail.re3.yahoo.com> I've looked through the GNU Octave manual, and tried simply typing the following: octave-3.2.3:1> DEMOcontrol error: `DEMOcontrol' undefined near line 1 column 1 I'm working on Mac OS X and installed Octave (octave-3.2.3-i386) on my machine from the source forge site via the dmg (http://octave.sourceforge.net/) What other steps do I need to take in order to be able to launch the Octave Control Systems Toolbox (OCST)? I thought I would simply have to type DEMOcontrol as mentioned in the GNU Octave manual, but that did not seem to work. Thank you for any insights or feedback. From lukas.reichlin at swissonline.ch Tue Nov 17 02:18:05 2009 From: lukas.reichlin at swissonline.ch (Lukas Reichlin) Date: Tue, 17 Nov 2009 09:18:05 +0100 Subject: Newbie Question: Launching Octave Control Systems Toolbox In-Reply-To: <834660.20128.qm@web56005.mail.re3.yahoo.com> References: <834660.20128.qm@web56005.mail.re3.yahoo.com> Message-ID: It looks like you didn't install OCST. Since Octave 3.2.0, the control package is not part of the "core" installation of Octave anymore. You need to install it separately as described in [1]. Launch Octave, use the "cd" command to switch to the directory where your downloaded package is, then type something like "pkg install control*". The latest release is control-1.0.17, you can get it by [2]. Regards Lukas [1] http://octave.sourceforge.net/ [2] http://octave.svn.sourceforge.net/viewvc/octave/trunk/octave-forge/main/control.tar.gz?view=tar > I've looked through the GNU Octave manual, and tried simply typing the following: > octave-3.2.3:1> DEMOcontrol > error: `DEMOcontrol' undefined near line 1 column 1 > > I'm working on Mac OS X and installed Octave (octave-3.2.3-i386) on my machine from the source forge site via the dmg (http://octave.sourceforge.net/) > > What other steps do I need to take in order to be able to launch the Octave Control Systems Toolbox (OCST)? I thought I would simply have to type DEMOcontrol as mentioned in the GNU Octave manual, but that did not seem to work. > > Thank you for any insights or feedback. > > > > _______________________________________________ > Help-octave mailing list > Help-octave at octave.org > https://www-old.cae.wisc.edu/mailman/listinfo/help-octave From tmacchant at yahoo.co.jp Tue Nov 17 02:39:39 2009 From: tmacchant at yahoo.co.jp (Tatsuro MATSUOKA) Date: Tue, 17 Nov 2009 17:39:39 +0900 (JST) Subject: Newbie Question: Launching Octave Control Systems Toolbox In-Reply-To: <834660.20128.qm@web56005.mail.re3.yahoo.com> Message-ID: <20091117083943.73920.qmail@web3807.mail.bbt.yahoo.co.jp> >From octave 3.2, ** The Control, Finance and Quaternion functions have been removed. These functions are now available as separate packages from http://octave.sourceforge.net/packages.html and can be reinstalled using the Octave package manager (see the pkg function). as in written in http://www.gnu.org/software/octave/NEWS-3.2.html You have to install the control package first. You can confirm whether it is installed or not by octave> pkg list If you do not find the control package, you have to install it by pkg install command. BTW, DEMOcontrol is not valid. It is octave:3> controldemo and you can see ************************** Octave Controls System Toolbox Demo [ 1] System representation [ 2] Block diagram manipulations [ 3] Frequency response functions [ 4] State space analysis functions [ 5] System model manipulations [ 6] Root locus functions [ 7] LQG/H2/Hinfinity functions [ 8] End pick a number, any number: ******************** Regards Tatsuro --- Jason Rupert wrote: > I've looked through the GNU Octave manual, and tried simply typing the following: > octave-3.2.3:1> DEMOcontrol > error: `DEMOcontrol' undefined near line 1 column 1 > > I'm working on Mac OS X and installed Octave (octave-3.2.3-i386) on my machine from the source > forge site via the dmg (http://octave.sourceforge.net/) > > What other steps do I need to take in order to be able to launch the Octave Control Systems > Toolbox (OCST)? I thought I would simply have to type DEMOcontrol as mentioned in the GNU > Octave manual, but that did not seem to work. > > Thank you for any insights or feedback. > > > > _______________________________________________ > Help-octave mailing list > Help-octave at octave.org > https://www-old.cae.wisc.edu/mailman/listinfo/help-octave > -------------------------------------- GyaO! - Anime, Dramas, Movies, and Music videos [FREE] http://pr.mail.yahoo.co.jp/gyao/ From lukasrohr at web.de Tue Nov 17 05:21:04 2009 From: lukasrohr at web.de (lrohr) Date: Tue, 17 Nov 2009 03:21:04 -0800 (PST) Subject: Different Behaviour matlab and octave Message-ID: <26388251.post@talk.nabble.com> Hi there, I'm using octave and matlab and try my code to be compatible ... Actually I wrote a small Sunposition calculater, which calculates the suns altitude and azimuth seen from a place on earth. So this is my code : function [solarAltitude,solarAzimuth] = sunposition (longitude,latitude) days = (1:365); minutes_a_day = (1:1440)'; D = days(ones(1440,1),days)-1; M = minutes_a_day(:,ones(365,1))-1; DM = D+(M./1440); % Position of the Earth, in rad, around the sun EP = 2*pi*(DM/365); % Sun Declination SD = 0.0068906 - 0.40589 *cos(EP+0.15882)-0.0068330*cos(2*EP+0.08901179)-0.0030788*cos(3*EP+1.8361); % hour Angle HA = (12-(M/60))*0.26180; % solar Altitude SALT = asin(cos(deg2rad(latitude))*(cos(HA).*cos(SD))+sin(deg2rad(latitude))*sin(SD)); % solar Azimuth SAZI = acos((sin(SALT)*sin(deg2rad(latitude))-sin(SD))./(cos(SALT)*cos(deg2rad(latitude)))); solarAltitude = rad2deg(SALT); solarAzimuth(1:720,:) = 180 - rad2deg(SAZI(1:720,:)); solarAzimuth(721:1440,:) = 180 + rad2deg(SAZI(721:1440,:)); end Just to explaine the first hard to understand lines : I used a Matrix with (minutes_a_day,days_a_year) size so it is (1440,365). The DM matrix starts with 0 and is added 1/1440 (one minute) per row down and 1 (day) per column to the right, so the value is corresponding to the time left behind in this year ... The longitude isn't needed yet (will implement the mean time later ... ) so to start the only thing you got to do is call : [alt,azi] = sunposition(0,49); where 49 is the 49? latitude. In the matlab/octave file I used the deg2rad and rad2deg functions which are simply function d=rad2deg(rad) d = (rad/(2*pi))*360; end function r=deg2rad(deg) r = (deg/360)*2*pi; end The altitude is the same in both matlab/octave and correct. So octave behaves just like I wanted to, the altitude is correct and the azimuth. But matlabs fails with the azimuth and I don't know why. I put in the screen shot of the plots of azimuth. octave does it right matlab doesn't. Does anyone find the reason why ? Here the octave plot : http://old.nabble.com/file/p26388251/octave_plot.png and the matlab plot : http://old.nabble.com/file/p26388251/matlab_plot.png -- View this message in context: http://old.nabble.com/Different-Behaviour-matlab-and-octave-tp26388251p26388251.html Sent from the Octave - General mailing list archive at Nabble.com. From andreas.kuntzagk at mdc-berlin.de Tue Nov 17 07:34:21 2009 From: andreas.kuntzagk at mdc-berlin.de (Andreas Kuntzagk) Date: Tue, 17 Nov 2009 14:34:21 +0100 Subject: Missing libmx.so Message-ID: <4B02A65D.1080606@mdc-berlin.de> Hi, I'm trying to run a matlab app with octave. When I do this i get some error: error: libmx.so: cannot open shared object file: No such file or directory error: called from: .m ... So do I need to install an additional lib? Do I need to set an option when building octave (I just set --enable-shared") or it what I want totally stupid and there is no way to run this matlab programm? regards, Andreas From individ at acc.umu.se Tue Nov 17 08:15:15 2009 From: individ at acc.umu.se (David Grundberg) Date: Tue, 17 Nov 2009 15:15:15 +0100 Subject: Missing libmx.so In-Reply-To: <4B02A65D.1080606@mdc-berlin.de> References: <4B02A65D.1080606@mdc-berlin.de> Message-ID: <4B02AFF3.4000308@acc.umu.se> Andreas Kuntzagk wrote: > Hi, > > I'm trying to run a matlab app with octave. When I do this i get some error: > > error: libmx.so: cannot open shared object file: No such file or directory > error: called from: .m > ... > > So do I need to install an additional lib? Do I need to set an option > when building octave (I just set --enable-shared") or it what I want > totally stupid and there is no way to run this matlab programm? > > regards, Andreas > _______________________________________________ > Help-octave mailing list > Help-octave at octave.org > https://www-old.cae.wisc.edu/mailman/listinfo/help-octave > Seems like you are trying to run mex files compiled for Matlab. They are binary files and cannot be loaded with Octave. There is a way round it though. If you have the source code for the mex files, you can recompile the mex-files to link against Octave. http://www.gnu.org/software/octave/doc/interpreter/Mex_002dFiles.html hth David From andreas.kuntzagk at mdc-berlin.de Tue Nov 17 11:45:04 2009 From: andreas.kuntzagk at mdc-berlin.de (Andreas Kuntzagk) Date: Tue, 17 Nov 2009 18:45:04 +0100 Subject: Missing libmx.so In-Reply-To: <4B02AFF3.4000308@acc.umu.se> References: <4B02A65D.1080606@mdc-berlin.de> <4B02AFF3.4000308@acc.umu.se> Message-ID: <4B02E120.7060003@mdc-berlin.de> Hey thanks, that took me some steps further. Now (after many problems I managed to solve myself) it complains about missing symbol mxErrMsgTxt when running the code. It does not complain when run mkoctfile --mex Do I need to link something? (sorry I'm not an matlab or octave expert) regards, Anddreas David Grundberg wrote: > Andreas Kuntzagk wrote: >> Hi, >> >> I'm trying to run a matlab app with octave. When I do this i get some >> error: >> >> error: libmx.so: cannot open shared object file: No such file or >> directory >> error: called from: .m >> ... >> >> So do I need to install an additional lib? Do I need to set an option >> when building octave (I just set --enable-shared") or it what I want >> totally stupid and there is no way to run this matlab programm? >> >> regards, Andreas >> _______________________________________________ >> Help-octave mailing list >> Help-octave at octave.org >> https://www-old.cae.wisc.edu/mailman/listinfo/help-octave >> > > Seems like you are trying to run mex files compiled for Matlab. They are > binary files and cannot be loaded with Octave. There is a way round it > though. If you have the source code for the mex files, you can recompile > the mex-files to link against Octave. > > http://www.gnu.org/software/octave/doc/interpreter/Mex_002dFiles.html > > hth > David From individ at acc.umu.se Tue Nov 17 14:58:41 2009 From: individ at acc.umu.se (David Grundberg) Date: Tue, 17 Nov 2009 21:58:41 +0100 Subject: Missing libmx.so In-Reply-To: <4B02E120.7060003@mdc-berlin.de> References: <4B02A65D.1080606@mdc-berlin.de> <4B02AFF3.4000308@acc.umu.se> <4B02E120.7060003@mdc-berlin.de> Message-ID: <4B030E81.7090809@acc.umu.se> It's hard to make out what the problem could be, especially since I don't have your source files. Send the complete error messages. Are you compiling with warnings enabled? What version are you running? Now for the standard library debugging: What does ldd mexfile say? What does nm mexfile | grep mxErrMsgTxt say? hth David Andreas Kuntzagk skrev: > Hey thanks, that took me some steps further. > > Now (after many problems I managed to solve myself) it complains about > missing symbol mxErrMsgTxt when running the code. It does not > complain when run mkoctfile --mex > > Do I need to link something? > > (sorry I'm not an matlab or octave expert) > > regards, Anddreas > > David Grundberg wrote: >> Andreas Kuntzagk wrote: >>> Hi, >>> >>> I'm trying to run a matlab app with octave. When I do this i get >>> some error: >>> >>> error: libmx.so: cannot open shared object file: No such file or >>> directory >>> error: called from: .m >>> ... >>> >>> So do I need to install an additional lib? Do I need to set an >>> option when building octave (I just set --enable-shared") or it what >>> I want totally stupid and there is no way to run this matlab programm? >>> >>> regards, Andreas >>> _______________________________________________ >>> Help-octave mailing list >>> Help-octave at octave.org >>> https://www-old.cae.wisc.edu/mailman/listinfo/help-octave >>> >> >> Seems like you are trying to run mex files compiled for Matlab. They >> are binary files and cannot be loaded with Octave. There is a way >> round it though. If you have the source code for the mex files, you >> can recompile the mex-files to link against Octave. >> >> http://www.gnu.org/software/octave/doc/interpreter/Mex_002dFiles.html >> >> hth >> David From jasonkrupert at yahoo.com Tue Nov 17 16:16:25 2009 From: jasonkrupert at yahoo.com (Jason Rupert) Date: Tue, 17 Nov 2009 14:16:25 -0800 (PST) Subject: Newbie Question: Launching Octave Control Systems Toolbox In-Reply-To: <20091117083943.73920.qmail@web3807.mail.bbt.yahoo.co.jp> References: <20091117083943.73920.qmail@web3807.mail.bbt.yahoo.co.jp> Message-ID: <70660.90329.qm@web56006.mail.re3.yahoo.com> Thank you very much. That is exactly what I was overlooking. Now, I've got the package loaded, but unfortunately the plot is not showing up. I'm still on a Mac, and running the following code: octave-3.2.3:30> L = tf(3e4 * [0.0025 0.1 1], [0.01 1.03 3.03 3.01 1]); octave-3.2.3:31> octave-3.2.3:31> bode(L) octave-3.2.3:32> octave-3.2.3:32> print('figure.ps', '-deps') I thought the bode plot would show up, but it didn't. However, figure.eps was produced and looks correct. Do I need to take one more newbie step in order to get the plot to show up? In installed GNU Plot: G N U P L O T Version 4.2 patchlevel 6 last modified Sep 2009 System: Darwin 9.8.0 Thanks for any feedback or insights. Jason ----- Original Message ---- From: Tatsuro MATSUOKA To: Jason Rupert ; Help-octave at octave.org Sent: Tue, November 17, 2009 2:39:39 AM Subject: Re: Newbie Question: Launching Octave Control Systems Toolbox >From octave 3.2, ** The Control, Finance and Quaternion functions have been removed. These functions are now available as separate packages from http://octave.sourceforge.net/packages.html and can be reinstalled using the Octave package manager (see the pkg function). as in written in http://www.gnu.org/software/octave/NEWS-3.2.html You have to install the control package first. You can confirm whether it is installed or not by octave> pkg list If you do not find the control package, you have to install it by pkg install command. BTW, DEMOcontrol is not valid. It is octave:3> controldemo and you can see ************************** Octave Controls System Toolbox Demo [ 1] System representation [ 2] Block diagram manipulations [ 3] Frequency response functions [ 4] State space analysis functions [ 5] System model manipulations [ 6] Root locus functions [ 7] LQG/H2/Hinfinity functions [ 8] End pick a number, any number: ******************** Regards Tatsuro --- Jason Rupert wrote: > I've looked through the GNU Octave manual, and tried simply typing the following: > octave-3.2.3:1> DEMOcontrol > error: `DEMOcontrol' undefined near line 1 column 1 > > I'm working on Mac OS X and installed Octave (octave-3.2.3-i386) on my machine from the source > forge site via the dmg (http://octave.sourceforge.net/) > > What other steps do I need to take in order to be able to launch the Octave Control Systems > Toolbox (OCST)? I thought I would simply have to type DEMOcontrol as mentioned in the GNU > Octave manual, but that did not seem to work. > > Thank you for any insights or feedback. > > > > _______________________________________________ > Help-octave mailing list > Help-octave at octave.org > https://www-old.cae.wisc.edu/mailman/listinfo/help-octave > -------------------------------------- GyaO! - Anime, Dramas, Movies, and Music videos [FREE] http://pr.mail.yahoo.co.jp/gyao/ From jwe at octave.org Tue Nov 17 16:50:16 2009 From: jwe at octave.org (John W. Eaton) Date: Tue, 17 Nov 2009 17:50:16 -0500 Subject: Missing libmx.so In-Reply-To: <4B02E120.7060003@mdc-berlin.de> References: <4B02A65D.1080606@mdc-berlin.de> <4B02AFF3.4000308@acc.umu.se> <4B02E120.7060003@mdc-berlin.de> Message-ID: <19203.10408.809299.460946@segfault.lan> On 17-Nov-2009, Andreas Kuntzagk wrote: | Hey thanks, that took me some steps further. | | Now (after many problems I managed to solve myself) it complains about | missing symbol mxErrMsgTxt when running the code. It does not complain | when run mkoctfile --mex Is it mxErrMsgTxt or mexErrMsgTxt? There is no mxErrMsgTxt function in Octave, or documented to be a part of Matlab, but there is a mexErrMsgTxt function. What version of Octave are you using? jwe From jasonkrupert at yahoo.com Tue Nov 17 16:51:26 2009 From: jasonkrupert at yahoo.com (Jason Rupert) Date: Tue, 17 Nov 2009 14:51:26 -0800 (PST) Subject: One more newbie question - getting the plot to show up In-Reply-To: <20091117083943.73920.qmail@web3807.mail.bbt.yahoo.co.jp> References: <20091117083943.73920.qmail@web3807.mail.bbt.yahoo.co.jp> Message-ID: <300559.29541.qm@web56003.mail.re3.yahoo.com> Thank you very much. I guess I was overlooking Octave's transition to packages. The following worked: octave-3.2.3:13> pkg install control-1.0.11.tar.gz I have one other newbie question - the following is not producing a plot that I can see: octave-3.2.3:30> L = tf(3e4 * [0.0025 0.1 1], [0.01 1.03 3.03 3.01 1]); octave-3.2.3:31> octave-3.2.3:31> bode(L) octave-3.2.3:32> octave-3.2.3:32> print('figure.ps', '-deps') The print successfully produces figure.ps that I can open, but evidently I've over looked another step in order to produce plots. I also tried the following: octave-3.2.3:27> x = -1:0.1:1; octave-3.2.3:28> plot (x, x.^2) Still the plot did not appear. I'm on a Mac and I did install GNU Plot: G N U P L O T Version 4.2 patchlevel 6 last modified Sep 2009 System: Darwin 9.8.0 Thanks for any additional feedback, as I suppose I am overlooking something. Jason ----- Original Message ---- From: Tatsuro MATSUOKA To: Jason Rupert ; Help-octave at octave.org Sent: Tue, November 17, 2009 2:39:39 AM Subject: Re: Newbie Question: Launching Octave Control Systems Toolbox >From octave 3.2, ** The Control, Finance and Quaternion functions have been removed. These functions are now available as separate packages from http://octave.sourceforge.net/packages.html and can be reinstalled using the Octave package manager (see the pkg function). as in written in http://www.gnu.org/software/octave/NEWS-3.2.html You have to install the control package first. You can confirm whether it is installed or not by octave> pkg list If you do not find the control package, you have to install it by pkg install command. BTW, DEMOcontrol is not valid. It is octave:3> controldemo and you can see ************************** Octave Controls System Toolbox Demo [ 1] System representation [ 2] Block diagram manipulations [ 3] Frequency response functions [ 4] State space analysis functions [ 5] System model manipulations [ 6] Root locus functions [ 7] LQG/H2/Hinfinity functions [ 8] End pick a number, any number: ******************** Regards Tatsuro --- Jason Rupert wrote: > I've looked through the GNU Octave manual, and tried simply typing the following: > octave-3.2.3:1> DEMOcontrol > error: `DEMOcontrol' undefined near line 1 column 1 > > I'm working on Mac OS X and installed Octave (octave-3.2.3-i386) on my machine from the source > forge site via the dmg (http://octave.sourceforge.net/) > > What other steps do I need to take in order to be able to launch the Octave Control Systems > Toolbox (OCST)? I thought I would simply have to type DEMOcontrol as mentioned in the GNU > Octave manual, but that did not seem to work. > > Thank you for any insights or feedback. > > > > _______________________________________________ > Help-octave mailing list > Help-octave at octave.org > https://www-old.cae.wisc.edu/mailman/listinfo/help-octave > -------------------------------------- GyaO! - Anime, Dramas, Movies, and Music videos [FREE] http://pr.mail.yahoo.co.jp/gyao/ From srinivasan.rajaraman at gmail.com Tue Nov 17 17:00:15 2009 From: srinivasan.rajaraman at gmail.com (srini) Date: Tue, 17 Nov 2009 18:00:15 -0500 Subject: Problem in installing octave-3.2.3 in Suse Linux 2.6.16.60-0.42.7 In-Reply-To: <508a30f80911152009k5a0ff44dv64c16f706e8e860a@mail.gmail.com> References: <508a30f80911121743u29394b2cq878a9e9d38f56c5a@mail.gmail.com> <9543b3a40911151302x5abb091alab5122aae311a1ee@mail.gmail.com> <508a30f80911151831n4aeef06ds3d343c42a02c5aea@mail.gmail.com> <9543b3a40911151958j3e36d88ch9322823f6bdf42e1@mail.gmail.com> <508a30f80911152009k5a0ff44dv64c16f706e8e860a@mail.gmail.com> Message-ID: <508a30f80911171500s62375582n323d8aa7070deb22@mail.gmail.com> Dear members, Could you find the problem with the attached config.log file? I am badly in need to install Octave-3.2.3 on Suse Linux 2.6.16.60-0.42.7 machine and start using it. You help would be highly appreciated. Regards, Srini On Sun, Nov 15, 2009 at 11:09 PM, srini wrote: > Please find the attached zip file of the config.log file. > > Regards, > Srini > > 2009/11/15 Jordi Guti?rrez Hermoso > >> 009/11/15 srini : >> >> > Attached is the output of the config.log file. I'd appreciate your help >> a >> > lot. >> >> Please zip it and post it to the list so that others may help. >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091117/ad5ec6af/attachment.html From bpabbott at mac.com Tue Nov 17 17:18:00 2009 From: bpabbott at mac.com (Ben Abbott) Date: Tue, 17 Nov 2009 18:18:00 -0500 Subject: One more newbie question - getting the plot to show up In-Reply-To: <300559.29541.qm@web56003.mail.re3.yahoo.com> References: <20091117083943.73920.qmail@web3807.mail.bbt.yahoo.co.jp> <300559.29541.qm@web56003.mail.re3.yahoo.com> Message-ID: On Nov 17, 2009, at 5:51 PM, Jason Rupert wrote: > Thank you very much. I guess I was overlooking Octave's transition to packages. > > The following worked: > octave-3.2.3:13> pkg install control-1.0.11.tar.gz > > > I have one other newbie question - the following is not producing a plot that I can see: > > octave-3.2.3:30> L = tf(3e4 * [0.0025 0.1 1], [0.01 1.03 3.03 3.01 1]); > octave-3.2.3:31> > octave-3.2.3:31> bode(L) > octave-3.2.3:32> > octave-3.2.3:32> print('figure.ps', '-deps') > > The print successfully produces figure.ps that I can open, but evidently I've over looked another step in order to produce plots. > > I also tried the following: > octave-3.2.3:27> x = -1:0.1:1; > octave-3.2.3:28> plot (x, x.^2) > > Still the plot did not appear. > > I'm on a Mac and I did install GNU Plot: > G N U P L O T > Version 4.2 patchlevel 6 > last modified Sep 2009 > System: Darwin 9.8.0 > > Thanks for any additional feedback, as I suppose I am overlooking something. > > Jason You're on Mac OSX correct? If you'd likt to use X11 to produce your plots, you need to set the environment variable GNUTERM=x11. This can be done in your shell's startup script, or you can do it in Octave by ... setenv ("GNUTERM", "x11") Alternatively, if you want to use Aquaterm to render you plots (which is the default for Mac OSX) you'll need to install it. Ben From etienne at isr.ist.utl.pt Tue Nov 17 20:27:31 2009 From: etienne at isr.ist.utl.pt (etienne at isr.ist.utl.pt) Date: Tue, 17 Nov 2009 18:27:31 -0800 Subject: R: Best editor In-Reply-To: <213981.75361.qm@web112115.mail.gq1.yahoo.com> References: <213981.75361.qm@web112115.mail.gq1.yahoo.com> Message-ID: <20091117182731.22345wa40lo3wpe8@webmail.isr.ist.utl.pt> Hi all, that's too common a question not to belong on the wiki. I added http://wiki.octave.org/wiki.pl?CodeEditorForOctave Feel free to edit. Cheers, Etienne Quoting Sergei Steshenko (Mon, 16 Nov 2009 15:47:04 -0800 (PST)): > > > --- On Mon, 11/16/09, Dotan Cohen wrote: > >> From: Dotan Cohen >> Subject: Re: R: Best editor >> To: "Lorenzo Trojan" >> Cc: help-octave at octave.org >> Date: Monday, November 16, 2009, 6:09 AM >> 2009/11/16 Lorenzo Trojan : >> > hi >> > >> > sorry, but if you're satisfied with emacs why do you >> need another editor with similar features? I mean, i guess >> matlab editor works perfectly well with m-files cause it was >> written with that purpose in mind whereas no editor has been >> yet developed for octave files only. >> > >> > Anyway, I personally use gedit cause it is well >> integrated in gnome (tabs, filetype recognition, and it is >> easier to reach all the features than emacs I think). a bit >> annoying the lack of auto-indentation though... >> > >> >> Have you looked at Kate? It has auto-indent, and even a VI >> mode. >> >> -- >> Dotan Cohen >> >> http://what-is-what.com >> http://gibberish.co.il >> >> _______________________________________________ > > > Already mentioned NEdit also has auto-indent. > > Regards, > Sergei. > > > > _______________________________________________ > Help-octave mailing list > Help-octave at octave.org > https://www-old.cae.wisc.edu/mailman/listinfo/help-octave > -- http://www.isr.ist.utl.pt/~etienne ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program. From jaugalde at gmail.com Tue Nov 17 23:37:13 2009 From: jaugalde at gmail.com (octaveUser) Date: Tue, 17 Nov 2009 21:37:13 -0800 (PST) Subject: plot orientation feature; plot filling page Message-ID: <26402803.post@talk.nabble.com> I'm trying to do something simple, print a file to a certain paper size and have the plot fill the whole page. In matlab this is done in the following way: >orient tall, will fill a portrait page, >orient ladscape will flip the plot 90degrees and fill the page. Octave prints with the plot only filling a box in the center of the page with large margins at the top and bottom. The plotting to pdf finally works great, it just seems like it would be really usefull to have the plot fill the page. I understand I have to interact with gnuplot to get this done. This is the number one feature request I have, a simple way to make a plot fill a page, and rotate the plot and have it fit the page. Was there an easy way to do this I missed. Thanks, octave is wonderful. -- View this message in context: http://old.nabble.com/plot-orientation-feature--plot-filling-page-tp26402803p26402803.html Sent from the Octave - General mailing list archive at Nabble.com. From andreas.kuntzagk at mdc-berlin.de Wed Nov 18 01:13:04 2009 From: andreas.kuntzagk at mdc-berlin.de (Andreas Kuntzagk) Date: Wed, 18 Nov 2009 08:13:04 +0100 Subject: Missing libmx.so In-Reply-To: <19203.10408.809299.460946@segfault.lan> References: <4B02A65D.1080606@mdc-berlin.de> <4B02AFF3.4000308@acc.umu.se> <4B02E120.7060003@mdc-berlin.de> <19203.10408.809299.460946@segfault.lan> Message-ID: <4B039E80.8090101@mdc-berlin.de> John W. Eaton wrote: > On 17-Nov-2009, Andreas Kuntzagk wrote: > > | Hey thanks, that took me some steps further. > | > | Now (after many problems I managed to solve myself) it complains about > | missing symbol mxErrMsgTxt when running the code. It does not complain > | when run mkoctfile --mex > > Is it mxErrMsgTxt or mexErrMsgTxt? There is no mxErrMsgTxt function > in Octave, or documented to be a part of Matlab, but there is a > mexErrMsgTxt function. The code really calls mxErrMsgTxt. I'll try to replace that with mexErrMsgTxt and see if it works then. > What version of Octave are you using? 3.2.3 Btw. I'd like to show you the code, but this is some really tangled mess of Matlab/Octave, cplex, shogun-toolbox, python and shell wrapper scripts. So I have a hard time figuring out where the errors come from and what to post here for diagnosis. Looking deeper into the code I find it's in some places calling mexErrMsgTxt as well. So maybe this was just a typo that was not noticed since the part of the code did not get called. regards, Andreas From matthias at brennwald.org Wed Nov 18 01:30:11 2009 From: matthias at brennwald.org (Matthias Brennwald) Date: Wed, 18 Nov 2009 08:30:11 +0100 Subject: Octave crashing Message-ID: Dear all I upgraded to Octave 3.2.3. If I try to start Octave, the following happens: -------------- wut-brennwald:matGSOD brennmat$ octave GNU Octave, version 3.2.3 Copyright (C) 2009 John W. Eaton and others. This is free software; see the source code for copying conditions. There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For details, type `warranty'. Octave was configured for "i386-apple-darwin9.8.0". Additional information about Octave is available at http://www.octave.org . Please contribute if you find this software useful. For more information, visit http://www.octave.org/help-wanted.html Report bugs to (but first, please read http://www.octave.org/bugs.html to learn how to write a helpful report). For information about changes from previous versions, type `news'. panic: impossible state reached in file `load-path.cc' at line 657 panic: Abort trap -- stopping myself... attempting to save variables to `octave-core'... save to `octave-core' complete Abort trap -------------- This is on an Intel-Mac with Mac OS X 10.5. Octave was installed and compiled through MacPorts. Any ideas what might be wrong and what to do? Matthias From matthias.brennwald at eawag.ch Wed Nov 18 01:22:12 2009 From: matthias.brennwald at eawag.ch (Matthias Brennwald) Date: Wed, 18 Nov 2009 08:22:12 +0100 Subject: Octave crashing Message-ID: <073173F6-E188-4F68-B949-6262FA549F8F@eawag.ch> Dear all I upgraded to Octave 3.2.3. If I try to start Octave, the following happens: -------------- wut-brennwald:matGSOD brennmat$ octave GNU Octave, version 3.2.3 Copyright (C) 2009 John W. Eaton and others. This is free software; see the source code for copying conditions. There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For details, type `warranty'. Octave was configured for "i386-apple-darwin9.8.0". Additional information about Octave is available at http://www.octave.org . Please contribute if you find this software useful. For more information, visit http://www.octave.org/help-wanted.html Report bugs to (but first, please read http://www.octave.org/bugs.html to learn how to write a helpful report). For information about changes from previous versions, type `news'. panic: impossible state reached in file `load-path.cc' at line 657 panic: Abort trap -- stopping myself... attempting to save variables to `octave-core'... save to `octave-core' complete Abort trap -------------- This is on an Intel-Mac with Mac OS X 10.5, Octave was installed and compiled through MacPorts. Any ideas what might be wrong and what to do? Matthias ---- Matthias Brennwald Eawag, CH-8600 D?bendorf Office Eawag BU-C08: +41 44 823 53 05 Lab Eawag LA-C76: +41 44 823 53 06 Lab ETHZ CLA A31.6: +41 632 09 36/39 matthias.brennwald at eawag.ch From wizzard028wise at gmail.com Wed Nov 18 02:21:24 2009 From: wizzard028wise at gmail.com (Dorian) Date: Wed, 18 Nov 2009 09:21:24 +0100 Subject: R: Best editor In-Reply-To: <20091117182731.22345wa40lo3wpe8@webmail.isr.ist.utl.pt> References: <213981.75361.qm@web112115.mail.gq1.yahoo.com> <20091117182731.22345wa40lo3wpe8@webmail.isr.ist.utl.pt> Message-ID: <674a602a0911180021h5616700ej2a2aaca1c4b51b50@mail.gmail.com> Could u just link this more descriptive wiki http://en.wikipedia.org/wiki/Category:Linux_text_editors Dorian On Wed, Nov 18, 2009 at 3:27 AM, wrote: > > Hi all, > > that's too common a question not to belong on the wiki. I added > > http://wiki.octave.org/wiki.pl?CodeEditorForOctave > > Feel free to edit. > > Cheers, > > Etienne > > Quoting Sergei Steshenko (Mon, 16 Nov 2009 > 15:47:04 -0800 (PST)): > > > > > > > --- On Mon, 11/16/09, Dotan Cohen wrote: > > > >> From: Dotan Cohen > >> Subject: Re: R: Best editor > >> To: "Lorenzo Trojan" > >> Cc: help-octave at octave.org > >> Date: Monday, November 16, 2009, 6:09 AM > >> 2009/11/16 Lorenzo Trojan : > >> > hi > >> > > >> > sorry, but if you're satisfied with emacs why do you > >> need another editor with similar features? I mean, i guess > >> matlab editor works perfectly well with m-files cause it was > >> written with that purpose in mind whereas no editor has been > >> yet developed for octave files only. > >> > > >> > Anyway, I personally use gedit cause it is well > >> integrated in gnome (tabs, filetype recognition, and it is > >> easier to reach all the features than emacs I think). a bit > >> annoying the lack of auto-indentation though... > >> > > >> > >> Have you looked at Kate? It has auto-indent, and even a VI > >> mode. > >> > >> -- > >> Dotan Cohen > >> > >> http://what-is-what.com > >> http://gibberish.co.il > >> > >> _______________________________________________ > > > > > > Already mentioned NEdit also has auto-indent. > > > > Regards, > > Sergei. > > > > > > > > _______________________________________________ > > Help-octave mailing list > > Help-octave at octave.org > > https://www-old.cae.wisc.edu/mailman/listinfo/help-octave > > > > > > -- > http://www.isr.ist.utl.pt/~etienne > > ---------------------------------------------------------------- > This message was sent using IMP, the Internet Messaging Program. > > _______________________________________________ > Help-octave mailing list > Help-octave at octave.org > https://www-old.cae.wisc.edu/mailman/listinfo/help-octave > -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091118/16c2cc66/attachment.html From dotancohen at gmail.com Wed Nov 18 06:50:33 2009 From: dotancohen at gmail.com (Dotan Cohen) Date: Wed, 18 Nov 2009 14:50:33 +0200 Subject: PIV processing Message-ID: <880dece00911180450s73500a7dl4f37331109dbb15c@mail.gmail.com> We are currently using Matlab for processing PIV images with the MatPIV toolbox. This toolbox depends on the Image Processing Toolbox. Will Octave be able to work with MatPIV? Does Octave have an equivalent to the Image Processing Toolbox? Thanks in advance. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il From bpabbott at mac.com Wed Nov 18 06:52:50 2009 From: bpabbott at mac.com (Ben Abbott) Date: Wed, 18 Nov 2009 07:52:50 -0500 Subject: plot orientation feature; plot filling page In-Reply-To: <26402803.post@talk.nabble.com> References: <26402803.post@talk.nabble.com> Message-ID: <9D48700F-D0D1-4453-A015-BDA1FDC6B978@mac.com> On Nov 18, 2009, at 12:37 AM, octaveUser wrote: > I'm trying to do something simple, print a file to a certain paper size and > have the plot fill the whole page. In matlab this is done in the following > way: >orient tall, will fill a portrait page, >orient ladscape will flip the > plot 90degrees and fill the page. Octave prints with the plot only filling > a box in the center of the page with large margins at the top and bottom. > The plotting to pdf finally works great, it just seems like it would be > really usefull to have the plot fill the page. I understand I have to > interact with gnuplot to get this done. This is the number one feature > request I have, a simple way to make a plot fill a page, and rotate the plot > and have it fit the page. Was there an easy way to do this I missed. Thanks, > octave is wonderful. Currently Octave's orient() function does not recognize the "tall" option, and the "landscape", "portrait" options do not flip the "papersize" (1x2) vector. So there are both a missing feature and a bug. To do what you want, # equivalent to "orient tall" papersize = get (gcf, "papersize"); # presently the paper units must be inches border = 0.25; set (gcf, "paperposition", [border, border, (papersize - 2*border)]) # To change orientation orientation = get (gcf, "paperorientation"); papersize = get (gcf, "papersize"); paperposition = get (gcf, "paperposition"); set (gcf, "paperposition", paperposition([2, 1, 4, 3]); set (gcf, "papersize", papersize ([2, 1]); set (gcf, "paperorientation", setdiff ({"landscape", "portrait"}, orientation); I'll prepare a changeset today. Ben From carlo.defalco at gmail.com Wed Nov 18 07:02:23 2009 From: carlo.defalco at gmail.com (Carlo de Falco) Date: Wed, 18 Nov 2009 14:02:23 +0100 Subject: PIV processing In-Reply-To: <880dece00911180450s73500a7dl4f37331109dbb15c@mail.gmail.com> References: <880dece00911180450s73500a7dl4f37331109dbb15c@mail.gmail.com> Message-ID: <4330BBA8-7947-4382-B251-935337D75234@gmail.com> On 18 Nov 2009, at 13:50, Dotan Cohen wrote: > We are currently using Matlab for processing PIV images with the > MatPIV toolbox. This toolbox depends on the Image Processing Toolbox. > Will Octave be able to work with MatPIV? I don't know MatPIV so I cannot comment on this part. > Does Octave have an > equivalent to the Image Processing Toolbox? Thanks in advance. "Toolboxes" are referred to as "packages" in Octave parlance. Many Octave packages are distributed through the Octave-Forge web-site: http://octave.sourceforge.net there is a collection of image processing functions in the "image" package: http://octave.sourceforge.net/image/index.html > -- > Dotan Cohen HTH, c. From bpabbott at mac.com Wed Nov 18 07:02:23 2009 From: bpabbott at mac.com (Ben Abbott) Date: Wed, 18 Nov 2009 08:02:23 -0500 Subject: Octave crashing In-Reply-To: <073173F6-E188-4F68-B949-6262FA549F8F@eawag.ch> References: <073173F6-E188-4F68-B949-6262FA549F8F@eawag.ch> Message-ID: <69121BA5-97FC-47F9-9892-FBFD1A486787@mac.com> On Nov 18, 2009, at 2:22 AM, Matthias Brennwald wrote: > Dear all > > I upgraded to Octave 3.2.3. If I try to start Octave, the following > happens: > > -------------- > wut-brennwald:matGSOD brennmat$ octave > GNU Octave, version 3.2.3 > Copyright (C) 2009 John W. Eaton and others. > This is free software; see the source code for copying conditions. > There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or > FITNESS FOR A PARTICULAR PURPOSE. For details, type `warranty'. > > Octave was configured for "i386-apple-darwin9.8.0". > > Additional information about Octave is available at http://www.octave.org > . > > Please contribute if you find this software useful. > For more information, visit http://www.octave.org/help-wanted.html > > Report bugs to (but first, please read > http://www.octave.org/bugs.html to learn how to write a helpful report). > > For information about changes from previous versions, type `news'. > > panic: impossible state reached in file `load-path.cc' at line 657 > panic: Abort trap -- stopping myself... > attempting to save variables to `octave-core'... > save to `octave-core' complete > Abort trap > -------------- > > This is on an Intel-Mac with Mac OS X 10.5, Octave was installed and > compiled through MacPorts. Any ideas what might be wrong and what to do? > > Matthias I am running Octave 3.2.3 via OctaveForge on an Intel based mac, and am running MacPorts ppc version on both G4 and G5 based macs. I suspect the problem will be MacPorts port-file. I'll try updating my MacPorts Octave to 3.2.3 and report back later. Ben From lukasrohr at web.de Wed Nov 18 07:27:07 2009 From: lukasrohr at web.de (lrohr) Date: Wed, 18 Nov 2009 05:27:07 -0800 (PST) Subject: Different Behaviour matlab and octave In-Reply-To: <26388251.post@talk.nabble.com> References: <26388251.post@talk.nabble.com> Message-ID: <26407710.post@talk.nabble.com> lrohr wrote: > > Does anyone find the reason why ? > Still I don't know why matlab does it diffrent, but I found out something interesting ... size(azi) ans = 1440 365 so i ploted the following plot(1:1440,azi) http://old.nabble.com/file/p26407710/matlab2.png So the calculations have been correct, just the question why Matlabs plots it different when you don't typ in the x-axes ( 1:1440) and just with the azi Matrix and not with the alt Matrix even both sizes are the same ... -- View this message in context: http://old.nabble.com/Different-Behaviour-matlab-and-octave-tp26388251p26407710.html Sent from the Octave - General mailing list archive at Nabble.com. From pleser at sup-logistik.de Wed Nov 18 04:06:13 2009 From: pleser at sup-logistik.de (Philipp Leser) Date: Wed, 18 Nov 2009 11:06:13 +0100 Subject: calling octave from C Message-ID: <0EA9662A402E6A4B88078E93D7F20D7B78472D@x346-001w2k3.sup2000.sup-logistik.de> Hey; I try to get the following done: - I have a very large C program, which extracts data from an Oracle data base - I want to pass some of the data to octave - use my own octave function on that data -pass it back to my C routine.... I tried to use google and the octave manual. I don't think that mex files or oct files are the right tools to do that ( I want to call Octave from within a c-file). I have found quite a body of information how MATLAB handles these tasks (http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_external/f 15075.html) Can this be done in Octave too? Are there any counterparts in octave to the matlab engPutvariable, engEvalstring and similar functions? Any hints/links how to handle the problem would be welcome. Thank you very much in advance regards -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091118/1bce5998/attachment.html From Sven-Erik.Tiberg at ltu.se Wed Nov 18 09:39:10 2009 From: Sven-Erik.Tiberg at ltu.se (Sven-Erik Tiberg) Date: Wed, 18 Nov 2009 16:39:10 +0100 Subject: PIV processing In-Reply-To: <4330BBA8-7947-4382-B251-935337D75234@gmail.com> Message-ID: <610858C4350B6C4693B7D1AE08074D2ACCBDB990CD@VERA.personal.adp.ltu.se> Just a note. When we made a PIV processing system back in 90-93 se: http://www.springerlink.com/content/t912840551063848/, we uses to ( after some imgage processing / frame ) set each frame to a colour. The colours made it easier to visually track motion in the wather. Used NIH-Image to track position of relevant particles ( size and shape criteria ) and saved as cvs-files. In next step we used a matlab similar program called IGOR to track path of particles and plot velocity with arrows. In case anyone are interested I can send the scripts. Sven-Erik Tiberg Lulea Univ. Of technology Sweden -----Original Message----- From: Carlo de Falco [mailto:carlo.defalco at gmail.com] Sent: den 18 november 2009 14:02 To: Dotan Cohen Cc: Octave Subject: Re: PIV processing On 18 Nov 2009, at 13:50, Dotan Cohen wrote: > We are currently using Matlab for processing PIV images with the > MatPIV toolbox. This toolbox depends on the Image Processing Toolbox. > Will Octave be able to work with MatPIV? I don't know MatPIV so I cannot comment on this part. > Does Octave have an > equivalent to the Image Processing Toolbox? Thanks in advance. "Toolboxes" are referred to as "packages" in Octave parlance. Many Octave packages are distributed through the Octave-Forge web-site: http://octave.sourceforge.net there is a collection of image processing functions in the "image" package: http://octave.sourceforge.net/image/index.html > -- > Dotan Cohen HTH, c. _______________________________________________ Help-octave mailing list Help-octave at octave.org https://www-old.cae.wisc.edu/mailman/listinfo/help-octave From highegg at gmail.com Wed Nov 18 10:42:45 2009 From: highegg at gmail.com (Jaroslav Hajek) Date: Wed, 18 Nov 2009 17:42:45 +0100 Subject: calling octave from C In-Reply-To: <0EA9662A402E6A4B88078E93D7F20D7B78472D@x346-001w2k3.sup2000.sup-logistik.de> References: <0EA9662A402E6A4B88078E93D7F20D7B78472D@x346-001w2k3.sup2000.sup-logistik.de> Message-ID: <69d8d540911180842keb467b5wfabe7e3a0829c4b2@mail.gmail.com> On Wed, Nov 18, 2009 at 11:06 AM, Philipp Leser wrote: > Hey; > > I try to get the following done: > > - I have a very large C program, which extracts data from an Oracle data > base > > - I want to pass some of the data to octave > > - use my own octave function on that data > > -pass it back to my C routine?. > > > > I tried to use google and the octave manual. I don?t think that mex files > or oct files are the right tools to do that ( I want to call Octave from > within a c-file). I have found quite a body of information how MATLAB > handles these tasks ( > http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_external/f15075.html > ) > > > > Can this be done in Octave too? Are there any counterparts in octave to the > matlab engPutvariable, engEvalstring and similar functions? > > Any hints/links how to handle the problem would be welcome. > > Thank you very much in advance > > regards > Octave can be embedded in C++ applications relatively easily. A basic example is in the manual under "Dynamically Linked Functions/Standalone Programs". Native embedding interfaces are also available, for instance for Python: https://launchpad.net/pytave/ another option is to simply launch Octave as an external process and communicate through pipes. -- RNDr. Jaroslav Hajek computing expert & GNU Octave developer Aeronautical Research and Test Institute (VZLU) Prague, Czech Republic url: www.highegg.matfyz.cz -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091118/04fbf23e/attachment.html From storrsjm at email.uc.edu Wed Nov 18 12:57:48 2009 From: storrsjm at email.uc.edu (Judd Storrs) Date: Wed, 18 Nov 2009 13:57:48 -0500 Subject: Different Behaviour matlab and octave In-Reply-To: <26407710.post@talk.nabble.com> References: <26388251.post@talk.nabble.com> <26407710.post@talk.nabble.com> Message-ID: On my machine azi and alt have small but non-zero complex parts in matlab but not in octave 3.2.2. You can check this with max(abs(imag(azi(:)))) Removing the complex part of the data in matlab produces plots that are similar to octave-3.2.2. plot(real(azi)) plot(real(alt)) A build of the octave development sources a couple of weeks ago on 10/28 produce complex results similar to matlab's. --judd From jwe at octave.org Wed Nov 18 13:03:35 2009 From: jwe at octave.org (John W. Eaton) Date: Wed, 18 Nov 2009 14:03:35 -0500 Subject: calling octave from C In-Reply-To: <69d8d540911180842keb467b5wfabe7e3a0829c4b2@mail.gmail.com> References: <0EA9662A402E6A4B88078E93D7F20D7B78472D@x346-001w2k3.sup2000.sup-logistik.de> <69d8d540911180842keb467b5wfabe7e3a0829c4b2@mail.gmail.com> Message-ID: <19204.17671.959294.725312@segfault.lan> On 18-Nov-2009, Jaroslav Hajek wrote: | On Wed, Nov 18, 2009 at 11:06 AM, Philipp Leser wrote: | | > Hey; | > | > I try to get the following done: | > | > - I have a very large C program, which extracts data from an Oracle data | > base | > | > - I want to pass some of the data to octave | > | > - use my own octave function on that data | > | > -pass it back to my C routine$,1s&(B. | > | > | > | > I tried to use google and the octave manual. I don$,1ry(Bt think that mex files | > or oct files are the right tools to do that ( I want to call Octave from | > within a c-file). I have found quite a body of information how MATLAB | > handles these tasks ( | > http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_external/f15075.html | > ) | > | > | > | > Can this be done in Octave too? Are there any counterparts in octave to the | > matlab engPutvariable, engEvalstring and similar functions? | > | > Any hints/links how to handle the problem would be welcome. | > | > Thank you very much in advance | > | > regards | > | | Octave can be embedded in C++ applications relatively easily. A basic | example is in the manual under "Dynamically Linked Functions/Standalone | Programs". | Native embedding interfaces are also available, for instance for Python: | https://launchpad.net/pytave/ Please also remember that if you embed Octave, your program is subject to the terms of the GNU GPL. Philipp, is your program be free software? jwe From storrsjm at email.uc.edu Wed Nov 18 13:09:30 2009 From: storrsjm at email.uc.edu (Judd Storrs) Date: Wed, 18 Nov 2009 14:09:30 -0500 Subject: Different Behaviour matlab and octave In-Reply-To: References: <26388251.post@talk.nabble.com> <26407710.post@talk.nabble.com> Message-ID: Digging a little deeper, it seems that acos() differs between matlab and octave-3.2.2 but compatibility has been improved in the development version. acos(1.1) produces NaN in octave-3.2.2 but produces a complex result in matlab and the development version. --judd From jwe at octave.org Wed Nov 18 13:13:13 2009 From: jwe at octave.org (John W. Eaton) Date: Wed, 18 Nov 2009 14:13:13 -0500 Subject: Octave crashing In-Reply-To: References: Message-ID: <19204.18249.576566.588595@segfault.lan> On 18-Nov-2009, Matthias Brennwald wrote: | I upgraded to Octave 3.2.3. If I try to start Octave, the following | happens: | | -------------- | wut-brennwald:matGSOD brennmat$ octave | GNU Octave, version 3.2.3 | Copyright (C) 2009 John W. Eaton and others. | This is free software; see the source code for copying conditions. | There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or | FITNESS FOR A PARTICULAR PURPOSE. For details, type `warranty'. | | Octave was configured for "i386-apple-darwin9.8.0". | | Additional information about Octave is available at http://www.octave.org | . | | Please contribute if you find this software useful. | For more information, visit http://www.octave.org/help-wanted.html | | Report bugs to (but first, please read | http://www.octave.org/bugs.html to learn how to write a helpful report). | | For information about changes from previous versions, type `news'. | | panic: impossible state reached in file `load-path.cc' at line 657 | panic: Abort trap -- stopping myself... | attempting to save variables to `octave-core'... | save to `octave-core' complete | Abort trap | -------------- | | This is on an Intel-Mac with Mac OS X 10.5. Octave was installed and | compiled through MacPorts. Any ideas what might be wrong and what to do? Does this happen regardless of which directory you are in when you start Octave? Is there a PKG_ADD or .octaverc file in the directory where you are starting Octave? If so, what is in those files? Also, it's best to report bugs to the bug at octave.org list. jwe From dotancohen at gmail.com Wed Nov 18 14:12:18 2009 From: dotancohen at gmail.com (Dotan Cohen) Date: Wed, 18 Nov 2009 22:12:18 +0200 Subject: PIV processing In-Reply-To: <610858C4350B6C4693B7D1AE08074D2ACCBDB990CD@VERA.personal.adp.ltu.se> References: <4330BBA8-7947-4382-B251-935337D75234@gmail.com> <610858C4350B6C4693B7D1AE08074D2ACCBDB990CD@VERA.personal.adp.ltu.se> Message-ID: <880dece00911181212u7677a9aare20c8e8855524e08@mail.gmail.com> > When we made a PIV processing system back in 90-93 se: http://www.springerlink.com/content/t912840551063848/, > we uses to ( after some imgage processing / frame ) set each frame to a colour. > The colours made it easier to visually track motion in the wather. > How did using different colours for each frame help? Different colour particles maybe, but different coloured frames in post-processing? > Used NIH-Image to track position of relevant particles ( size and shape criteria ) and saved as cvs-files. > In next step we used a matlab similar program called IGOR to track path of particles and plot velocity with arrows. > You were using particles of differing size and shape? I find that interesting, how do you know the different shapes were accurately modelling the flow of the water? In our case we are working with viscoplastic materials. > In case anyone are interested I can send the scripts. > I am very interested. Thanks! Anything else that you would like to tell would be interesting, I am new to the field and just starting to get a handle on it. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il From sergstesh at yahoo.com Wed Nov 18 16:18:07 2009 From: sergstesh at yahoo.com (Sergei Steshenko) Date: Wed, 18 Nov 2009 14:18:07 -0800 (PST) Subject: ARPACK vs (BLAS + LAPACK) - build question Message-ID: <733817.98622.qm@web112109.mail.gq1.yahoo.com> --- On Sun, 11/15/09, Sergei Steshenko wrote: > From: Sergei Steshenko > Subject: ARPACK vs (BLAS + LAPACK) - build question > To: help-octave at octave.org > Date: Sunday, November 15, 2009, 5:10 PM > Hello All, > > ARPACK README file says: > > " > ???The makefile is set up to build a > self-contained library which includes > ???the needed BLAS 1/2/3 and LAPACK > routines.? If you already have the > ???BLAS and LAPACK libraries installed on > your system you might want to > ???change the definition of DIRS as > indicated in the ARmake.inc file. > ". > > So, when building ARPACK for Octave how do you guys build > it - using > the included into ARPACK BLAS + LAPACK routines or using > independently > built BLAS + LAPACK ? > > I build BLAS + LAPACK regardless; disk space is not an > issue, i.e. if > the chances athat ARPACK will function more correctly with > included into > the tarball BLAS + LAPACK routines are better, so be it. > > Thanks, > ? Sergei. > Bump. From individ at acc.umu.se Wed Nov 18 16:17:13 2009 From: individ at acc.umu.se (David Grundberg) Date: Wed, 18 Nov 2009 23:17:13 +0100 Subject: calling octave from C In-Reply-To: <19204.17671.959294.725312@segfault.lan> References: <0EA9662A402E6A4B88078E93D7F20D7B78472D@x346-001w2k3.sup2000.sup-logistik.de> <69d8d540911180842keb467b5wfabe7e3a0829c4b2@mail.gmail.com> <19204.17671.959294.725312@segfault.lan> Message-ID: <4B047269.3000606@acc.umu.se> John W. Eaton skrev: > On 18-Nov-2009, Jaroslav Hajek wrote: > > | On Wed, Nov 18, 2009 at 11:06 AM, Philipp Leser wrote: > | > | > Hey; > | > > | > I try to get the following done: > | > > | > - I have a very large C program, which extracts data from an Oracle data > | > base > | > > | > - I want to pass some of the data to octave > | > > | > - use my own octave function on that data > | > > | > -pass it back to my C routine$,1s&?. > | > > | > > | > > | > I tried to use google and the octave manual. I don$,1ry?t think that mex files > | > or oct files are the right tools to do that ( I want to call Octave from > | > within a c-file). I have found quite a body of information how MATLAB > | > handles these tasks ( > | > http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_external/f15075.html > | > ) > | > > | > > | > > | > Can this be done in Octave too? Are there any counterparts in octave to the > | > matlab engPutvariable, engEvalstring and similar functions? > | > > | > Any hints/links how to handle the problem would be welcome. > | > > | > Thank you very much in advance > | > > | > regards > | > > | > | Octave can be embedded in C++ applications relatively easily. A basic > | example is in the manual under "Dynamically Linked Functions/Standalone > | Programs". > | Native embedding interfaces are also available, for instance for Python: > | https://launchpad.net/pytave/ > > Please also remember that if you embed Octave, your program is subject > to the terms of the GNU GPL. Philipp, is your program be free > software? > > jwe I just want to add that any script importing Pytave must be licensed under GNU GPLv3, since its linked to Pytave (and other GPL software as Octave). Pytave isn't a proprietary loop-hole, to be concise. Regards, David From storrsjm at email.uc.edu Wed Nov 18 16:52:34 2009 From: storrsjm at email.uc.edu (Judd Storrs) Date: Wed, 18 Nov 2009 17:52:34 -0500 Subject: calling octave from C In-Reply-To: <4B047269.3000606@acc.umu.se> References: <0EA9662A402E6A4B88078E93D7F20D7B78472D@x346-001w2k3.sup2000.sup-logistik.de> <69d8d540911180842keb467b5wfabe7e3a0829c4b2@mail.gmail.com> <19204.17671.959294.725312@segfault.lan> <4B047269.3000606@acc.umu.se> Message-ID: On Wed, Nov 18, 2009 at 5:17 PM, David Grundberg wrote: > I just want to add that any script importing Pytave must be licensed > under GNU GPLv3, since its linked to Pytave (and other GPL software as > Octave). Pytave isn't a proprietary loop-hole, to be concise. Well, that sucks considering the AFNI python scripts are GPLv2. Guess I get to keep it to myself. --judd From storrsjm at email.uc.edu Wed Nov 18 16:57:52 2009 From: storrsjm at email.uc.edu (Judd Storrs) Date: Wed, 18 Nov 2009 17:57:52 -0500 Subject: calling octave from C In-Reply-To: References: <0EA9662A402E6A4B88078E93D7F20D7B78472D@x346-001w2k3.sup2000.sup-logistik.de> <69d8d540911180842keb467b5wfabe7e3a0829c4b2@mail.gmail.com> <19204.17671.959294.725312@segfault.lan> <4B047269.3000606@acc.umu.se> Message-ID: On Wed, Nov 18, 2009 at 5:52 PM, Judd Storrs wrote: > On Wed, Nov 18, 2009 at 5:17 PM, David Grundberg wrote: >> I just want to add that any script importing Pytave must be licensed >> under GNU GPLv3, since its linked to Pytave (and other GPL software as >> Octave). Pytave isn't a proprietary loop-hole, to be concise. > > Well, that sucks considering the AFNI python scripts are GPLv2. Guess > I get to keep it to myself. Perhaps I was a little hasty here. Are you saying you can only use GPLv3 licensed m-files with pytave? --judd From storrsjm at email.uc.edu Wed Nov 18 17:13:18 2009 From: storrsjm at email.uc.edu (Judd Storrs) Date: Wed, 18 Nov 2009 18:13:18 -0500 Subject: calling octave from C In-Reply-To: References: <0EA9662A402E6A4B88078E93D7F20D7B78472D@x346-001w2k3.sup2000.sup-logistik.de> <69d8d540911180842keb467b5wfabe7e3a0829c4b2@mail.gmail.com> <19204.17671.959294.725312@segfault.lan> <4B047269.3000606@acc.umu.se> Message-ID: Ok. I think you are overreaching by claiming that python scripts must be GPLv3 as a result of using pytave. 1) Octave is an interpreter. The GPLv3 license does not apply to interpreter input. e.g. m-files can be any license without violating the interpreter's license. 2) python + pytave is also an interpreter. In order to distribute a python + pytave interpreter, all components of the interpreter must be GPLv3 compatible. 3) Python scripts are also interpreter input. They are equivalent to m-files. --judd From matthias at brennwald.org Thu Nov 19 00:51:56 2009 From: matthias at brennwald.org (Matthias Brennwald) Date: Thu, 19 Nov 2009 07:51:56 +0100 Subject: Octave crashing In-Reply-To: <19204.18249.576566.588595@segfault.lan> References: <19204.18249.576566.588595@segfault.lan> Message-ID: <420590EA-EC05-4696-9148-84E4C464DA0A@brennwald.org> On Nov 18, 2009, at 8:13 PM, John W. Eaton wrote: > On 18-Nov-2009, Matthias Brennwald wrote: > > | I upgraded to Octave 3.2.3. If I try to start Octave, the following > | happens: > | > | -------------- > | wut-brennwald:matGSOD brennmat$ octave > | GNU Octave, version 3.2.3 > | Copyright (C) 2009 John W. Eaton and others. > | This is free software; see the source code for copying conditions. > | There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or > | FITNESS FOR A PARTICULAR PURPOSE. For details, type `warranty'. > | > | Octave was configured for "i386-apple-darwin9.8.0". > | > | Additional information about Octave is available at http://www.octave.org > | . > | > | Please contribute if you find this software useful. > | For more information, visit http://www.octave.org/help-wanted.html > | > | Report bugs to (but first, please read > | http://www.octave.org/bugs.html to learn how to write a helpful > report). > | > | For information about changes from previous versions, type `news'. > | > | panic: impossible state reached in file `load-path.cc' at line 657 > | panic: Abort trap -- stopping myself... > | attempting to save variables to `octave-core'... > | save to `octave-core' complete > | Abort trap > | -------------- > | > | This is on an Intel-Mac with Mac OS X 10.5. Octave was installed and > | compiled through MacPorts. Any ideas what might be wrong and what > to do? > > Does this happen regardless of which directory you are in when you > start Octave? As a matter of fact, it does not happen anymore... I have no idea why the problem is gone now. As far as I can tell I did not change anything. I tried running from different directories, but could not reproduce the error. > Is there a PKG_ADD or .octaverc file in the directory where you are > starting Octave? If so, what is in those files? Yes, I do have an .octaverc file in my home directory. Here it is: --------------------- %%%% warning on Octave:matlab-incompatible % warn if using code that %%%% won't work with Matlab (it won't catch everything, though). addpath ('~/Matlab/') addpath ('~/Matlab/mcompartments/code') addpath ('~/Matlab/mcompartments/examples/example1') addpath ('~/Matlab/mcompartments/examples/example2') addpath ('~/Matlab/mcompartments/examples/example3') addpath ('~/Matlab/mataa/mataa_tools/') addpath ('~/Matlab/mataa/mataa_scripts/') addpath ('~/Matlab/matchromat/') addpath ('~/Matlab/matchromat/machines/') addpath ('~/Matlab/matchromat/machines/ANTRAWA/') addpath ('~/Matlab/cal_bottles/') addpath ('~/Matlab/matGSOD/'); addpath ('~/Matlab/m_map/'); addpath ('~/Matlab/m_map/private/'); --------------------- > Also, it's best to report bugs to the bug at octave.org list. Yes, sure, but I am not sure it this really is a bug in Octave (it might just as well be me or some other software package on the machine). Matthias ---- Matthias Brennwald, K?ferholzstrasse 173, CH-8046 Z?rich, +41 44 364 17 03 From jwe at octave.org Thu Nov 19 01:10:11 2009 From: jwe at octave.org (John W. Eaton) Date: Thu, 19 Nov 2009 02:10:11 -0500 Subject: Octave crashing In-Reply-To: <420590EA-EC05-4696-9148-84E4C464DA0A@brennwald.org> References: <19204.18249.576566.588595@segfault.lan> <420590EA-EC05-4696-9148-84E4C464DA0A@brennwald.org> Message-ID: <19204.61267.902966.32946@segfault.lan> On 19-Nov-2009, Matthias Brennwald wrote: | As a matter of fact, it does not happen anymore... I have no idea why | the problem is gone now. As far as I can tell I did not change | anything. I tried running from different directories, but could not | reproduce the error. | | > Is there a PKG_ADD or .octaverc file in the directory where you are | > starting Octave? If so, what is in those files? | | Yes, I do have an .octaverc file in my home directory. Here it is: | | --------------------- | %%%% warning on Octave:matlab-incompatible % warn if using code that | %%%% won't work with Matlab (it won't catch everything, though). | addpath ('~/Matlab/') | addpath ('~/Matlab/mcompartments/code') | addpath ('~/Matlab/mcompartments/examples/example1') | addpath ('~/Matlab/mcompartments/examples/example2') | addpath ('~/Matlab/mcompartments/examples/example3') | addpath ('~/Matlab/mataa/mataa_tools/') | addpath ('~/Matlab/mataa/mataa_scripts/') | addpath ('~/Matlab/matchromat/') | addpath ('~/Matlab/matchromat/machines/') | addpath ('~/Matlab/matchromat/machines/ANTRAWA/') | addpath ('~/Matlab/cal_bottles/') | addpath ('~/Matlab/matGSOD/'); | addpath ('~/Matlab/m_map/'); | addpath ('~/Matlab/m_map/private/'); | --------------------- Your problem has the same symptoms as https://www-old.cae.wisc.edu/pipermail/bug-octave/2009-August/009350.html Did you have a pkg command somewhere in a startup file when Octave crashed? In any case, I can't duplicate the problem linked above. | > Also, it's best to report bugs to the bug at octave.org list. | | Yes, sure, but I am not sure it this really is a bug in Octave (it | might just as well be me or some other software package on the machine). The bug reporting guide says If you are not sure whether you have found a bug, here are some guidelines: * If Octave gets a fatal signal, for any input whatever, that is a bug. Reliable interpreters never crash. jwe From individ at acc.umu.se Thu Nov 19 01:34:27 2009 From: individ at acc.umu.se (David Grundberg) Date: Thu, 19 Nov 2009 08:34:27 +0100 Subject: Pytave licensing (was: Re: calling octave from C) In-Reply-To: References: <0EA9662A402E6A4B88078E93D7F20D7B78472D@x346-001w2k3.sup2000.sup-logistik.de> <69d8d540911180842keb467b5wfabe7e3a0829c4b2@mail.gmail.com> <19204.17671.959294.725312@segfault.lan> <4B047269.3000606@acc.umu.se> Message-ID: <4B04F503.3060202@acc.umu.se> Judd Storrs wrote: > Ok. I think you are overreaching by claiming that python scripts must > be GPLv3 as a result of using pytave. > > 1) Octave is an interpreter. The GPLv3 license does not apply to > interpreter input. e.g. m-files can be any license without violating > the interpreter's license. > > 2) python + pytave is also an interpreter. In order to distribute a > python + pytave interpreter, all components of the interpreter must be > GPLv3 compatible. > > 3) Python scripts are also interpreter input. They are equivalent to m-files. > > > --judd > Yes, I think Python + Octave must be distributed under the terms of GPLv3. I think its unnecessary to discuss Octave at all. Pytave is licensed under GPLv3 on its own, and it doesn't matter what libraries it in turn uses. Since Pytave consists of Python code and is GPLv3, any other Python script that uses Pytave is a derivate work of Pytave. You could turn the argument around and say that it's OK to take GPL'd m-files from Octave and distribute them with proprietary m-files. I think that is not the case. David From ustaudinger at gmail.com Thu Nov 19 01:46:31 2009 From: ustaudinger at gmail.com (Ulrich Staudinger) Date: Thu, 19 Nov 2009 08:46:31 +0100 Subject: Pytave licensing (was: Re: calling octave from C) In-Reply-To: <4B04F503.3060202@acc.umu.se> References: <0EA9662A402E6A4B88078E93D7F20D7B78472D@x346-001w2k3.sup2000.sup-logistik.de> <69d8d540911180842keb467b5wfabe7e3a0829c4b2@mail.gmail.com> <19204.17671.959294.725312@segfault.lan> <4B047269.3000606@acc.umu.se> <4B04F503.3060202@acc.umu.se> Message-ID: <65daf6a60911182346s57f831dbw74e5e75adcac05a9@mail.gmail.com> Hello, On Thu, Nov 19, 2009 at 8:34 AM, David Grundberg wrote: > Judd Storrs wrote: > > 1) Octave is an interpreter. The GPLv3 license does not apply to > > interpreter input. e.g. m-files can be any license without violating > > the interpreter's license. > > > > 2) python + pytave is also an interpreter. In order to distribute a > > python + pytave interpreter, all components of the interpreter must be > > GPLv3 compatible. > > > > 3) Python scripts are also interpreter input. They are equivalent to > m-files. > > Yes, I think Python + Octave must be distributed under the terms of GPLv3. > > I think its unnecessary to discuss Octave at all. Pytave is licensed > under GPLv3 on its own, and it doesn't matter what libraries it in turn > uses. Since Pytave consists of Python code and is GPLv3, any other > Python script that uses Pytave is a derivate work of Pytave. > > You could turn the argument around and say that it's OK to take GPL'd > m-files from Octave and distribute them with proprietary m-files. I > think that is not the case. > > .. am dropping in here a bit. If i remember correctly, whether a software has to be distributed as GPL or not depends on the distribution bundle. As an example, although GCC is GPL software, applications that require GCC during compilation do not have to be GPLed. However, as soon as you distribute a software that uses GCC internally to compile something, this software should be GPLed. The usual work around is, user installs and provides GCC or python to the "other" application and configures the "other" application, by pointing to the gcc or python compiler. Doing so, unbundles the GPL software from the proprietary software and frees the distributor of proprietary software from the necessity to disclose his source code. Correct ? Ulrich -- Ulrich B. Staudinger -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091119/9e521d13/attachment.html From individ at acc.umu.se Thu Nov 19 01:59:28 2009 From: individ at acc.umu.se (David Grundberg) Date: Thu, 19 Nov 2009 08:59:28 +0100 Subject: Pytave licensing In-Reply-To: <65daf6a60911182346s57f831dbw74e5e75adcac05a9@mail.gmail.com> References: <0EA9662A402E6A4B88078E93D7F20D7B78472D@x346-001w2k3.sup2000.sup-logistik.de> <69d8d540911180842keb467b5wfabe7e3a0829c4b2@mail.gmail.com> <19204.17671.959294.725312@segfault.lan> <4B047269.3000606@acc.umu.se> <4B04F503.3060202@acc.umu.se> <65daf6a60911182346s57f831dbw74e5e75adcac05a9@mail.gmail.com> Message-ID: <4B04FAE0.4070503@acc.umu.se> Ulrich Staudinger wrote: > Hello, > > > On Thu, Nov 19, 2009 at 8:34 AM, David Grundberg > wrote: > > Judd Storrs wrote: > > 1) Octave is an interpreter. The GPLv3 license does not apply to > > interpreter input. e.g. m-files can be any license without violating > > the interpreter's license. > > > > 2) python + pytave is also an interpreter. In order to distribute a > > python + pytave interpreter, all components of the interpreter > must be > > GPLv3 compatible. > > > > 3) Python scripts are also interpreter input. They are > equivalent to m-files. > > Yes, I think Python + Octave must be distributed under the terms > of GPLv3. > > I think its unnecessary to discuss Octave at all. Pytave is licensed > under GPLv3 on its own, and it doesn't matter what libraries it in > turn > uses. Since Pytave consists of Python code and is GPLv3, any other > Python script that uses Pytave is a derivate work of Pytave. > > You could turn the argument around and say that it's OK to take GPL'd > m-files from Octave and distribute them with proprietary m-files. I > think that is not the case. > > > > .. am dropping in here a bit. If i remember correctly, whether a > software has to be distributed as GPL or not depends on the > distribution bundle. > > As an example, although GCC is GPL software, applications that require > GCC during compilation do not have to be GPLed. > > However, as soon as you distribute a software that uses GCC internally > to compile something, this software should be GPLed. > > The usual work around is, user installs and provides GCC or python to > the "other" application and configures the "other" application, by > pointing to the gcc or python compiler. Doing so, unbundles the GPL > software from the proprietary software and frees the distributor of > proprietary software from the necessity to disclose his source code. > > Correct ? > > Ulrich > > I argue that you cannot distribute Pytave with proprietary Python scripts. I don't think it is interesting to discuss GCC, since it is A) not Pytave and B) GCC has special exception clauses (i.e. its not vanilla GNU GPL). David From soren at hauberg.org Thu Nov 19 02:10:06 2009 From: soren at hauberg.org (=?ISO-8859-1?Q?S=F8ren?= Hauberg) Date: Thu, 19 Nov 2009 09:10:06 +0100 Subject: Pytave licensing (was: Re: calling octave from C) In-Reply-To: <4B04F503.3060202@acc.umu.se> References: <0EA9662A402E6A4B88078E93D7F20D7B78472D@x346-001w2k3.sup2000.sup-logistik.de> <69d8d540911180842keb467b5wfabe7e3a0829c4b2@mail.gmail.com> <19204.17671.959294.725312@segfault.lan> <4B047269.3000606@acc.umu.se> <4B04F503.3060202@acc.umu.se> Message-ID: <1258618206.2867.92.camel@hauberg-laptop> tor, 19 11 2009 kl. 08:34 +0100, skrev David Grundberg: > I think its unnecessary to discuss Octave at all. Pytave is licensed > under GPLv3 on its own, and it doesn't matter what libraries it in turn > uses. Since Pytave consists of Python code and is GPLv3, any other > Python script that uses Pytave is a derivate work of Pytave. I don't think you can make license requirements about _scripts_. See, http://www.gnu.org/licenses/gpl-faq.html#IfInterpreterIsGPL S?ren From individ at acc.umu.se Thu Nov 19 02:25:05 2009 From: individ at acc.umu.se (David Grundberg) Date: Thu, 19 Nov 2009 09:25:05 +0100 Subject: Pytave licensing In-Reply-To: <1258618206.2867.92.camel@hauberg-laptop> References: <0EA9662A402E6A4B88078E93D7F20D7B78472D@x346-001w2k3.sup2000.sup-logistik.de> <69d8d540911180842keb467b5wfabe7e3a0829c4b2@mail.gmail.com> <19204.17671.959294.725312@segfault.lan> <4B047269.3000606@acc.umu.se> <4B04F503.3060202@acc.umu.se> <1258618206.2867.92.camel@hauberg-laptop> Message-ID: <4B0500E1.1030302@acc.umu.se> S?ren Hauberg wrote: > tor, 19 11 2009 kl. 08:34 +0100, skrev David Grundberg: > >> I think its unnecessary to discuss Octave at all. Pytave is licensed >> under GPLv3 on its own, and it doesn't matter what libraries it in turn >> uses. Since Pytave consists of Python code and is GPLv3, any other >> Python script that uses Pytave is a derivate work of Pytave. >> > > I don't think you can make license requirements about _scripts_. See, > > http://www.gnu.org/licenses/gpl-faq.html#IfInterpreterIsGPL > > S?ren > I've read it all but I don't see how it is an argument against my statement. In fact, FSF argues for my statement. See the last paragraph: "A consequence is that if you choose to use GPL'd Perl modules or Java classes in your program, you must release the program in a GPL-compatible way, regardless of the license used in the Perl or Java interpreter that the combined Perl or Java program will run on." Perl modules or Java classes are analogous to Python modules. If you use GPL Python modules, you must release the program in a GPL-compatible way. David From ustaudinger at gmail.com Thu Nov 19 02:52:40 2009 From: ustaudinger at gmail.com (Ulrich Staudinger) Date: Thu, 19 Nov 2009 09:52:40 +0100 Subject: Pytave licensing In-Reply-To: <4B0500E1.1030302@acc.umu.se> References: <0EA9662A402E6A4B88078E93D7F20D7B78472D@x346-001w2k3.sup2000.sup-logistik.de> <69d8d540911180842keb467b5wfabe7e3a0829c4b2@mail.gmail.com> <19204.17671.959294.725312@segfault.lan> <4B047269.3000606@acc.umu.se> <4B04F503.3060202@acc.umu.se> <1258618206.2867.92.camel@hauberg-laptop> <4B0500E1.1030302@acc.umu.se> Message-ID: <65daf6a60911190052j55e565fct500d5b295200f709@mail.gmail.com> On Thu, Nov 19, 2009 at 9:25 AM, David Grundberg wrote: > S?ren Hauberg wrote: > > tor, 19 11 2009 kl. 08:34 +0100, skrev David Grundberg: > > > >> I think its unnecessary to discuss Octave at all. Pytave is licensed > >> under GPLv3 on its own, and it doesn't matter what libraries it in turn > >> uses. Since Pytave consists of Python code and is GPLv3, any other > >> Python script that uses Pytave is a derivate work of Pytave. > >> > > > > I don't think you can make license requirements about _scripts_. See, > > > > http://www.gnu.org/licenses/gpl-faq.html#IfInterpreterIsGPL > > > > S?ren > > > > I've read it all but I don't see how it is an argument against my > statement. In fact, FSF argues for my statement. See the last paragraph: > > "A consequence is that if you choose to use GPL'd Perl modules or Java > classes in your program, you must release the program in a > GPL-compatible way, regardless of the license used in the Perl or Java > interpreter that the combined Perl or Java program will run on." > > Perl modules or Java classes are analogous to Python modules. If you use > GPL Python modules, you must release the program in a GPL-compatible way. > The key is the word "using" . As soon as the python program uses gplv3 libraries (ie. pytave libraries) it requires to be GPLed. However, if it just runs in an pytave environment but does not use any of the pytave libraries, it doesn't have to be GPLed. "if you choose to use GPL'd Perl modules or Java classes" means that you call functions of these. Regards, Ulrich -- Ulrich B. Staudinger -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091119/2cd1b473/attachment.html From individ at acc.umu.se Thu Nov 19 03:08:55 2009 From: individ at acc.umu.se (David Grundberg) Date: Thu, 19 Nov 2009 10:08:55 +0100 Subject: Pytave licensing In-Reply-To: <65daf6a60911190052j55e565fct500d5b295200f709@mail.gmail.com> References: <0EA9662A402E6A4B88078E93D7F20D7B78472D@x346-001w2k3.sup2000.sup-logistik.de> <69d8d540911180842keb467b5wfabe7e3a0829c4b2@mail.gmail.com> <19204.17671.959294.725312@segfault.lan> <4B047269.3000606@acc.umu.se> <4B04F503.3060202@acc.umu.se> <1258618206.2867.92.camel@hauberg-laptop> <4B0500E1.1030302@acc.umu.se> <65daf6a60911190052j55e565fct500d5b295200f709@mail.gmail.com> Message-ID: <4B050B27.9020705@acc.umu.se> Ulrich Staudinger wrote: > > > On Thu, Nov 19, 2009 at 9:25 AM, David Grundberg > wrote: > > S?ren Hauberg wrote: > > tor, 19 11 2009 kl. 08:34 +0100, skrev David Grundberg: > > > >> I think its unnecessary to discuss Octave at all. Pytave is > licensed > >> under GPLv3 on its own, and it doesn't matter what libraries it > in turn > >> uses. Since Pytave consists of Python code and is GPLv3, any other > >> Python script that uses Pytave is a derivate work of Pytave. > >> > > > > I don't think you can make license requirements about _scripts_. > See, > > > > http://www.gnu.org/licenses/gpl-faq.html#IfInterpreterIsGPL > > > > S?ren > > > > I've read it all but I don't see how it is an argument against my > statement. In fact, FSF argues for my statement. See the last > paragraph: > > "A consequence is that if you choose to use GPL'd Perl modules or Java > classes in your program, you must release the program in a > GPL-compatible way, regardless of the license used in the Perl or Java > interpreter that the combined Perl or Java program will run on." > > Perl modules or Java classes are analogous to Python modules. If > you use > GPL Python modules, you must release the program in a > GPL-compatible way. > > > > > The key is the word "using" . > > As soon as the python program uses gplv3 libraries (ie. pytave > libraries) it requires to be GPLed. However, if it just runs in an > pytave environment but does not use any of the pytave libraries, it > doesn't have to be GPLed. > > "if you choose to use GPL'd Perl modules or Java classes" means that > you call functions of these. > > > Regards, > Ulrich I don't understand where you are going with this. You are just splitting hairs about the word "using", trying to use it in a more broad sense than was originally intended. I think the FAQ is using it as "making a derivate work". Lets look at a Python script. This script imports Pytave by some means. By doing this, it is a derivative work of Pytave. In order to redistribute this script you must comply with the GPL. David From pleser at sup-logistik.de Thu Nov 19 02:54:17 2009 From: pleser at sup-logistik.de (Philipp Leser) Date: Thu, 19 Nov 2009 09:54:17 +0100 Subject: Embeding Octave and the GNU GPL license Message-ID: <0EA9662A402E6A4B88078E93D7F20D7B784762@x346-001w2k3.sup2000.sup-logistik.de> > Please also remember that if you embed Octave, your program is subject > to the terms of the GNU GPL. Philipp, is your program be free > software? > > jwe | | Hey jwe; | | actually we are not a hundred percent sure how to handle the situation. We are no GPL license experts, so your input would be highly appreciated. I want to emphasis here that we are a huge fan of the open source concept in general and most definitely don't want to abuse it. | | What we would like to do is the following: | | Create some sort of web service to provide solution of certain optimization problems to other applications ( for finding shortest paths or the like ). | | Those applications that would make use of these services are non GPL ( | I believe ). Would it accord to the GPL to implement such a service ( | and license it under GPL ) and use these services from non GPL | programs? ( In a sense I would believe that I can have a non GPL | program making use of say the Apache Web Server to load some files | without violating the GPL ) | | But of course, I may be totally wrong here. | | regards | | ________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091119/041ca1ab/attachment.html From highegg at gmail.com Thu Nov 19 04:25:10 2009 From: highegg at gmail.com (Jaroslav Hajek) Date: Thu, 19 Nov 2009 11:25:10 +0100 Subject: ARPACK vs (BLAS + LAPACK) - build question In-Reply-To: <452989.8446.qm@web112114.mail.gq1.yahoo.com> References: <49685.84.132.135.136.1258305388.squirrel@mailbox.gwdg.de> <452989.8446.qm@web112114.mail.gq1.yahoo.com> Message-ID: <69d8d540911190225pa78b011gde08115f91ff218a@mail.gmail.com> On Mon, Nov 16, 2009 at 2:10 AM, Sergei Steshenko wrote: > Hello All, > > ARPACK README file says: > > " > The makefile is set up to build a self-contained library which includes > the needed BLAS 1/2/3 and LAPACK routines. If you already have the > BLAS and LAPACK libraries installed on your system you might want to > change the definition of DIRS as indicated in the ARmake.inc file. > ". > > So, when building ARPACK for Octave how do you guys build it - using > the included into ARPACK BLAS + LAPACK routines or using independently > built BLAS + LAPACK ? > > I build BLAS + LAPACK regardless; disk space is not an issue, i.e. if > the chances athat ARPACK will function more correctly with included into > the tarball BLAS + LAPACK routines are better, so be it. > > Thanks, > Sergei. > I link ARPACK against external LAPACK 3 and BLAS without problems. In fact I had problems when I built ARPACK with its own LAPACK 2 subset. hth -- RNDr. Jaroslav Hajek computing expert & GNU Octave developer Aeronautical Research and Test Institute (VZLU) Prague, Czech Republic url: www.highegg.matfyz.cz -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091119/0ce9e373/attachment.html From ustaudinger at gmail.com Thu Nov 19 04:26:59 2009 From: ustaudinger at gmail.com (Ulrich Staudinger) Date: Thu, 19 Nov 2009 11:26:59 +0100 Subject: Pytave licensing In-Reply-To: <4B050B27.9020705@acc.umu.se> References: <0EA9662A402E6A4B88078E93D7F20D7B78472D@x346-001w2k3.sup2000.sup-logistik.de> <4B047269.3000606@acc.umu.se> <4B04F503.3060202@acc.umu.se> <1258618206.2867.92.camel@hauberg-laptop> <4B0500E1.1030302@acc.umu.se> <65daf6a60911190052j55e565fct500d5b295200f709@mail.gmail.com> <4B050B27.9020705@acc.umu.se> Message-ID: <65daf6a60911190226u35323662xa59899678496776f@mail.gmail.com> On Thu, Nov 19, 2009 at 10:08 AM, David Grundberg wrote: > > > Lets look at a Python script. This script imports Pytave by some means. By > doing this, it is a derivative work of Pytave. In order to redistribute this > script you must comply with the GPL. > > Exactly. But if the script does not import pytave and does not use libraries that are distributed with it, it does not have to be. As Soren pointed out: http://www.gnu.org/licenses/gpl-faq.html#IfInterpreterIsGPL "When the interpreter just interprets a language, the answer is no. The interpreted program, to the interpreter, is just data; a free software license like the GPL, based on copyright law, cannot limit what data you use the interpreter on. You can run it on any data (interpreted program), any way you like, and there are no requirements about licensing that data to anyone. However, when the interpreter is extended to provide ?bindings? to other facilities (often, but not necessarily, libraries), the interpreted program is effectively linked to the facilities it uses through these bindings. So if these facilities are released under the GPL, the interpreted program that uses them must be released in a GPL-compatible way." That's it from me ... Kind regards, Ulrich -- Ulrich B. Staudinger -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091119/848ae9c4/attachment-0001.html From individ at acc.umu.se Thu Nov 19 04:38:05 2009 From: individ at acc.umu.se (David Grundberg) Date: Thu, 19 Nov 2009 11:38:05 +0100 Subject: Pytave licensing In-Reply-To: <65daf6a60911190226u35323662xa59899678496776f@mail.gmail.com> References: <0EA9662A402E6A4B88078E93D7F20D7B78472D@x346-001w2k3.sup2000.sup-logistik.de> <4B047269.3000606@acc.umu.se> <4B04F503.3060202@acc.umu.se> <1258618206.2867.92.camel@hauberg-laptop> <4B0500E1.1030302@acc.umu.se> <65daf6a60911190052j55e565fct500d5b295200f709@mail.gmail.com> <4B050B27.9020705@acc.umu.se> <65daf6a60911190226u35323662xa59899678496776f@mail.gmail.com> Message-ID: <4B05200D.8010808@acc.umu.se> Ulrich Staudinger wrote: > > > On Thu, Nov 19, 2009 at 10:08 AM, David Grundberg > wrote: > > > > Lets look at a Python script. This script imports Pytave by some > means. By doing this, it is a derivative work of Pytave. In order > to redistribute this script you must comply with the GPL. > > > Exactly. > But if the script does not import pytave and does not use libraries > that are distributed with it, it does not have to be. > > As Soren pointed out: > http://www.gnu.org/licenses/gpl-faq.html#IfInterpreterIsGPL > > "When the interpreter just interprets a language, the answer is no. > The interpreted program, to the interpreter, is just data; a free > software license like the GPL, based on copyright law, cannot limit > what data you use the interpreter on. You can run it on any data > (interpreted program), any way you like, and there are no requirements > about licensing that data to anyone. However, when the interpreter is > extended to provide ?bindings? to other facilities (often, but not > necessarily, libraries), the interpreted program is effectively linked > to the facilities it uses through these bindings. So if these > facilities are released under the GPL, the interpreted program that > uses them must be released in a GPL-compatible way." > I've already read the FAQ. That paragraph only refers to interpreters. But Pytave isn't used as a interpreter! Pytave is used as a Python module, and must be licensed to be used as such. (The paragraph do applies to the m-files being interpreted by the Octave interpreter, though. But that is a different issue, and could be discussed more succinct with the Octave + m-file case.) Regardless how Pytave is loaded into the Python script, the script is derivate work of Pytave. David From highegg at gmail.com Thu Nov 19 04:48:27 2009 From: highegg at gmail.com (Jaroslav Hajek) Date: Thu, 19 Nov 2009 11:48:27 +0100 Subject: calling octave from C In-Reply-To: References: <0EA9662A402E6A4B88078E93D7F20D7B78472D@x346-001w2k3.sup2000.sup-logistik.de> <69d8d540911180842keb467b5wfabe7e3a0829c4b2@mail.gmail.com> <19204.17671.959294.725312@segfault.lan> <4B047269.3000606@acc.umu.se> Message-ID: <69d8d540911190248y4f490eb2mbe340a0772a39e60@mail.gmail.com> On Thu, Nov 19, 2009 at 12:13 AM, Judd Storrs wrote: > Ok. I think you are overreaching by claiming that python scripts must > be GPLv3 as a result of using pytave. > > 1) Octave is an interpreter. The GPLv3 license does not apply to > interpreter input. e.g. m-files can be any license without violating > the interpreter's license. > > 2) python + pytave is also an interpreter. In order to distribute a > python + pytave interpreter, all components of the interpreter must be > GPLv3 compatible. > > 3) Python scripts are also interpreter input. They are equivalent to > m-files. > Still, David's position is probably in agreement with FSF's: http://www.gnu.org/licenses/gpl-faq.html#IfInterpreterIsGPL so if this is of real interest to you, I'd suggest you ask the FSF -- RNDr. Jaroslav Hajek computing expert & GNU Octave developer Aeronautical Research and Test Institute (VZLU) Prague, Czech Republic url: www.highegg.matfyz.cz -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091119/4b37dc49/attachment.html From highegg at gmail.com Thu Nov 19 04:54:29 2009 From: highegg at gmail.com (Jaroslav Hajek) Date: Thu, 19 Nov 2009 11:54:29 +0100 Subject: Pytave licensing (was: Re: calling octave from C) In-Reply-To: <1258618206.2867.92.camel@hauberg-laptop> References: <0EA9662A402E6A4B88078E93D7F20D7B78472D@x346-001w2k3.sup2000.sup-logistik.de> <69d8d540911180842keb467b5wfabe7e3a0829c4b2@mail.gmail.com> <19204.17671.959294.725312@segfault.lan> <4B047269.3000606@acc.umu.se> <4B04F503.3060202@acc.umu.se> <1258618206.2867.92.camel@hauberg-laptop> Message-ID: <69d8d540911190254v3e1afa38x514b0269ce6dff16@mail.gmail.com> On Thu, Nov 19, 2009 at 9:10 AM, S?ren Hauberg wrote: > tor, 19 11 2009 kl. 08:34 +0100, skrev David Grundberg: > > I think its unnecessary to discuss Octave at all. Pytave is licensed > > under GPLv3 on its own, and it doesn't matter what libraries it in turn > > uses. Since Pytave consists of Python code and is GPLv3, any other > > Python script that uses Pytave is a derivate work of Pytave. > > I don't think you can make license requirements about _scripts_. See, > > http://www.gnu.org/licenses/gpl-faq.html#IfInterpreterIsGPL > > S?ren > Soren, did you read the second paragraph? -- RNDr. Jaroslav Hajek computing expert & GNU Octave developer Aeronautical Research and Test Institute (VZLU) Prague, Czech Republic url: www.highegg.matfyz.cz -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091119/045df3a9/attachment.html From highegg at gmail.com Thu Nov 19 05:00:39 2009 From: highegg at gmail.com (Jaroslav Hajek) Date: Thu, 19 Nov 2009 12:00:39 +0100 Subject: Pytave licensing In-Reply-To: <65daf6a60911190226u35323662xa59899678496776f@mail.gmail.com> References: <0EA9662A402E6A4B88078E93D7F20D7B78472D@x346-001w2k3.sup2000.sup-logistik.de> <4B04F503.3060202@acc.umu.se> <1258618206.2867.92.camel@hauberg-laptop> <4B0500E1.1030302@acc.umu.se> <65daf6a60911190052j55e565fct500d5b295200f709@mail.gmail.com> <4B050B27.9020705@acc.umu.se> <65daf6a60911190226u35323662xa59899678496776f@mail.gmail.com> Message-ID: <69d8d540911190300l450874c7j6749f9774986e6ce@mail.gmail.com> On Thu, Nov 19, 2009 at 11:26 AM, Ulrich Staudinger wrote: > > > On Thu, Nov 19, 2009 at 10:08 AM, David Grundberg wrote: > >> >> >> Lets look at a Python script. This script imports Pytave by some means. By >> doing this, it is a derivative work of Pytave. In order to redistribute this >> script you must comply with the GPL. >> >> > Exactly. > But if the script does not import pytave and does not use libraries that > are distributed with it, it does not have to be. > > Well, I believe nobody tried to say that. That would be a plain nonsense. -- RNDr. Jaroslav Hajek computing expert & GNU Octave developer Aeronautical Research and Test Institute (VZLU) Prague, Czech Republic url: www.highegg.matfyz.cz -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091119/925c3f16/attachment.html From highegg at gmail.com Thu Nov 19 05:16:01 2009 From: highegg at gmail.com (Jaroslav Hajek) Date: Thu, 19 Nov 2009 12:16:01 +0100 Subject: Embeding Octave and the GNU GPL license In-Reply-To: <0EA9662A402E6A4B88078E93D7F20D7B784762@x346-001w2k3.sup2000.sup-logistik.de> References: <0EA9662A402E6A4B88078E93D7F20D7B784762@x346-001w2k3.sup2000.sup-logistik.de> Message-ID: <69d8d540911190316s3680a3f8ufeffa45fad5f79c7@mail.gmail.com> On Thu, Nov 19, 2009 at 9:54 AM, Philipp Leser wrote: > > > > Please also remember that if you embed Octave, your program is subject > > > to the terms of the GNU GPL. Philipp, is your program be free > > > software? > > > > > > jwe > > > > > > | > > | Hey jwe; > > | > > | actually we are not a hundred percent sure how to handle the situation. > We are no GPL license experts, so your input would be highly appreciated. I > want to emphasis here that we are a huge fan of the open source concept in > general and most definitely don?t want to abuse it. > > | > > | What we would like to do is the following: > > | > > | Create some sort of web service to provide solution of certain > optimization problems to other applications ( for finding shortest paths or > the like ). > > | > > | Those applications that would make use of these services are non GPL ( > > | I believe ). Would it accord to the GPL to implement such a service ( > > | and license it under GPL ) and use these services from non GPL > > | programs? ( In a sense I would believe that I can have a non GPL > > | program making use of say the Apache Web Server to load some files > > | without violating the GPL ) > > | > > | But of course, I may be totally wrong here. > > | > > | regards > Yes, this is allowed (unless I misunderstood you). For GPL, embedding the software in a web service of any kind is just using it, and GPL grants you the freedom to use the software in whatever way for whatever purpose you like (unlike many proprietary licenses, mark you). The only thing affected is redistribution; i.e., if you ever want to sell the service software to another company, you must do so under a GPL-compatible license. Note that there is also the GNU Affero GPL which is stricter and would require you to release sources for your web service. But Octave uses GPL, not AGPL. hth -- RNDr. Jaroslav Hajek computing expert & GNU Octave developer Aeronautical Research and Test Institute (VZLU) Prague, Czech Republic url: www.highegg.matfyz.cz -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091119/504847b1/attachment-0001.html From babelproofreader at gmail.com Thu Nov 19 07:04:47 2009 From: babelproofreader at gmail.com (babelproofreader) Date: Thu, 19 Nov 2009 05:04:47 -0800 (PST) Subject: Manipulate financial data - dimensions mismatch In-Reply-To: <26351012.post@talk.nabble.com> References: <26351012.post@talk.nabble.com> Message-ID: <26421326.post@talk.nabble.com> Could anyone tell me what this error means? error: A(I,J,...) = X: dimensions mismatch error: called from: error: /home/andrew/Documents/forex_convert/tick_to_min.m at line 105, column 25 The code that produces it is [i,j]=find(fMM>=45 & fMM<50); min_5_vec(1:length(i),1)=tick_data(min(i):max(i),1); % line 105 The code checks the "minutes" vector fMM and should extract and create a new "min_5_vec" vector containing all tick data that occurred between the times HH:45:00 and HH:49:59 for every hour. The thing is this code, which is part of a function, appears to fail only on this particular line which I find very strange as it has been copied and pasted and only the figures 45 and 50 have been changed, and the other similar parts of the function code up to line 105 do not fail. I have visually checked the raw data and can see no cause for the nature of the data to be the reason for the failure. -- View this message in context: http://old.nabble.com/Manipulate-financial-data-tp26351012p26421326.html Sent from the Octave - General mailing list archive at Nabble.com. From sesc at gmx.de Thu Nov 19 07:10:01 2009 From: sesc at gmx.de (=?ISO-8859-1?Q?Sebastian_Sch=F6ps?=) Date: Thu, 19 Nov 2009 14:10:01 +0100 Subject: Problem in installing octave-3.2.3 in Suse Linux 2.6.16.60-0.42.7 In-Reply-To: <508a30f80911171500s62375582n323d8aa7070deb22@mail.gmail.com> References: <508a30f80911121743u29394b2cq878a9e9d38f56c5a@mail.gmail.com> <9543b3a40911151302x5abb091alab5122aae311a1ee@mail.gmail.com> <508a30f80911151831n4aeef06ds3d343c42a02c5aea@mail.gmail.com> <9543b3a40911151958j3e36d88ch9322823f6bdf42e1@mail.gmail.com> <508a30f80911152009k5a0ff44dv64c16f706e8e860a@mail.gmail.com> <508a30f80911171500s62375582n323d8aa7070deb22@mail.gmail.com> Message-ID: <4B0543A9.30107@gmx.de> Dear Srini, compiling octave is not a trivial task! Anyway, I had a brief look at your log-file: It is very likely that some dependencies are not fulfilled. Did you install all needed packages prior to octave (e.g. Suitesparse, qhull, ...)? Did you specify their directories when running configure, if they are installed in a non-standard location? Have a look at the wiki: http://wiki.octave.org/wiki.pl?EnableLargeArrays I was able to install octave 3.2.3 on OpenSUSE 11.1 using the following steps (although I have the impression, that my build is not very fast): 1. add some additional sources (if not already available) sudo zypper ar http://download.opensuse.org/repositories/openSUSE:Factory:Contrib/standard openSUSE:Factory:Contrib sudo zypper ar http://download.opensuse.org/repositories/home:/ars3niy:/octave/openSUSE_11.1/ ars3niy:Octave sudo zypper ar http://ftp.gwdg.de/pub/linux/misc/packman/ Packman 2. we will need the following packages incl. some devel packages; install: sudo zypper install bison build fftw3 fftw3-devel flex fltk fltk-devel \ gcc-c++ gcc-fortran glpk glpk-devel libglpk0 \ gmp-devel libgmp3 gnuplot gperf \ ImageMagick libbz2 libbz2-devel \ libcurl libcurl-devel hdf5 hdf5-devel \ libltdl3 ncurses ncurses-devel \ pcre pcre-devel readline readline-devel zlib zlib-devel \ libqrupdate1 libqrupdate1-devel \ Suitesparse Suitesparse-devel \ qhull qhull-devel \ libamd libamd-devel 2b. Add a link to hdf5 library (if necessary) cd /usr/lib64 sudo ln libhdf5.so libhdf5.so.0 3. install source package( if you like you could compile additionally: libamd Suitesparse qhull ...) sudo zypper source-install octave 4. download octave-3.2.3.tar.gz and save it to /usr/src/packages/SOURCES, e.g. cd /usr/src/packages/SOURCES wget ftp://ftp.octave.org/pub/octave/octave-3.2.3.tar.gz 5. modify octave.spec for the new version edit /usr/src/packages/SPECS/octave.spec - change version number (Version: 3.2.3) - add additional entry to the "%file" section "%{_datadir}/applications/" 6. compile all packages according to their spec files cd /usr/src/packages/SPECS sudo rpmbuild -ba octave.spec 7. install the packages (this depends on your architecture, e.g. for x86_64) cd /usr/src/packages/RPMS/x86_64 sudo rpm --install octave*.rpm Bye Sebastian Am 18.11.09 00:00, schrieb srini: > Dear members, > > Could you find the problem with the attached config.log file? I am badly in > need to install Octave-3.2.3 on Suse Linux 2.6.16.60-0.42.7 machine and > start using it. You help would be highly appreciated. > > Regards, > Srini > > On Sun, Nov 15, 2009 at 11:09 PM, sriniwrote: > >> Please find the attached zip file of the config.log file. >> >> Regards, >> Srini >> >> 2009/11/15 Jordi Guti?rrez Hermoso >> >>> 009/11/15 srini: >>> >>>> Attached is the output of the config.log file. I'd appreciate your help >>> a >>>> lot. >>> >>> Please zip it and post it to the list so that others may help. >>> From nuovodna at gmail.com Thu Nov 19 07:34:18 2009 From: nuovodna at gmail.com (Emanuele T.) Date: Thu, 19 Nov 2009 14:34:18 +0100 Subject: Pulse function in a LSODE system Message-ID: <1a403ba70911190534x6038341dv38fe02795a6629c3@mail.gmail.com> Thanks for yout tip. I' ll try to discretizing my equations system -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091119/18cdf4c4/attachment.html From carlo.defalco at gmail.com Thu Nov 19 07:36:48 2009 From: carlo.defalco at gmail.com (Carlo de Falco) Date: Thu, 19 Nov 2009 14:36:48 +0100 Subject: Manipulate financial data - dimensions mismatch In-Reply-To: <26421326.post@talk.nabble.com> References: <26351012.post@talk.nabble.com> <26421326.post@talk.nabble.com> Message-ID: On 19 Nov 2009, at 14:04, babelproofreader wrote: > > Could anyone tell me what this error means? > > error: A(I,J,...) = X: dimensions mismatch > error: called from: > error: /home/andrew/Documents/forex_convert/tick_to_min.m at line > 105, > column 25 it means what it says: you are trying to assign values to part of an array, but the dimensions of the lhs and rhs of the assignment do not match > The code that produces it is > > [i,j]=find(fMM>=45 & fMM<50); > min_5_vec(1:length(i),1)=tick_data(min(i):max(i),1); % line 105 to help debug this, you can change it as follows: [i,j]=find(fMM>=45 & fMM<50); try min_5_vec(1:length(i),1)=tick_data(min(i):max(i),1); % line 105 catch fprintf ("size of lhs:") size (1:length(i)) fprintf ("size of rhs:") size (min(i):max(i)) error (lasterr) end_try_catch so that you get a mor informative error message > The code checks the "minutes" vector fMM and should extract and > create a new > "min_5_vec" vector containing all tick data that occurred between > the times > HH:45:00 and HH:49:59 for every hour. The thing is this code, which > is part > of a function, appears to fail only on this particular line which I > find > very strange as it has been copied and pasted and only the figures > 45 and 50 > have been changed, and the other similar parts of the function code > up to > line 105 do not fail. I have visually checked the raw data and can > see no > cause for the nature of the data to be the reason for the failure. > HTH c. From sergstesh at yahoo.com Thu Nov 19 09:50:07 2009 From: sergstesh at yahoo.com (Sergei Steshenko) Date: Thu, 19 Nov 2009 07:50:07 -0800 (PST) Subject: ARPACK vs (BLAS + LAPACK) - build question In-Reply-To: <69d8d540911190225pa78b011gde08115f91ff218a@mail.gmail.com> Message-ID: <774623.1159.qm@web112118.mail.gq1.yahoo.com> --- On Thu, 11/19/09, Jaroslav Hajek wrote: > From: Jaroslav Hajek > Subject: Re: ARPACK vs (BLAS + LAPACK) - build question > To: "Sergei Steshenko" > Cc: help-octave at octave.org > Date: Thursday, November 19, 2009, 2:25 AM > > > On Mon, Nov 16, 2009 at 2:10 AM, > Sergei Steshenko > wrote: > > Hello All, > > > > ARPACK README file says: > > > > " > > ? The makefile is set up to build a self-contained > library which includes > > ? the needed BLAS 1/2/3 and LAPACK routines. ?If you > already have the > > ? BLAS and LAPACK libraries installed on your system you > might want to > > ? change the definition of DIRS as indicated in the > ARmake.inc file. > > ". > > > > So, when building ARPACK for Octave how do you guys build > it - using > > the included into ARPACK BLAS + LAPACK routines or using > independently > > built BLAS + LAPACK ? > > > > I build BLAS + LAPACK regardless; disk space is not an > issue, i.e. if > > the chances athat ARPACK will function more correctly with > included into > > the tarball BLAS + LAPACK routines are better, so be it. > > > > Thanks, > > ?Sergei. > > > I link ARPACK against external LAPACK 3 and BLAS without > problems. In fact I had problems when I built ARPACK with > its own LAPACK 2 subset. > > hth > > -- > RNDr. Jaroslav Hajek > > computing expert & GNU Octave developer > Aeronautical Research and Test Institute (VZLU) > Prague, Czech Republic > url: www.highegg.matfyz.cz > > Thanks, I'll follow your advice. Regards, Sergei. From storrsjm at email.uc.edu Thu Nov 19 11:54:34 2009 From: storrsjm at email.uc.edu (Judd Storrs) Date: Thu, 19 Nov 2009 12:54:34 -0500 Subject: calling octave from C In-Reply-To: <69d8d540911190248y4f490eb2mbe340a0772a39e60@mail.gmail.com> References: <0EA9662A402E6A4B88078E93D7F20D7B78472D@x346-001w2k3.sup2000.sup-logistik.de> <69d8d540911180842keb467b5wfabe7e3a0829c4b2@mail.gmail.com> <19204.17671.959294.725312@segfault.lan> <4B047269.3000606@acc.umu.se> <69d8d540911190248y4f490eb2mbe340a0772a39e60@mail.gmail.com> Message-ID: On Thu, Nov 19, 2009 at 5:48 AM, Jaroslav Hajek wrote: > Still, David's position is probably in agreement with FSF's: > http://www.gnu.org/licenses/gpl-faq.html#IfInterpreterIsGPL > > so if this is of real interest to you, I'd suggest you ask the FSF How can forbidding non-GPL python files be justified while simultaneously allowing use of non-GPL m-files? How does the GPL choose to favor one interpreted language over another? --judd From storrsjm at email.uc.edu Thu Nov 19 13:08:24 2009 From: storrsjm at email.uc.edu (Judd Storrs) Date: Thu, 19 Nov 2009 14:08:24 -0500 Subject: Pytave licensing In-Reply-To: <69d8d540911190300l450874c7j6749f9774986e6ce@mail.gmail.com> References: <0EA9662A402E6A4B88078E93D7F20D7B78472D@x346-001w2k3.sup2000.sup-logistik.de> <4B04F503.3060202@acc.umu.se> <1258618206.2867.92.camel@hauberg-laptop> <4B0500E1.1030302@acc.umu.se> <65daf6a60911190052j55e565fct500d5b295200f709@mail.gmail.com> <4B050B27.9020705@acc.umu.se> <65daf6a60911190226u35323662xa59899678496776f@mail.gmail.com> <69d8d540911190300l450874c7j6749f9774986e6ce@mail.gmail.com> Message-ID: On Thu, Nov 19, 2009 at 6:00 AM, Jaroslav Hajek wrote: > On Thu, Nov 19, 2009 at 11:26 AM, Ulrich Staudinger >> >> But if the script does not import pytave and does not use libraries that >> are distributed with it, it does not have to be. > > Well, I believe nobody tried to say that. That would be a plain nonsense. Not nonsense, really. Ulrich is hitting the nail very squarely on the head. You could very, very, very easily write a python script that receives any pytave-like object as a parameter without importing pytave. --judd From john.c.placente at gmail.com Thu Nov 19 12:24:03 2009 From: john.c.placente at gmail.com (John Placente) Date: Fri, 20 Nov 2009 02:24:03 +0800 Subject: Help Needed Message-ID: <4B058D43.6070106@gmail.com> Sir, I am a graduate student from the Philippines and I would like to further know how to use the function TOEPLITZ in Octave. Basically I have a matrix A=[1;2;3;4;5;6;7;8;9;10] What I need to do (output) is: B=[5,4,3,2,1; 6,5,4,3,2; 7,6,5,4,3; 8,7,6,5,4; 9,8,7,6,5; 10,9,8,7,6] Can you help me please and writing the code? Thank you very much. Respectfully, John From ustaudinger at gmail.com Thu Nov 19 13:26:06 2009 From: ustaudinger at gmail.com (ustaudinger at gmail.com) Date: Thu, 19 Nov 2009 20:26:06 +0100 Subject: AW: Re: calling octave from C Message-ID: Am in the train, therefore top posting ... in reply to ur question, it is neither for .m nor perl files forbidden to distribute them as closed source when they do not include or directly reference GPL software. If these files provide some logic on their own they can be distributed via a different license. However, as far as i understand, any pytave script has to use pytave libraries in its code, which then means that ur code directly calls these specific functions, which means further that ur program needs these libraries and then of course that u need to distribute (when u want to) ur code via gpl. Fact is that pytave is written in python as well and can be seen as a library that ur python/pytave scripts use. In any case, the question is propably better directed to the fsf indeed. Kind regards, Ulrich -- Urspr. Mitt. -- Betreff: Re: calling octave from C Von: Judd Storrs Datum: 19.11.2009 18:56 On Thu, Nov 19, 2009 at 5:48 AM, Jaroslav Hajek wrote: > Still, David's position is probably in agreement with FSF's: > http://www.gnu.org/licenses/gpl-faq.html#IfInterpreterIsGPL > > so if this is of real interest to you, I'd suggest you ask the FSF How can forbidding non-GPL python files be justified while simultaneously allowing use of non-GPL m-files? How does the GPL choose to favor one interpreted language over another? --judd _______________________________________________ Help-octave mailing list Help-octave at octave.org https://www-old.cae.wisc.edu/mailman/listinfo/help-octave From diyarsaracoglu at gmail.com Thu Nov 19 14:30:43 2009 From: diyarsaracoglu at gmail.com (=?ISO-8859-9?Q?Diyar_Sara=E7o=F0lu?=) Date: Thu, 19 Nov 2009 22:30:43 +0200 Subject: Octave Image Processing Question. Message-ID: <4d5426b30911191230r355179a7sfe7edd507b702508@mail.gmail.com> Hi , I am new at octave. I am using Image package for image processing. I have 3 question. 1) Is there a "Wiener" filter at Octave? 2) In medfilt2 filter. It is written that *medfilt2*(A, [domain, padding])is format. In this format i could not give second and third parameter. What is domain and padding. 3) Is there any octave examples, specially in image processing. I could not find in internet. Thank you for your help. diyar -- "Forse Altri Contera Con Miglior Plettero" -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091119/6911ecab/attachment.html From hubahopp at gmx.de Thu Nov 19 16:05:04 2009 From: hubahopp at gmx.de (Wolfgang Schechinger) Date: Thu, 19 Nov 2009 23:05:04 +0100 Subject: Help Needed In-Reply-To: <4B058D43.6070106@gmail.com> References: <4B058D43.6070106@gmail.com> Message-ID: <20091119220504.41190@gmx.net> Dear John, a FOR loop should do the trick: something like this: count i from 5 to 10 count j form 5 dowto 1 -------- Original-Nachricht -------- > Datum: Fri, 20 Nov 2009 02:24:03 +0800 > Von: John Placente > An: help at octave.org > Betreff: Help Needed > Sir, > > I am a graduate student from the Philippines and I would like to further > know how to use the function TOEPLITZ in Octave. > > Basically I have a matrix A=[1;2;3;4;5;6;7;8;9;10] > > What I need to do (output) is: > > B=[5,4,3,2,1; > 6,5,4,3,2; > 7,6,5,4,3; > 8,7,6,5,4; > 9,8,7,6,5; > 10,9,8,7,6] > > Can you help me please and writing the code? > Thank you very much. > > Respectfully, > John > _______________________________________________ > Help-octave mailing list > Help-octave at octave.org > https://www-old.cae.wisc.edu/mailman/listinfo/help-octave -- Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3.5 - sicherer, schneller und einfacher! http://portal.gmx.net/de/go/chbrowser From john.c.placente at gmail.com Thu Nov 19 19:22:25 2009 From: john.c.placente at gmail.com (John Placente) Date: Fri, 20 Nov 2009 09:22:25 +0800 Subject: Help Needed- Toeplitz In-Reply-To: <20091119220504.41190@gmx.net> References: <4B058D43.6070106@gmail.com> <20091119220504.41190@gmx.net> Message-ID: <4B05EF51.7020706@gmail.com> An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091120/256fc233/attachment.html From liamg at mac.com Thu Nov 19 21:03:05 2009 From: liamg at mac.com (Liam Groener) Date: Thu, 19 Nov 2009 19:03:05 -0800 Subject: Help Needed Message-ID: I'm not an expert and I'm not sure how general you want the matrix A to be, but how about: function B = fillit(A) n = (size(A))(1); m = n/2; C = A(m:n) R= A(m:-1:1)' B = toeplitz(C,R); endfunction From etienne at isr.ist.utl.pt Thu Nov 19 23:57:17 2009 From: etienne at isr.ist.utl.pt (etienne at isr.ist.utl.pt) Date: Thu, 19 Nov 2009 21:57:17 -0800 Subject: Octave Image Processing Question. In-Reply-To: <4d5426b30911191230r355179a7sfe7edd507b702508@mail.gmail.com> References: <4d5426b30911191230r355179a7sfe7edd507b702508@mail.gmail.com> Message-ID: <20091119215717.19825xrnsp946d0c@webmail.isr.ist.utl.pt> Quoting Diyar Sara?o?lu (Thu, 19 Nov 2009 22:30:43 +0200): Hi Diyar, I can help a little w/ your 2nd question, but since I use an old octave, ymmv w/ the latest version. ### As you see, this octave is not brand new version ans = 3.0.3 which medfilt2 medfilt2 is the user-defined function from the file /home/etienne/prog/octave/svn-octave-forge/octave-forge/main/image-1.0.8/inst/medfilt2.m ### Now with the filter, which seems to work [xx,yy] = meshgrid (1:100); zz = sin(xx/8.*yy/16+xx/12+yy/20); zzn = zz + randn (size (zz)) .* 0.3; zzf = medfilt2 (zzn,ones(8,8),"ones"); imshow (([zzn, fliplr(zzf)]-min([zzn, fliplr(zzf)](:)))/4) [xx,yy] = meshgrid (1:100); zz = sin(xx/8.*yy/16+xx/12+yy/20); zzn = zz + randn (size (zz)) .* 0.3; zzf = medfilt2 (zzn,ones(8,8)); imshow (([zzn, fliplr(zzf)]-min([zzn, fliplr(zzf)](:)))/4) Hth, Etienne > Hi , > > I am new at octave. I am using Image package for image processing. > > I have 3 question. > > 1) Is there a "Wiener" filter at Octave? > > 2) In medfilt2 filter. It is written that MEDFILT2(A, [domain, > padding]) is format. In this format i could not give second and > third parameter. What is domain and padding. > > 3) Is there any octave examples, specially in image processing. I > could not find in internet. > > Thank you for your help. > > diyar > > -- > "Forse Altri Contera Con Miglior Plettero" -- http://www.isr.ist.utl.pt/~etienne ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program. From highegg at gmail.com Fri Nov 20 00:10:52 2009 From: highegg at gmail.com (Jaroslav Hajek) Date: Fri, 20 Nov 2009 07:10:52 +0100 Subject: Help Needed In-Reply-To: <4B058D43.6070106@gmail.com> References: <4B058D43.6070106@gmail.com> Message-ID: <69d8d540911192210q486245c1gfe5427de8e75f8af@mail.gmail.com> On Thu, Nov 19, 2009 at 7:24 PM, John Placente wrote: > Sir, > > I am a graduate student from the Philippines and I would like to further > know how to use the function TOEPLITZ in Octave. > > Basically I have a matrix A=[1;2;3;4;5;6;7;8;9;10] > > What I need to do (output) is: > > B=[5,4,3,2,1; > 6,5,4,3,2; > 7,6,5,4,3; > 8,7,6,5,4; > 9,8,7,6,5; > 10,9,8,7,6] > > Can you help me please and writing the code? > Thank you very much. > > Respectfully, > John > B = toeplitz (A(5:10), A(5:-1:1)) hth -- RNDr. Jaroslav Hajek computing expert & GNU Octave developer Aeronautical Research and Test Institute (VZLU) Prague, Czech Republic url: www.highegg.matfyz.cz -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091120/ef9519dd/attachment.html From individ at acc.umu.se Fri Nov 20 03:00:12 2009 From: individ at acc.umu.se (David Grundberg) Date: Fri, 20 Nov 2009 10:00:12 +0100 Subject: Pytave licensing In-Reply-To: References: <0EA9662A402E6A4B88078E93D7F20D7B78472D@x346-001w2k3.sup2000.sup-logistik.de> <4B04F503.3060202@acc.umu.se> <1258618206.2867.92.camel@hauberg-laptop> <4B0500E1.1030302@acc.umu.se> <65daf6a60911190052j55e565fct500d5b295200f709@mail.gmail.com> <4B050B27.9020705@acc.umu.se> <65daf6a60911190226u35323662xa59899678496776f@mail.gmail.com> <69d8d540911190300l450874c7j6749f9774986e6ce@mail.gmail.com> Message-ID: <4B065A9C.9010801@acc.umu.se> Judd Storrs wrote: > On Thu, Nov 19, 2009 at 6:00 AM, Jaroslav Hajek wrote: > >> On Thu, Nov 19, 2009 at 11:26 AM, Ulrich Staudinger >> >>> But if the script does not import pytave and does not use libraries that >>> are distributed with it, it does not have to be. >>> >> Well, I believe nobody tried to say that. That would be a plain nonsense. >> > > Not nonsense, really. Ulrich is hitting the nail very squarely on the > head. You could very, very, very easily write a python script that > receives any pytave-like object as a parameter without importing > pytave. > > > I don't think the mechanisms for linking matters. You're still linking, and you're still deriving Pytave. It makes me uneasy to hear people trying to make proprietary works of copyleft software. I think it is very unethical, since copyleft software is developed with the intent to always be free software. Nobody is forcing anyone to use copyleft software, so there is no need to weep crocodile tears. David From highegg at gmail.com Fri Nov 20 03:03:24 2009 From: highegg at gmail.com (Jaroslav Hajek) Date: Fri, 20 Nov 2009 10:03:24 +0100 Subject: Pytave licensing In-Reply-To: References: <0EA9662A402E6A4B88078E93D7F20D7B78472D@x346-001w2k3.sup2000.sup-logistik.de> <4B04F503.3060202@acc.umu.se> <1258618206.2867.92.camel@hauberg-laptop> <4B0500E1.1030302@acc.umu.se> <65daf6a60911190052j55e565fct500d5b295200f709@mail.gmail.com> <4B050B27.9020705@acc.umu.se> <65daf6a60911190226u35323662xa59899678496776f@mail.gmail.com> <69d8d540911190300l450874c7j6749f9774986e6ce@mail.gmail.com> Message-ID: <69d8d540911200103y4c7fb857v83292918918bf2ab@mail.gmail.com> On Thu, Nov 19, 2009 at 8:08 PM, Judd Storrs wrote: > On Thu, Nov 19, 2009 at 6:00 AM, Jaroslav Hajek wrote: > > On Thu, Nov 19, 2009 at 11:26 AM, Ulrich Staudinger < > ustaudinger at gmail.com> > >> > >> But if the script does not import pytave and does not use libraries that > >> are distributed with it, it does not have to be. > > > > Well, I believe nobody tried to say that. That would be a plain nonsense. > > Not nonsense, really. Ulrich is hitting the nail very squarely on the > head. You could very, very, very easily write a python script that > receives any pytave-like object as a parameter without importing > pytave. > Example? -- RNDr. Jaroslav Hajek computing expert & GNU Octave developer Aeronautical Research and Test Institute (VZLU) Prague, Czech Republic url: www.highegg.matfyz.cz -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091120/1eb69751/attachment.html From highegg at gmail.com Fri Nov 20 03:36:59 2009 From: highegg at gmail.com (Jaroslav Hajek) Date: Fri, 20 Nov 2009 10:36:59 +0100 Subject: dec2hex with int types In-Reply-To: <2417729F3416D511A27E0090273A963B029110AC@smex01.mbbm.de> References: <2417729F3416D511A27E0090273A963B029110AC@smex01.mbbm.de> Message-ID: <69d8d540911200136y13aab440pb21a0941dcee0f81@mail.gmail.com> On Wed, Oct 14, 2009 at 6:46 PM, Schirmacher, Rolf < Rolf.Schirmacher at muellerbbm.de> wrote: > > Hello, > > with octave 3.0.3 on windows, I get the following strange results: > > octave.exe> hex2dec(dec2hex((1234))) > ans = 1234 > octave.exe> hex2dec(dec2hex(single(1234))) > ans = 1234 > octave.exe> hex2dec(dec2hex(double(1234))) > ans = 1234 > octave.exe> hex2dec(dec2hex(int16(1234))) > ans = 1490 > octave.exe> hex2dec(dec2hex(uint16(1234))) > ans = 1490 > octave.exe> hex2dec(dec2hex(int32(1234))) > ans = 1490 > octave.exe> hex2dec(dec2hex(uint32(1234))) > ans = 1490 > > As you might conclude from > > octave.exe> dec2hex((1234)) > ans = 4D2 > octave.exe> dec2hex(uint32(1234)) > ans = 5D2 > > the issue is with dec2hex, not with hex2dec. > > Thanks in advance for any hint or help. > > Rolf > _______________________________________________ > Help-octave mailing list > Help-octave at octave.org > https://www-old.cae.wisc.edu/mailman/listinfo/help-octave > I fixed this in the development sources. http://hg.savannah.gnu.org/hgweb/octave/rev/edf065b51fa9 thanks -- RNDr. Jaroslav Hajek computing expert & GNU Octave developer Aeronautical Research and Test Institute (VZLU) Prague, Czech Republic url: www.highegg.matfyz.cz -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091120/19417dd4/attachment.html From highegg at gmail.com Fri Nov 20 03:54:09 2009 From: highegg at gmail.com (Jaroslav Hajek) Date: Fri, 20 Nov 2009 10:54:09 +0100 Subject: calling octave from C In-Reply-To: References: <0EA9662A402E6A4B88078E93D7F20D7B78472D@x346-001w2k3.sup2000.sup-logistik.de> <69d8d540911180842keb467b5wfabe7e3a0829c4b2@mail.gmail.com> <19204.17671.959294.725312@segfault.lan> <4B047269.3000606@acc.umu.se> <69d8d540911190248y4f490eb2mbe340a0772a39e60@mail.gmail.com> Message-ID: <69d8d540911200154k7fb5c769t68688d402ce900c@mail.gmail.com> On Thu, Nov 19, 2009 at 6:54 PM, Judd Storrs wrote: > On Thu, Nov 19, 2009 at 5:48 AM, Jaroslav Hajek wrote: > > Still, David's position is probably in agreement with FSF's: > > http://www.gnu.org/licenses/gpl-faq.html#IfInterpreterIsGPL > > > > so if this is of real interest to you, I'd suggest you ask the FSF > > How can forbidding non-GPL python files be justified while > simultaneously allowing use of non-GPL m-files? How does the GPL > choose to favor one interpreted language over another? > It doesn't. It's using the bindings that make the difference. At least FSF thinks so. -- RNDr. Jaroslav Hajek computing expert & GNU Octave developer Aeronautical Research and Test Institute (VZLU) Prague, Czech Republic url: www.highegg.matfyz.cz -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091120/77fddd8a/attachment.html From Rolf.Schirmacher at MuellerBBM.de Fri Nov 20 04:13:01 2009 From: Rolf.Schirmacher at MuellerBBM.de (Schirmacher, Rolf) Date: Fri, 20 Nov 2009 11:13:01 +0100 Subject: help for vectorisation Message-ID: <2417729F3416D511A27E0090273A963B02911189@smex01.mbbm.de> Hello, I need to convert normalised numbers [-1. ... 1.[ to hex strings in 24 bit fractional format. The most efficient code I have at the moment is as below: DATA = 2*rand(10000,1)-1; # random data at [-1 .. 1] # scale to 24 bit integers DATA = DATA*2^23; DATA = round(DATA); # first part: check data range tic; for idx = 1:length(DATA) if DATA(idx) > (2^23)-1 error(['Data are outside legal range, idx:' num2str(idx)]); elseif DATA(idx) < -2^23 error(['Data are outside legal range, idx:' num2str(idx)]); end end toc # second part: convert to string array tic; MyString = repmat('0x000000', length(DATA), 1); for idx= 1:length(DATA) if sign(DATA(idx))== 1 % number is positive unumber = uint32(DATA(idx)); elseif sign(DATA(idx))== 0 % number is positive unumber = uint32(DATA(idx)); elseif sign(DATA(idx))== -1 % number is negative unumber = uint32(-DATA(idx)); % change sign to positive unumber = bitcmp(unumber,24); % do the complement unumber = unumber +1; % subtract 1 endif MyString(idx,:) = sprintf('0x%06x', unumber); % Formatted data (24-bit fractional integer) endfor toc However, the for-loops (especially the second one) are quite time consuming, so I would like to vectorise them. But somehow everything I tried so far did not work... Thanks in advance for any hint Rolf From highegg at gmail.com Fri Nov 20 05:08:14 2009 From: highegg at gmail.com (Jaroslav Hajek) Date: Fri, 20 Nov 2009 12:08:14 +0100 Subject: help for vectorisation In-Reply-To: <2417729F3416D511A27E0090273A963B02911189@smex01.mbbm.de> References: <2417729F3416D511A27E0090273A963B02911189@smex01.mbbm.de> Message-ID: <69d8d540911200308p7d9b4b54g2837463fa8331759@mail.gmail.com> On Fri, Nov 20, 2009 at 11:13 AM, Schirmacher, Rolf < Rolf.Schirmacher at muellerbbm.de> wrote: > > Hello, > > I need to convert normalised numbers [-1. ... 1.[ to hex strings in 24 bit > fractional format. The most efficient code I have at the moment is as > below: > > > DATA = 2*rand(10000,1)-1; # random data at [-1 .. 1] > > # scale to 24 bit integers > DATA = DATA*2^23; > DATA = round(DATA); > > # first part: check data range > > tic; > for idx = 1:length(DATA) > if DATA(idx) > (2^23)-1 > error(['Data are outside legal range, idx:' num2str(idx)]); > elseif DATA(idx) < -2^23 > error(['Data are outside legal range, idx:' num2str(idx)]); > end > end > toc > > # second part: convert to string array > tic; > MyString = repmat('0x000000', length(DATA), 1); > > for idx= 1:length(DATA) > if sign(DATA(idx))== 1 % number is positive > unumber = uint32(DATA(idx)); > elseif sign(DATA(idx))== 0 % number is positive > unumber = uint32(DATA(idx)); > elseif sign(DATA(idx))== -1 % number is negative > unumber = uint32(-DATA(idx)); % change sign to positive > unumber = bitcmp(unumber,24); % do the complement > unumber = unumber +1; % subtract 1 > endif > MyString(idx,:) = sprintf('0x%06x', unumber); % Formatted data (24-bit > fractional integer) > endfor > toc > > > However, the for-loops (especially the second one) are quite time > consuming, > so I would like to vectorise them. But somehow everything I tried so far > did > not work... > > Thanks in advance for any hint > > Rolf > Here's an approach that's going to work if your signed integers are 2's complement (almost all modern machines). If I understood correctly what you're trying to do. DATA = 2*rand(10000,1)-1; # random data at [-1 .. 1] DATA = bitshift (typecast (int32 (2^31 * DATA), "uint32"), -8); MyString = reshape (sprintf ("0x%06x",DATA), 8, []).' Gosh, if people paid for Octave one-liners, I'd be a millionaire! :D -- RNDr. Jaroslav Hajek computing expert & GNU Octave developer Aeronautical Research and Test Institute (VZLU) Prague, Czech Republic url: www.highegg.matfyz.cz -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091120/edde3ef5/attachment.html From Potorti at isti.cnr.it Fri Nov 20 05:47:24 2009 From: Potorti at isti.cnr.it (Francesco =?utf-8?Q?Potort=C3=AC?=) Date: Fri, 20 Nov 2009 12:47:24 +0100 Subject: help for vectorisation In-Reply-To: <69d8d540911200308p7d9b4b54g2837463fa8331759@mail.gmail.com> References: <2417729F3416D511A27E0090273A963B02911189@smex01.mbbm.de> <69d8d540911200308p7d9b4b54g2837463fa8331759@mail.gmail.com> Message-ID: >Here's an approach that's going to work if your signed integers are 2's >complement (almost all modern machines). Almost? Do modern machines exist out there that do not use 2's complement representation for numbers? -- Francesco Potort? (ricercatore) Voice: +39 050 315 3058 (op.2111) ISTI - Area della ricerca CNR Fax: +39 050 315 2040 via G. Moruzzi 1, I-56124 Pisa Email: Potorti at isti.cnr.it (entrance 20, 1st floor, room C71) Web: http://fly.isti.cnr.it/ From highegg at gmail.com Fri Nov 20 06:20:01 2009 From: highegg at gmail.com (Jaroslav Hajek) Date: Fri, 20 Nov 2009 13:20:01 +0100 Subject: help for vectorisation In-Reply-To: References: <2417729F3416D511A27E0090273A963B02911189@smex01.mbbm.de> <69d8d540911200308p7d9b4b54g2837463fa8331759@mail.gmail.com> Message-ID: <69d8d540911200420g5c2b8268n7619c0ba26fe4572@mail.gmail.com> On Fri, Nov 20, 2009 at 12:47 PM, Francesco Potort? wrote: > >Here's an approach that's going to work if your signed integers are 2's > >complement (almost all modern machines). > > Almost? Do modern machines exist out there that do not use 2's > complement representation for numbers? > > I don't know. I think it depends on what you call "modern". I bet no new ones are being manufactured. -- RNDr. Jaroslav Hajek computing expert & GNU Octave developer Aeronautical Research and Test Institute (VZLU) Prague, Czech Republic url: www.highegg.matfyz.cz -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091120/0e94b803/attachment.html From echassandemottin at gmail.com Fri Nov 20 08:50:57 2009 From: echassandemottin at gmail.com (Eric Chassande-Mottin) Date: Fri, 20 Nov 2009 06:50:57 -0800 (PST) Subject: keyboard does not provide local context Message-ID: <26441995.post@talk.nabble.com> using foo.m below, if I say foo(1) from prompt I get access to local vars octave3.2:1> foo(1) keyboard: stopped in /home/ecm/foo.m a = 1 debug> whos Variables in the current scope: Attr Name Size Bytes Class ==== ==== ==== ===== ===== a 1x1 8 double argn 1x1 1 char f x 1x1 8 double Total is 3 elements using 17 bytes but when calling foo() from a script I don't octave3.2:1> test keyboard: stopped in /home/ecm/foo.m b = 2 a = 1 debug> whos Variables in the current scope: Attr Name Size Bytes Class ==== ==== ==== ===== ===== ans 1x30 30 char b 1x1 8 double Total is 31 elements using 38 bytes why is that? is there a way to access local vars when calling from a script? I am using GNU Octave, version 3.2.3 ======== test.m ============= b=2 foo(1) ============================ ========= foo.m ============== function y=foo(x) a=1 keyboard endfunction ============================ -- View this message in context: http://old.nabble.com/keyboard-does-not-provide-local-context-tp26441995p26441995.html Sent from the Octave - General mailing list archive at Nabble.com. From echassandemottin at gmail.com Fri Nov 20 09:16:43 2009 From: echassandemottin at gmail.com (Eric Chassande-Mottin) Date: Fri, 20 Nov 2009 16:16:43 +0100 Subject: keyboard does not provide local context Message-ID: <75a01c1d0911200716l33236314s1da9791fdb066780@mail.gmail.com> using foo.m below, if I say foo(1) from prompt I get access to local vars octave3.2:1> foo(1) keyboard: stopped in /home/ecm/foo.m a = 1 debug> whos Variables in the current scope: Attr Name Size Bytes Class ==== ==== ==== ===== ===== a 1x1 8 double argn 1x1 1 char f x 1x1 8 double Total is 3 elements using 17 bytes but when calling foo() from a script I don't octave3.2:1> test keyboard: stopped in /home/ecm/foo.m b = 2 a = 1 debug> whos Variables in the current scope: Attr Name Size Bytes Class ==== ==== ==== ===== ===== ans 1x30 30 char b 1x1 8 double Total is 31 elements using 38 bytes why is that? is there a way to access local vars when calling from a script? I am using GNU Octave, version 3.2.3 ======== test.m ============= b=2 foo(1) ============================ ========= foo.m ============== function y=foo(x) a=1 keyboard endfunction ============================ From jwe at octave.org Fri Nov 20 10:01:20 2009 From: jwe at octave.org (John W. Eaton) Date: Fri, 20 Nov 2009 11:01:20 -0500 Subject: keyboard does not provide local context In-Reply-To: <75a01c1d0911200716l33236314s1da9791fdb066780@mail.gmail.com> References: <75a01c1d0911200716l33236314s1da9791fdb066780@mail.gmail.com> Message-ID: <19206.48464.134641.483029@segfault.lan> On 20-Nov-2009, Eric Chassande-Mottin wrote: | using foo.m below, | if I say foo(1) from prompt I get access to local vars | | octave3.2:1> foo(1) | keyboard: stopped in /home/ecm/foo.m | a = 1 | debug> whos | Variables in the current scope: | | Attr Name Size Bytes Class | ==== ==== ==== ===== ===== | a 1x1 8 double | argn 1x1 1 char | f x 1x1 8 double | | Total is 3 elements using 17 bytes | | but when calling foo() from a script I don't | | octave3.2:1> test | keyboard: stopped in /home/ecm/foo.m | b = 2 | a = 1 | debug> whos | Variables in the current scope: | | Attr Name Size Bytes Class | ==== ==== ==== ===== ===== | ans 1x30 30 char | b 1x1 8 double | | Total is 31 elements using 38 bytes | | why is that? is there a way to access local vars when calling from a script? | | I am using | | GNU Octave, version 3.2.3 It's best to report bugs to the bug at octave.org list. This problem has been reported several times now and it is fixed in the current development version of Octave. I think the relevant patches are http://hg.savannah.gnu.org/hgweb/octave/rev/fb22dd5d6242 http://hg.savannah.gnu.org/hgweb/octave/rev/25c2e92ee03c http://hg.savannah.gnu.org/hgweb/octave/rev/bbe033dcfe13 Jaroslav, I think it is safe to apply the first two to the 3.2.x branch. I'm not so sure about the third one though as it removes some variables from a class and changes at least one function signature, which might cause some binary compatibility problems. jwe From echassandemottin at gmail.com Fri Nov 20 11:27:15 2009 From: echassandemottin at gmail.com (Eric Chassande-Mottin) Date: Fri, 20 Nov 2009 09:27:15 -0800 (PST) Subject: CUDA acceleration in GNU Octave Message-ID: <26443596.post@talk.nabble.com> is anyone working on porting CUDA acceleration scheme (for 2D FFT) on GNU Octave ? ? -- View this message in context: http://old.nabble.com/CUDA-acceleration-in-GNU-Octave-tp26443596p26443596.html Sent from the Octave - General mailing list archive at Nabble.com. From david at materialintelligencellc.com Fri Nov 20 11:29:04 2009 From: david at materialintelligencellc.com (david at materialintelligencellc.com) Date: Fri, 20 Nov 2009 12:29:04 -0500 Subject: octave+bash Message-ID: <000901ca6a06$f58591c0$e090b540$@com> Dear octave community, I would like to pass variables into an octave function from within a bash script. I realize this may be a bash question rather than an octave question, any help will be appreciated. The following test file and one line script works, Octave function: function TestTraining(samplestring,ss2) disp(samplestring) disp(ss2) endfunction bash script: octave --silent --eval 'Test("test string","Nice try")' What I'm trying to do is pass a bash variable into the octave interface. Something like the following, Var="Nice try" octave -silent -eval 'Test("test string",$Var)' What can be done with $Var so that octave recognizes it as "Nice try"? Thanks in advance for your assistance David -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091120/8ca75b9e/attachment-0001.html From n3mo at email.it Fri Nov 20 11:19:29 2009 From: n3mo at email.it (n3mo) Date: Fri, 20 Nov 2009 09:19:29 -0800 (PST) Subject: function sigma number theory Message-ID: <26443592.post@talk.nabble.com> hi I'm searching the function sigma of number theory, where it calculate the sum of all prime factors of a number, f.e. sigma (10)=1+2+5+10 I would like to know if it's defined in the library of octave or matlab and how call it as a function. thanks! -- View this message in context: http://old.nabble.com/function-sigma-number-theory-tp26443592p26443592.html Sent from the Octave - General mailing list archive at Nabble.com. From stefan.holst at uk.cd-adapco.com Fri Nov 20 07:44:45 2009 From: stefan.holst at uk.cd-adapco.com (Stefan Holst) Date: Fri, 20 Nov 2009 14:44:45 +0100 Subject: problem compiling octave package java on cygwin 1.7 Message-ID: <4B069D4D.1090905@uk.cd-adapco.com> Hi Marco, after working my way through all the packages that octave does not declare as being dependent on, but mkoctfile actually needs, I still get to the following problem: I'm curious to get jhandles to work. The first step is to get the java package installed. And there I'm getting stuck. I tried to do it inside octave using pkg install But this does not succeed. Now I try to perform ./configure and make manually and get to the following problem: make[1]: Entering directory `/home/stefanh/java-1.2.6/src' if [ "XX" = "XX" ]; then \ mkoctfile -DHAVE_OCTAVE_32 -v -DJAVAPKG_BUILD -IC:"/home/stefanh /JVM/include" -IC:"/home/stefanh/JVM/include/win32" -o __java__.oct __java__.cc -ladvapi32; \ else \ mkoctfile -DHAVE_OCTAVE_32 -v -DJAVAPKG_BUILD -DJAVA_ARCH=\\\"\\ \" -DJAVA_HOME=\\\"/home/stefanh/JVM\\\" -IC:"/home/stefanh/JVM/include" -IC:"/h ome/stefanh/JVM/include/win32" -o __java__.oct __java__.cc -ladvapi32; \ fi g++-4 -c -I/usr/include/octave-3.2.3 -I/usr/include/octave-3.2.3/octave -mieee-f p -O2 -pipe -IC:/home/stefanh/JVM/include -IC:/home/stefanh/JVM/include/win32 -D HAVE_OCTAVE_32 -DJAVAPKG_BUILD __java__.cc -o __java__.o __java__.cc: In function `void initialize_jvm()': __java__.cc:339: error: `JAVA_HOME' was not declared in this scope __java__.cc:339: error: `JAVA_ARCH' was not declared in this scope lots of warnings afterwards. From the little that I understand I think __java__.cc does not recognize the cygwin environment. At least __WIN32__ does not seem to be defined and there are no other pragmas that cater for cygwin. Can your or Michael have a look at this? Many many thanks in advance. A strong m-file addict From jwe at octave.org Fri Nov 20 12:02:40 2009 From: jwe at octave.org (John W. Eaton) Date: Fri, 20 Nov 2009 13:02:40 -0500 Subject: octave+bash In-Reply-To: <000901ca6a06$f58591c0$e090b540$@com> References: <000901ca6a06$f58591c0$e090b540$@com> Message-ID: <19206.55744.882267.211465@segfault.lan> On 20-Nov-2009, david at materialintelligencellc.com wrote: | Var="Nice try" | | octave -silent -eval 'Test("test string",$Var)' Yes, it's a bash quoting question. Here's one way you can do it: octave --silent --eval "Test (\"test string\", \"$Var\")" jwe From christy1865 at gmail.com Fri Nov 20 13:05:56 2009 From: christy1865 at gmail.com (Kristen Richter) Date: Fri, 20 Nov 2009 14:05:56 -0500 Subject: Printing a figure as a png... This should be basic! Message-ID: Hi Octave family, I feel rather embarrassed, but I have been unable to print a figure as a png despite several searches on help forums. The commands I am using are as follows: print('graph.png','-dpng') And I get the following error: octave:13> print('graph1','-dpng') gnuplot> set terminal png enhanced size 1200,900 ^ line 0: unknown or ambiguous terminal type; type just 'set terminal' for a list line 0: No terminal defined gnuplot> plot "-" binary format='%float64' record=15 using ($1):($2) axes x1y1 title "" with lines linestyle 1 , "-" binary format='%float64' record=15 using ($1):($2) axes x1y1 title "" with lines linestyle 2 , "-" binary format='%float64' record=15 using ($1):($2) axes x1y1 title "" with lines linestyle 3 , "-" binary format='%float64' record=15 using ($1):($2) axes x1y1 title "" with lines linestyle 4 , "-" binary format='%float64' record=15 using ($1):($2) axes x1y1 title "" with lines linestyle 5 , "-" binary format='%float64' record=15 using ($1):($2) axes x1y1 title "" with lines linestyle 6 ; ^ line 0: use 'set term' to set terminal type first gnuplot> @??????g@??~???(@ ^ line 0: invalid character @ gnuplot> ??#)@ ^ line 0: invalid character ? This error also applies to attempting to print as a jpeg, but not as an eps... Perhaps because it doesn't have to convert the file? Searching google for the first two lines of the error message gives results reporting problems related to a multitude of plotting functionalities in multiple versions of Octave on different operating systems. Is there something simple I can correct to print a png (running Octave 3.2.2 and Ubuntu)? Thank you in advance for your help. I'd appreciate any advice. -Kristen -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091120/b4cc6b0f/attachment.html From david at materialintelligencellc.com Fri Nov 20 14:06:02 2009 From: david at materialintelligencellc.com (david at materialintelligencellc.com) Date: Fri, 20 Nov 2009 15:06:02 -0500 Subject: octave+bash In-Reply-To: <19206.55744.882267.211465@segfault.lan> References: <000901ca6a06$f58591c0$e090b540$@com> <19206.55744.882267.211465@segfault.lan> Message-ID: <000e01ca6a1c$e3733fd0$aa59bf70$@com> John, That did it. Thanks. David -----Original Message----- From: John W. Eaton [mailto:jwe at octave.org] Sent: Friday, November 20, 2009 1:03 PM To: david at materialintelligencellc.com Cc: help at octave.org Subject: octave+bash On 20-Nov-2009, david at materialintelligencellc.com wrote: | Var="Nice try" | | octave -silent -eval 'Test("test string",$Var)' Yes, it's a bash quoting question. Here's one way you can do it: octave --silent --eval "Test (\"test string\", \"$Var\")" jwe From highegg at gmail.com Fri Nov 20 14:20:21 2009 From: highegg at gmail.com (Jaroslav Hajek) Date: Fri, 20 Nov 2009 21:20:21 +0100 Subject: Printing a figure as a png... This should be basic! In-Reply-To: References: Message-ID: <69d8d540911201220t757b59baw1f14eacdb96dd8a6@mail.gmail.com> On Fri, Nov 20, 2009 at 8:05 PM, Kristen Richter wrote: > Hi Octave family, > > I feel rather embarrassed, but I have been unable to print a figure as a > png despite several searches on help forums. > > The commands I am using are as follows: > print('graph.png','-dpng') > > And I get the following error: > > octave:13> print('graph1','-dpng') > > gnuplot> set terminal png enhanced size 1200,900 > ^ > line 0: unknown or ambiguous terminal type; type just 'set > terminal' for a list > > line 0: No terminal defined > > > gnuplot> plot "-" binary format='%float64' record=15 using ($1):($2) axes > x1y1 title "" with lines linestyle 1 , "-" binary format='%float64' > record=15 using ($1):($2) axes x1y1 title "" with lines linestyle 2 , "-" > binary format='%float64' record=15 using ($1):($2) axes x1y1 title "" with > lines linestyle 3 , "-" binary format='%float64' record=15 using ($1):($2) > axes x1y1 title "" with lines linestyle 4 , "-" binary format='%float64' > record=15 using ($1):($2) axes x1y1 title "" with lines linestyle 5 , "-" > binary format='%float64' record=15 using ($1):($2) axes x1y1 title "" with > lines linestyle 6 ; > ^ > line 0: use 'set term' to set terminal type first > > > gnuplot> @??????g@??~???(@ > ^ > line 0: invalid character @ > > > gnuplot> ??#)@ > ^ > line 0: invalid character ? > > > This error also applies to attempting to print as a jpeg, but not as an > eps... Perhaps because it doesn't have to convert the file? > > Searching google for the first two lines of the error message gives results > reporting problems related to a multitude of plotting functionalities in > multiple versions of Octave on different operating systems. Is there > something simple I can correct to print a png (running Octave 3.2.2 and > Ubuntu)? > > Thank you in advance for your help. I'd appreciate any advice. > > -Kristen > > You need to install gnuplot with png support. -- RNDr. Jaroslav Hajek computing expert & GNU Octave developer Aeronautical Research and Test Institute (VZLU) Prague, Czech Republic url: www.highegg.matfyz.cz -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091120/9ba184b9/attachment.html From storrsjm at email.uc.edu Fri Nov 20 14:31:09 2009 From: storrsjm at email.uc.edu (Judd Storrs) Date: Fri, 20 Nov 2009 15:31:09 -0500 Subject: Pytave licensing In-Reply-To: <69d8d540911200103y4c7fb857v83292918918bf2ab@mail.gmail.com> References: <0EA9662A402E6A4B88078E93D7F20D7B78472D@x346-001w2k3.sup2000.sup-logistik.de> <4B04F503.3060202@acc.umu.se> <1258618206.2867.92.camel@hauberg-laptop> <4B0500E1.1030302@acc.umu.se> <65daf6a60911190052j55e565fct500d5b295200f709@mail.gmail.com> <4B050B27.9020705@acc.umu.se> <65daf6a60911190226u35323662xa59899678496776f@mail.gmail.com> <69d8d540911190300l450874c7j6749f9774986e6ce@mail.gmail.com> <69d8d540911200103y4c7fb857v83292918918bf2ab@mail.gmail.com> Message-ID: On Fri, Nov 20, 2009 at 4:03 AM, Jaroslav Hajek wrote: >> Not nonsense, really. Ulrich is hitting the nail very squarely on the >> head. You could very, very, very easily write a python script that >> receives any pytave-like object as a parameter without importing >> pytave. > > Example? def foo(a): b = a.feval("foo") return b Now, let me clarify a few things about my original statement that seem to have been forgotten. Using a module affects the licensing of the interpreter. You can't distribute an interpreter that combines GPL and non-GPL-compatible modules. Also, please remember that the GPL doesn't magically exclude only closed-source works. For me, personally, the pain point is the inability to mix GPLv3 and GPLv2 software. --judd From storrsjm at email.uc.edu Fri Nov 20 14:36:23 2009 From: storrsjm at email.uc.edu (Judd Storrs) Date: Fri, 20 Nov 2009 15:36:23 -0500 Subject: calling octave from C In-Reply-To: <69d8d540911200154k7fb5c769t68688d402ce900c@mail.gmail.com> References: <0EA9662A402E6A4B88078E93D7F20D7B78472D@x346-001w2k3.sup2000.sup-logistik.de> <69d8d540911180842keb467b5wfabe7e3a0829c4b2@mail.gmail.com> <19204.17671.959294.725312@segfault.lan> <4B047269.3000606@acc.umu.se> <69d8d540911190248y4f490eb2mbe340a0772a39e60@mail.gmail.com> <69d8d540911200154k7fb5c769t68688d402ce900c@mail.gmail.com> Message-ID: On Fri, Nov 20, 2009 at 4:54 AM, Jaroslav Hajek wrote: > On Thu, Nov 19, 2009 at 6:54 PM, Judd Storrs wrote: >> How can forbidding non-GPL python files be justified while >> simultaneously allowing use of non-GPL m-files? How does the GPL >> choose to favor one interpreted language over another? > > It doesn't. It's using the bindings that make the difference. At least FSF > thinks so. Doesn't any m-file executed through pytave uses the same bindings? --judd From dastew at sympatico.ca Fri Nov 20 14:37:50 2009 From: dastew at sympatico.ca (dastew at sympatico.ca) Date: Fri, 20 Nov 2009 20:37:50 +0000 Subject: function sigma number theory In-Reply-To: <26443592.post@talk.nabble.com> References: <26443592.post@talk.nabble.com> Message-ID: try x=10 y=sum(factor(x))+1+x doug > Date: Fri, 20 Nov 2009 09:19:29 -0800 > From: n3mo at email.it > To: help-octave at octave.org > Subject: function sigma number theory > > > hi > > I'm searching the function sigma of number theory, where it calculate the > sum of all prime factors of a number, f.e. > > sigma (10)=1+2+5+10 > > I would like to know if it's defined in the library of octave or matlab and > how call it as a function. > > thanks! > -- > View this message in context: http://old.nabble.com/function-sigma-number-theory-tp26443592p26443592.html > Sent from the Octave - General mailing list archive at Nabble.com. > > _______________________________________________ > Help-octave mailing list > Help-octave at octave.org > https://www-old.cae.wisc.edu/mailman/listinfo/help-octave -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091120/7f516398/attachment.html From highegg at gmail.com Fri Nov 20 14:47:48 2009 From: highegg at gmail.com (Jaroslav Hajek) Date: Fri, 20 Nov 2009 21:47:48 +0100 Subject: function sigma number theory In-Reply-To: <26443592.post@talk.nabble.com> References: <26443592.post@talk.nabble.com> Message-ID: <69d8d540911201247s2ff0d848q4cb3301e20b65230@mail.gmail.com> On Fri, Nov 20, 2009 at 6:19 PM, n3mo wrote: > > hi > > I'm searching the function sigma of number theory, where it calculate the > sum of all prime factors of a number, f.e. > > sigma (10)=1+2+5+10 > sigma is not the sum of prime factors, but the sum of all divisors. -- RNDr. Jaroslav Hajek computing expert & GNU Octave developer Aeronautical Research and Test Institute (VZLU) Prague, Czech Republic url: www.highegg.matfyz.cz -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091120/aea2f5b9/attachment-0001.html From highegg at gmail.com Fri Nov 20 14:58:14 2009 From: highegg at gmail.com (Jaroslav Hajek) Date: Fri, 20 Nov 2009 21:58:14 +0100 Subject: calling octave from C In-Reply-To: References: <0EA9662A402E6A4B88078E93D7F20D7B78472D@x346-001w2k3.sup2000.sup-logistik.de> <19204.17671.959294.725312@segfault.lan> <4B047269.3000606@acc.umu.se> <69d8d540911190248y4f490eb2mbe340a0772a39e60@mail.gmail.com> <69d8d540911200154k7fb5c769t68688d402ce900c@mail.gmail.com> Message-ID: <69d8d540911201258k7c4febc7neee1579faddddd9b@mail.gmail.com> On Fri, Nov 20, 2009 at 9:36 PM, Judd Storrs wrote: > On Fri, Nov 20, 2009 at 4:54 AM, Jaroslav Hajek wrote: > > On Thu, Nov 19, 2009 at 6:54 PM, Judd Storrs > wrote: > >> How can forbidding non-GPL python files be justified while > >> simultaneously allowing use of non-GPL m-files? How does the GPL > >> choose to favor one interpreted language over another? > > > > It doesn't. It's using the bindings that make the difference. At least > FSF > > thinks so. > > Doesn't any m-file executed through pytave uses the same bindings? > > No, surely not. The m-file is just being passed through, it doesn't "know" anything about the bindings. I see other logical problems with the FSF's position, but I think you should best ask FSF for clarification. -- RNDr. Jaroslav Hajek computing expert & GNU Octave developer Aeronautical Research and Test Institute (VZLU) Prague, Czech Republic url: www.highegg.matfyz.cz -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091120/3bad5c69/attachment.html From Rolf.Schirmacher at MuellerBBM.de Fri Nov 20 15:03:17 2009 From: Rolf.Schirmacher at MuellerBBM.de (Schirmacher, Rolf) Date: Fri, 20 Nov 2009 22:03:17 +0100 Subject: help for vectorisation Message-ID: <2417729F3416D511A27E0090273A963B02911190@smex01.mbbm.de> -----Original Message----- From: Jaroslav Hajek [mailto:highegg at gmail.com] Sent: Friday, November 20, 2009 12:08 PM To: Schirmacher, Rolf Cc: help-octave at octave.org Subject: Re: help for vectorisation Here's an approach that's going to work if your signed integers are 2's complement (almost all modern machines). If I understood correctly what you're trying to do. DATA = 2*rand(10000,1)-1; # random data at [-1 .. 1] DATA = bitshift (typecast (int32 (2^31 * DATA), "uint32"), -8); MyString = reshape (sprintf ("0x%06x",DATA), 8, []).' Gosh, if people paid for Octave one-liners, I'd be a millionaire! :D -- RNDr. Jaroslav Hajek computing expert & GNU Octave developer Aeronautical Research and Test Institute (VZLU) Prague, Czech Republic url: www.highegg.matfyz.cz Thanks Jaroslav, The nice thing about octave is that you can do all that in one line - and unfortunately I am not aware of at least half the tricks you know. E.g., I have never thought about reshaping sprintf-output - stupid. Works great and is really MUCH faster of course - as all your code! Rolf -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091120/c59a6b57/attachment.html From storrsjm at email.uc.edu Fri Nov 20 15:19:48 2009 From: storrsjm at email.uc.edu (Judd Storrs) Date: Fri, 20 Nov 2009 16:19:48 -0500 Subject: calling octave from C In-Reply-To: <69d8d540911201258k7c4febc7neee1579faddddd9b@mail.gmail.com> References: <0EA9662A402E6A4B88078E93D7F20D7B78472D@x346-001w2k3.sup2000.sup-logistik.de> <4B047269.3000606@acc.umu.se> <69d8d540911190248y4f490eb2mbe340a0772a39e60@mail.gmail.com> <69d8d540911200154k7fb5c769t68688d402ce900c@mail.gmail.com> <69d8d540911201258k7c4febc7neee1579faddddd9b@mail.gmail.com> Message-ID: On Fri, Nov 20, 2009 at 3:58 PM, Jaroslav Hajek wrote: > No, surely not. The m-file is just being passed through, it doesn't "know" > anything about the bindings. I'm not sure what you mean by "know" and really what that has to do with the GPL. Both interpreters are combined to the same executable--you have a black box with two streams of input data. On the one side you have the octave interpreter reading m-files. On the other side you have the python interpreter reading python files. My question is how specifically you can distinguish between the two streams such that different licensing conditions are applied to the two streams. If you can't explain why one stream is different from the other, you can't have it both ways. It's all or nothing. --judd From marco_atzeri at yahoo.it Fri Nov 20 15:10:46 2009 From: marco_atzeri at yahoo.it (Marco Atzeri) Date: Fri, 20 Nov 2009 21:10:46 +0000 (GMT) Subject: R: problem compiling octave package java on cygwin 1.7 In-Reply-To: <4B069D4D.1090905@uk.cd-adapco.com> Message-ID: <190606.99365.qm@web25502.mail.ukl.yahoo.com> > Da: Stefan Holst > Oggetto: problem compiling octave package java on cygwin 1.7 > A: marco_atzeri at yahoo.it > Cc: help at octave.org > Data: Venerd? 20 novembre 2009, 14:44 > Hi Marco, > > after working my way through all the packages that octave > does not declare as being dependent on, but mkoctfile > actually needs, I still get to the following problem: > I'm curious to get jhandles to work. The first step is to > get the java package installed. And there I'm getting stuck. > I tried to do it inside octave using pkg install > But this does not succeed. Now I try to perform ./configure > and make manually and get to the following problem: > make[1]: Entering directory `/home/stefanh/java-1.2.6/src' > if [ "XX" = "XX" ]; then \ > ? ? ? ? ? ? > ???mkoctfile -DHAVE_OCTAVE_32 -v > -DJAVAPKG_BUILD -IC:"/home/stefanh > /JVM/include" -IC:"/home/stefanh/JVM/include/win32" -o > __java__.oct __java__.cc > -ladvapi32; \ > ? ? ???else \ > ? ? ? ? ? ? > ???mkoctfile -DHAVE_OCTAVE_32 -v > -DJAVAPKG_BUILD -DJAVA_ARCH=\\\"\\ > \" -DJAVA_HOME=\\\"/home/stefanh/JVM\\\" > -IC:"/home/stefanh/JVM/include" -IC:"/h > ome/stefanh/JVM/include/win32" -o __java__.oct __java__.cc > -ladvapi32; \ > ? ? ???fi > g++-4 -c -I/usr/include/octave-3.2.3 > -I/usr/include/octave-3.2.3/octave -mieee-f > p -O2 -pipe -IC:/home/stefanh/JVM/include > -IC:/home/stefanh/JVM/include/win32 -D > HAVE_OCTAVE_32 -DJAVAPKG_BUILD __java__.cc -o __java__.o > __java__.cc: In function `void initialize_jvm()': > __java__.cc:339: error: `JAVA_HOME' was not declared in > this scope > __java__.cc:339: error: `JAVA_ARCH' was not declared in > this scope > > lots of warnings afterwards. From the little that I? > understand I think __java__.cc does not recognize the cygwin > environment. At least __WIN32__ does not seem to be defined > and there are no other pragmas that cater for cygwin. Can > your or Michael have a look at this? Many many thanks in > advance. > > A strong m-file addict > Hi Stefan, as there is no real java package on cygwin, why do you thinks that octave can overcome this problem ? I skipped some package of octave forge for this type of problems. Regards Marco From rs at 2-3-2.com Fri Nov 20 14:22:26 2009 From: rs at 2-3-2.com (rs-232) Date: Fri, 20 Nov 2009 12:22:26 -0800 (PST) Subject: Sound File Images? Message-ID: <26447356.post@talk.nabble.com> Pardon the Noob question, but does anyone know the best method for transferring the data from a range of samples of a sound file into a printable image file? Thanks in advance! -- View this message in context: http://old.nabble.com/Sound-File-Images--tp26447356p26447356.html Sent from the Octave - General mailing list archive at Nabble.com. From thomas.weber.mail at gmail.com Fri Nov 20 16:06:38 2009 From: thomas.weber.mail at gmail.com (Thomas Weber) Date: Fri, 20 Nov 2009 23:06:38 +0100 Subject: CUDA acceleration in GNU Octave In-Reply-To: <26443596.post@talk.nabble.com> References: <26443596.post@talk.nabble.com> Message-ID: <20091120220638.GB8678@atlan> On Fri, Nov 20, 2009 at 09:27:15AM -0800, Eric Chassande-Mottin wrote: > > is anyone working on porting CUDA acceleration scheme (for 2D FFT) on GNU > Octave ? Octave uses FFTW for FFT, so if your FFTW library uses CUDA, so does Octave. Thomas From dbateman at dbateman.org Fri Nov 20 15:47:26 2009 From: dbateman at dbateman.org (David Bateman) Date: Fri, 20 Nov 2009 22:47:26 +0100 Subject: CUDA acceleration in GNU Octave In-Reply-To: <26443596.post@talk.nabble.com> References: <26443596.post@talk.nabble.com> Message-ID: <4B070E6E.8030607@dbateman.org> Eric Chassande-Mottin wrote: > > is anyone working on porting CUDA acceleration scheme (for 2D FFT) on GNU > Octave ? > > ? > Search the lists there has been some discussion recently. However, I'd personally rather an OpenCL binding, even though OpenCL is still less complete than Cuda, because I'd rather not tie my code to a single hardware supplier D. From pavel.schor at email.cz Fri Nov 20 13:17:18 2009 From: pavel.schor at email.cz (Pavel Schor) Date: Fri, 20 Nov 2009 20:17:18 +0100 Subject: Printing a figure as a png... This should be basic! In-Reply-To: References: Message-ID: <1258744638.2688.3.camel@pavel-laptop> Hi, I had same problem, in my case it was missing library. I mentioned my solution here 2 months ago: in octave3.2 with gnuplot 4.2.5 on ubuntu 9.04 I was not able to save plot as .png image.... Problem was in missing library libgd. I downloaded it from www.libgd.org, and then I have recompiled gnuplot. After that everything is OK. Kristen Richter p??e v P? 20. 11. 2009 v 20:05 +0100: > Hi Octave family, > > I feel rather embarrassed, but I have been unable to print a figure as > a png despite several searches on help forums. > > The commands I am using are as follows: > print('graph.png','-dpng') > > And I get the following error: > > octave:13> print('graph1','-dpng') > > gnuplot> set terminal png enhanced size 1200,900 > ^ > line 0: unknown or ambiguous terminal type; type just 'set > terminal' for a list > > line 0: No terminal defined > > > gnuplot> plot "-" binary format='%float64' record=15 using ($1):($2) > axes x1y1 title "" with lines linestyle 1 , "-" binary format='% > float64' record=15 using ($1):($2) axes x1y1 title "" with lines > linestyle 2 , "-" binary format='%float64' record=15 using ($1):($2) > axes x1y1 title "" with lines linestyle 3 , "-" binary format='% > float64' record=15 using ($1):($2) axes x1y1 title "" with lines > linestyle 4 , "-" binary format='%float64' record=15 using ($1):($2) > axes x1y1 title "" with lines linestyle 5 , "-" binary format='% > float64' record=15 using ($1):($2) axes x1y1 title "" with lines > linestyle 6 ; > ^ > line 0: use 'set term' to set terminal type first > > > gnuplot> @??????g@??~???(@ > ^ > line 0: invalid character @ > > > gnuplot> ??#)@ > ^ > line 0: invalid character ? > > > This error also applies to attempting to print as a jpeg, but not as > an eps... Perhaps because it doesn't have to convert the file? > > Searching google for the first two lines of the error message gives > results reporting problems related to a multitude of plotting > functionalities in multiple versions of Octave on different operating > systems. Is there something simple I can correct to print a png > (running Octave 3.2.2 and Ubuntu)? > > Thank you in advance for your help. I'd appreciate any advice. > > -Kristen > > _______________________________________________ > Help-octave mailing list > Help-octave at octave.org > https://www-old.cae.wisc.edu/mailman/listinfo/help-octave From highegg at gmail.com Fri Nov 20 23:13:11 2009 From: highegg at gmail.com (Jaroslav Hajek) Date: Sat, 21 Nov 2009 06:13:11 +0100 Subject: calling octave from C In-Reply-To: References: <0EA9662A402E6A4B88078E93D7F20D7B78472D@x346-001w2k3.sup2000.sup-logistik.de> <69d8d540911190248y4f490eb2mbe340a0772a39e60@mail.gmail.com> <69d8d540911200154k7fb5c769t68688d402ce900c@mail.gmail.com> <69d8d540911201258k7c4febc7neee1579faddddd9b@mail.gmail.com> Message-ID: <69d8d540911202113h6a365d11v1490b75673d949bd@mail.gmail.com> On Fri, Nov 20, 2009 at 10:19 PM, Judd Storrs wrote: > On Fri, Nov 20, 2009 at 3:58 PM, Jaroslav Hajek wrote: > > No, surely not. The m-file is just being passed through, it doesn't > "know" > > anything about the bindings. > > I'm not sure what you mean by "know" and really what that has to do > with the GPL. > > It's clear, isn't it? The Python script uses calls to Pytave functions. The Octave script doesn't. Octave is being embedded, but the Octave scripts are unchanged. Both interpreters are combined to the same executable--you have a > black box with two streams of input data. On the one side you have the > octave interpreter reading m-files. On the other side you have the > python interpreter reading python files. My question is how > specifically you can distinguish between the two streams such that > different licensing conditions are applied to the two streams. If you > can't explain why one stream is different from the other, you can't > have it both ways. It's all or nothing. > > w.r.t. Pytave, they are clearly distinguishable; one calls Pytave, the other doesn't. Of course, we should ask: what happens if Pytave becomes an integral part of Python? Let's bundle Python, Octave and Pytave together, and call the result PythonOctave. Both licenses (GPL and Python) allow us to do that. The result will be GPL, of course, but now, using pytave really doesn't differ from using any other built-in module. And the FSF's FAQ states that licensing doesn't apply to plain scripts, just scripts using bindings. So it appears that it depends whether you treat the software bundle as three products or just one. That's why I suggested you ask FSF directly, and perhaps show the some arguments in this discussion. -- RNDr. Jaroslav Hajek computing expert & GNU Octave developer Aeronautical Research and Test Institute (VZLU) Prague, Czech Republic url: www.highegg.matfyz.cz -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091121/7207ac3e/attachment.html From echassandemottin at gmail.com Sat Nov 21 02:40:36 2009 From: echassandemottin at gmail.com (Eric Chassande-Mottin) Date: Sat, 21 Nov 2009 00:40:36 -0800 (PST) Subject: CUDA acceleration in GNU Octave In-Reply-To: <20091120220638.GB8678@atlan> References: <26443596.post@talk.nabble.com> <20091120220638.GB8678@atlan> Message-ID: <26454141.post@talk.nabble.com> >> is anyone working on porting CUDA acceleration scheme (for 2D FFT) on GNU >> Octave ? > > Octave uses FFTW for FFT, so if your FFTW library uses CUDA, so does > Octave. I don't think this is a correct statement. fftw does not seem to support calls to GPU. could you point me to a reference? thanks, ?ric -- View this message in context: http://old.nabble.com/CUDA-acceleration-in-GNU-Octave-tp26443596p26454141.html Sent from the Octave - General mailing list archive at Nabble.com. From thomas.weber.mail at gmail.com Sat Nov 21 04:26:35 2009 From: thomas.weber.mail at gmail.com (Thomas Weber) Date: Sat, 21 Nov 2009 11:26:35 +0100 Subject: CUDA acceleration in GNU Octave In-Reply-To: <26454141.post@talk.nabble.com> References: <26443596.post@talk.nabble.com> <20091120220638.GB8678@atlan> <26454141.post@talk.nabble.com> Message-ID: <20091121102635.GA20721@atlan> On Sat, Nov 21, 2009 at 12:40:36AM -0800, Eric Chassande-Mottin wrote: > > >> is anyone working on porting CUDA acceleration scheme (for 2D FFT) on GNU > >> Octave ? > > > > Octave uses FFTW for FFT, so if your FFTW library uses CUDA, so does > > Octave. > > I don't think this is a correct statement. > fftw does not seem to support calls to GPU. > could you point me to a reference? I didn't say that FFTW supports CUDA. I said: *if* it supports it, Octave will benefit from it without further work. I have no idea about CUDA support in any library out there. I also don't think it makes much sense to create free software and then tie yourself to just one hardware vendor, but that's probably just me. Thomas From individ at acc.umu.se Sat Nov 21 05:24:42 2009 From: individ at acc.umu.se (David Grundberg) Date: Sat, 21 Nov 2009 12:24:42 +0100 Subject: calling octave from C In-Reply-To: References: <0EA9662A402E6A4B88078E93D7F20D7B78472D@x346-001w2k3.sup2000.sup-logistik.de> <4B047269.3000606@acc.umu.se> <69d8d540911190248y4f490eb2mbe340a0772a39e60@mail.gmail.com> <69d8d540911200154k7fb5c769t68688d402ce900c@mail.gmail.com> <69d8d540911201258k7c4febc7neee1579faddddd9b@mail.gmail.com> Message-ID: <4B07CDFA.8060808@acc.umu.se> Judd Storrs skrev: > On Fri, Nov 20, 2009 at 3:58 PM, Jaroslav Hajek wrote: > >> No, surely not. The m-file is just being passed through, it doesn't "know" >> anything about the bindings. >> > > I'm not sure what you mean by "know" and really what that has to do > with the GPL. > > Both interpreters are combined to the same executable--you have a > black box with two streams of input data. On the one side you have the > octave interpreter reading m-files. On the other side you have the > python interpreter reading python files. My question is how > specifically you can distinguish between the two streams such that > different licensing conditions are applied to the two streams. If you > can't explain why one stream is different from the other, you can't > have it both ways. It's all or nothing. > > > --judd > You are confusing the interpreter situation with the script-calling-script situation. You are also oversimplifying the situation. Let's consider a situation where the Python interpreter and Octave interpreter are combined into one executable, even if this is not the case. Then yes, both .py and .m files would be treated as data and would not need to abide the interpreter's GPL license. But if one of the py or m files is GPL, then you have to GPL all py and m files. (If you want to distribute it) Now let's see what we have. We have .py files. If you use a GPL'd py-file from one of your py-files, then you have to abide the GPL. The situation is analogous with m-files. If you use a GPL'd m-file from one of your m-files, then you are deriving the first m-file and have to abide the GPL. If this weren't so, GPL would be essentially ineffective in Python scripts, m-files or any other interpretive environment. Also, you have to recognize that the characteristics of the interpreter does not matter. Otherwise somebody would be able to create a rogue interpreter/compiler under some other license and make use of GPL'd script files with no consequences, distributing them bundled with proprietary scripts. Clearly that is absurd. With Pytave, we have on the one side py-files, which I argue must abide the GPL. One the other side we have m-files, which are treated as data to the Octave interpreter. So since Pytave is a py-file all py files using it must abide the GPL. (script-to-script situation) But the m-files are interpreted, so they are treated as data. (interpreter situation) But if one of the m-files are GPL, then it is the script-to-script situation again, and you have to make sure all m-files abide the GPL. David From sergstesh at yahoo.com Sat Nov 21 11:19:15 2009 From: sergstesh at yahoo.com (Sergei Steshenko) Date: Sat, 21 Nov 2009 09:19:15 -0800 (PST) Subject: CUDA acceleration in GNU Octave In-Reply-To: <20091121102635.GA20721@atlan> Message-ID: <316990.72436.qm@web112106.mail.gq1.yahoo.com> --- On Sat, 11/21/09, Thomas Weber wrote: > From: Thomas Weber > Subject: Re: CUDA acceleration in GNU Octave > To: "Eric Chassande-Mottin" > Cc: help-octave at octave.org > Date: Saturday, November 21, 2009, 2:26 AM > On Sat, Nov 21, 2009 at 12:40:36AM > -0800, Eric Chassande-Mottin wrote: > > > > >> is anyone working on porting CUDA > acceleration scheme (for 2D FFT) on GNU > > >> Octave ? > > > > > > Octave uses FFTW for FFT, so if your FFTW library > uses CUDA, so does > > > Octave. > > > > I don't think this is a correct statement. > > fftw does not seem to support calls to GPU. > > could you point me to a reference? > > I didn't say that FFTW supports CUDA. I said: *if* it > supports it, > Octave will benefit from it without further work. > > I have no idea about CUDA support in any library out there. > I also don't > think it makes much sense to create free software and then > tie yourself > to just one hardware vendor, but that's probably just me. > > ??? Thomas Well, nobody prevents you from creating fast working non-free software tied to one vendor :). And my pretty non-exotic motherboard has on-board NVidia video chip. OTOH, on top of my CRT monitor one can see an ATI-based graphics card :) - used to work fine, but I do not need to graphics card at the same time. Similar technology from AMD/ATI: http://developer.amd.com/gpu/ATIStreamSDK/Pages/default.aspx . They mention 'Brook+' - the latter has been around for quite some time. They have it for Linux: http://developer.amd.com/gpu/acmlgpu/Pages/default.aspx -> http://developer.amd.com/Downloads/acmlg1.0.tgz . Remember, "at home" (i.e. without redistribution) you can create and link together whatever software. ... WEB search returns many matches to "CUDA FFT library". Quick look into http://developer.download.nvidia.com/compute/cuda/1_1/CUFFT_Library_1.1.pdf shows interface similar to FFTW one. Regards, Sergei. From storrsjm at email.uc.edu Sat Nov 21 13:20:09 2009 From: storrsjm at email.uc.edu (Judd Storrs) Date: Sat, 21 Nov 2009 14:20:09 -0500 Subject: calling octave from C In-Reply-To: <4B07CDFA.8060808@acc.umu.se> References: <0EA9662A402E6A4B88078E93D7F20D7B78472D@x346-001w2k3.sup2000.sup-logistik.de> <69d8d540911190248y4f490eb2mbe340a0772a39e60@mail.gmail.com> <69d8d540911200154k7fb5c769t68688d402ce900c@mail.gmail.com> <69d8d540911201258k7c4febc7neee1579faddddd9b@mail.gmail.com> <4B07CDFA.8060808@acc.umu.se> Message-ID: I understand your position. But fundamentally, pytave is clearly a derivative work of octave and is bound to octave's license. Restrictions on octave by derivative works are incompatible with the GPL. That is both the beauty and the curse of the GPL. I guess the clearest way to express my consern is that one of these two cases must be true: 1) Pytave's restriction limiting use of octave to only GPL-compatible interpreter scripts is a novel GPL-incompatible restriction on octave's code OR 2) Use of GPL-incompatible interpreter code (m-files) was already forbidden within the octave interpreter. My opinion is that the FSF FAQ makes it clear that #2 is false. --judd From highegg at gmail.com Sat Nov 21 14:26:40 2009 From: highegg at gmail.com (Jaroslav Hajek) Date: Sat, 21 Nov 2009 21:26:40 +0100 Subject: calling octave from C In-Reply-To: References: <0EA9662A402E6A4B88078E93D7F20D7B78472D@x346-001w2k3.sup2000.sup-logistik.de> <69d8d540911190248y4f490eb2mbe340a0772a39e60@mail.gmail.com> <69d8d540911200154k7fb5c769t68688d402ce900c@mail.gmail.com> <69d8d540911201258k7c4febc7neee1579faddddd9b@mail.gmail.com> <4B07CDFA.8060808@acc.umu.se> Message-ID: <69d8d540911211226h9122a84r4565505ba715a3eb@mail.gmail.com> On Sat, Nov 21, 2009 at 8:20 PM, Judd Storrs wrote: > I understand your position. But fundamentally, pytave is clearly a > derivative work of octave and is bound to octave's license. > Restrictions on octave by derivative works are incompatible with the > GPL. That is both the beauty and the curse of the GPL. I guess the > clearest way to express my consern is that one of these two cases must > be true: > Why? > > 1) Pytave's restriction limiting use of octave to only GPL-compatible > interpreter scripts is a novel GPL-incompatible restriction on > octave's code > > There is no such restriction. It's just about applying the GPL. > OR > > 2) Use of GPL-incompatible interpreter code (m-files) was already > forbidden within the octave interpreter. > > My opinion is that the FSF FAQ makes it clear that #2 is false. > Yes. The FSF's FAQ also clearly say that scripts linked via GPL'ed bindings to external GPL software should be GPL compatible. -- RNDr. Jaroslav Hajek computing expert & GNU Octave developer Aeronautical Research and Test Institute (VZLU) Prague, Czech Republic url: www.highegg.matfyz.cz -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091121/0c754792/attachment.html From storrsjm at email.uc.edu Sat Nov 21 14:53:08 2009 From: storrsjm at email.uc.edu (Judd Storrs) Date: Sat, 21 Nov 2009 15:53:08 -0500 Subject: calling octave from C In-Reply-To: <69d8d540911211226h9122a84r4565505ba715a3eb@mail.gmail.com> References: <0EA9662A402E6A4B88078E93D7F20D7B78472D@x346-001w2k3.sup2000.sup-logistik.de> <69d8d540911190248y4f490eb2mbe340a0772a39e60@mail.gmail.com> <69d8d540911200154k7fb5c769t68688d402ce900c@mail.gmail.com> <69d8d540911201258k7c4febc7neee1579faddddd9b@mail.gmail.com> <4B07CDFA.8060808@acc.umu.se> <69d8d540911211226h9122a84r4565505ba715a3eb@mail.gmail.com> Message-ID: On Sat, Nov 21, 2009 at 3:26 PM, Jaroslav Hajek wrote: > Why? Because non-GPL scripts are either allowed in both octave and python or they are forbidden in both octave and python. They are covered by exactly the same license. The GPL must apply everywhere equally. Proposing that an interpreter that embeds octave is free to impose new restrictions on octave is the kind of doublethink you would expect from a corporate entity trying to circumvent the GPL. Unless I missed a change in octave's licensing, pytave does not have the authority to alter the license of octave. --judd From individ at acc.umu.se Sat Nov 21 15:10:40 2009 From: individ at acc.umu.se (David Grundberg) Date: Sat, 21 Nov 2009 22:10:40 +0100 Subject: calling octave from C In-Reply-To: References: <0EA9662A402E6A4B88078E93D7F20D7B78472D@x346-001w2k3.sup2000.sup-logistik.de> <69d8d540911190248y4f490eb2mbe340a0772a39e60@mail.gmail.com> <69d8d540911200154k7fb5c769t68688d402ce900c@mail.gmail.com> <69d8d540911201258k7c4febc7neee1579faddddd9b@mail.gmail.com> <4B07CDFA.8060808@acc.umu.se> Message-ID: <4B085750.5080103@acc.umu.se> Judd Storrs skrev: > I understand your position. But fundamentally, pytave is clearly a > derivative work of octave and is bound to octave's license. > Restrictions on octave by derivative works are incompatible with the > GPL. That is both the beauty and the curse of the GPL. I guess the > clearest way to express my consern is that one of these two cases must > be true: > > 1) Pytave's restriction limiting use of octave to only GPL-compatible > interpreter scripts is a novel GPL-incompatible restriction on > octave's code > > I think your word "GPL-incompatible" is misleading. Calling it a "novel GPL-incompatible restriction on Octave's code" is plain wrong. It's not novel. It's not "GPL-incompatible". Pytave is a derivate of Octave. That's why it is licensed under GPLv3. And it's not a restriction of Octave's code. You can do the same thing with Pytave that you can do with Octave to begin with. In fact, the GPL license is there to guarantee it. The GNU GPL is not a random set of rules regarding distribution. I think this is essential to truly understanding the license. It is there with the explicit purpose of preserving the four freedoms of the users. Hypothetically, if Pytave somehow weren't GPL, the hole it with leave open would be big enough to drive a truck through. > OR > > 2) Use of GPL-incompatible interpreter code (m-files) was already > forbidden within the octave interpreter. > > My opinion is that the FSF FAQ makes it clear that #2 is false. > > The Octave interpreter can be used to interpret any m-file. You can interpret any m-file through Pytave too. You can run Pytave or Octave however you wish, it is freedom 0. (Freedom to run the software for any purpose) David From highegg at gmail.com Sat Nov 21 23:46:41 2009 From: highegg at gmail.com (Jaroslav Hajek) Date: Sun, 22 Nov 2009 06:46:41 +0100 Subject: calling octave from C In-Reply-To: References: <0EA9662A402E6A4B88078E93D7F20D7B78472D@x346-001w2k3.sup2000.sup-logistik.de> <69d8d540911200154k7fb5c769t68688d402ce900c@mail.gmail.com> <69d8d540911201258k7c4febc7neee1579faddddd9b@mail.gmail.com> <4B07CDFA.8060808@acc.umu.se> <69d8d540911211226h9122a84r4565505ba715a3eb@mail.gmail.com> Message-ID: <69d8d540911212146y6187ebb1h7157cae6c94784d2@mail.gmail.com> On Sat, Nov 21, 2009 at 9:53 PM, Judd Storrs wrote: > On Sat, Nov 21, 2009 at 3:26 PM, Jaroslav Hajek wrote: > > Why? > > Because non-GPL scripts are either allowed in both octave and python > or they are forbidden in both octave and python. They are covered by > exactly the same license. The GPL must apply everywhere equally. > Octave and Python are not covered by the same license. Besides, you're getting of the point, because (according to FSF's FAQ) it's not Octave or Python, but Pytave (the "bindings" to external software) that makes the difference. And Pytave is not a part of Python. > Proposing that an interpreter that embeds octave is free to impose new > restrictions on octave is the kind of doublethink you would expect > from a corporate entity trying to circumvent the GPL. > > Oh my. So please tell that to FSF, and how they are screwing the license they invented. > Unless I missed a change in octave's licensing, pytave does not have > the authority to alter the license of octave. > > > --judd > In fact Pytave could add additional terms under section 7, but you have been told that Pytave just uses GPL 3, so I don't understand why you keep saying that. Unlike its predecessor, GPL 3 does not talk about scripts, interpreters and libraries, not even derivative works. It simply says that a covered work (modified, or based on the source GPL work in question) is anything that would normally require a copyright permission under applicable law. So ultimately the question is whether a script using Pytave would require copyright permission if Pytave and Octave were proprietary. Apparently, the FSF thinks that the answer is yes. -- RNDr. Jaroslav Hajek computing expert & GNU Octave developer Aeronautical Research and Test Institute (VZLU) Prague, Czech Republic url: www.highegg.matfyz.cz -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091122/92481d82/attachment.html From xaerochina at gmail.com Sun Nov 22 01:38:35 2009 From: xaerochina at gmail.com (Chengqi Chang) Date: Sun, 22 Nov 2009 15:38:35 +0800 Subject: CUDA acceleration in GNU Octave In-Reply-To: References: Message-ID: I think it would be great if someone can provide a "bridge" -- like MPI toolbox(http://atc.ugr.es/javier-bin/mpitb) -- connecting Octave and CUDA computing libraries. Besides, in my opinion, it matters little whether this "bridge" is universal or tied to a single vendor (Nv/ATI). Both of the two choices have merits and drawbacks. If it is tied to a single vendor, it can be easier to take advantage of some special features of the GPU and it also has a larger possibility to get donation from that vendor. -- Best Regards! --------------------------- Sincerely Yours Chengqi Chang China Center for Economic Research Mail: XaeroChina at Gmail.com Personal Website: http://macro2.cn From kimhanse at gmail.com Sun Nov 22 06:20:20 2009 From: kimhanse at gmail.com (Kim Hansen) Date: Sun, 22 Nov 2009 13:20:20 +0100 Subject: Passing an array from java to octave In-Reply-To: <4AEF16F1.7010900@telecom.ntua.gr> References: <4AEF16F1.7010900@telecom.ntua.gr> Message-ID: 2009/11/2 George Kousiouris : > Hi all, > > I want to pass a Java array to Octave, so that I can process the data > inside. Does anyone have an idea how this can be done? I have tried a > java to octave bridge (javaoctave-0.4.0.jar) however this seems to be > only for executing Octave commands inside a Java program and not > actually passing data from Java to Octave... JavaOctave can transfer many different types of data between Java and Octave. In the following simple example "a" is a 2x2 matrix that is passed from Java to Octave and "b" is pulled out of Octave. The example is from: http://kenai.com/projects/javaoctave/pages/SimpleExampleOfJavaOctaveUsage ============== final OctaveEngine octave = new OctaveEngineFactory().getScriptEngine(); final OctaveMatrix a = new OctaveMatrix(new double[] { 1, 2, 3, 4 }, 2, 2); octave.put("a", a); final String func = "" // + "function res = my_func(a)\n" // + " res = 2 * a;\n" // + "endfunction\n" // + ""; octave.eval(func); octave.eval("b = my_func(a);"); final OctaveMatrix b = octave.get("b"); octave.close(); ============== -- Kim Hansen Vadg?rdsvej 3, 2.tv 2860 S?borg Fastnet: 3956 2437 -- Mobil: 3091 2437 From jwe at octave.org Sun Nov 22 07:39:44 2009 From: jwe at octave.org (John W. Eaton) Date: Sun, 22 Nov 2009 08:39:44 -0500 Subject: CUDA acceleration in GNU Octave In-Reply-To: References: Message-ID: <19209.16160.892121.182192@segfault.lan> On 22-Nov-2009, Chengqi Chang wrote: | I think it would be great if someone can provide a "bridge" -- like MPI | toolbox(http://atc.ugr.es/javier-bin/mpitb) -- connecting Octave and CUDA | computing libraries. Besides, in my opinion, it matters little whether | this "bridge" is universal or tied to a single vendor (Nv/ATI). Both of | the two choices have merits and drawbacks. If it is tied to a single | vendor, it can be easier to take advantage of some special features of the | GPU and it also has a larger possibility to get donation from that vendor. Are the libraries that take advantage of this single vendor distributed under a license that is compatible with the GPL? If so, then I think this would be acceptable, but not great as it is still ties you to a single vendor. If not, then you would not be able to distribute .oct files that require these libraries, and such an extension would never become a part of the core Octave itself. The Octave project is about software freedom, not about promoting links to proprietary software, or encouraging users to lock themselves into single-vendor solutions. jwe From xaerochina at gmail.com Sun Nov 22 09:25:04 2009 From: xaerochina at gmail.com (Chengqi Chang) Date: Sun, 22 Nov 2009 23:25:04 +0800 Subject: CUDA acceleration in GNU Octave In-Reply-To: <19209.16160.892121.182192@segfault.lan> References: <19209.16160.892121.182192@segfault.lan> Message-ID: On Sun, 22 Nov 2009 21:39:44 +0800, John W. Eaton wrote: > On 22-Nov-2009, Chengqi Chang wrote: > > | I think it would be great if someone can provide a "bridge" -- like MPI > | toolbox(http://atc.ugr.es/javier-bin/mpitb) -- connecting Octave and > CUDA > | computing libraries. Besides, in my opinion, it matters little whether > | this "bridge" is universal or tied to a single vendor (Nv/ATI). Both of > | the two choices have merits and drawbacks. If it is tied to a single > | vendor, it can be easier to take advantage of some special features of > the > | GPU and it also has a larger possibility to get donation from that > vendor. > > Are the libraries that take advantage of this single vendor > distributed under a license that is compatible with the GPL? > > If so, then I think this would be acceptable, but not great as it is > still ties you to a single vendor. > > If not, then you would not be able to distribute .oct files that > require these libraries, and such an extension would never become a > part of the core Octave itself. The Octave project is about software > freedom, not about promoting links to proprietary software, or > encouraging users to lock themselves into single-vendor solutions. > > jwe GPL compatibility depends on how the libraries use CUDA -- if the libs only call them, GPL can be retained. Since there are limited numbers of popular vendors, it is possible to initialize different projects. Once you buy your graphic card, you are actually tied to a vendor. BTW, I like the freedom philosophy as well, while I think whether the freedom is pure or conditional on some exogenous constraints can be equally acceptable. -- Best Regards! --------------------------- Sincerely Yours Chengqi Chang China Center for Economic Research Mail: XaeroChina at Gmail.com Personal Website: http://macro2.cn From jwe at octave.org Sun Nov 22 09:50:59 2009 From: jwe at octave.org (John W. Eaton) Date: Sun, 22 Nov 2009 10:50:59 -0500 Subject: CUDA acceleration in GNU Octave In-Reply-To: References: <19209.16160.892121.182192@segfault.lan> Message-ID: <19209.24035.27273.201425@segfault.lan> On 22-Nov-2009, Chengqi Chang wrote: | GPL compatibility depends on how the libraries use CUDA -- if the libs | only call them, GPL can be retained. I don't think that is correct, nor is it the interpretation of the GPL that the FSF has. | Once you buy your graphic card, you are | actually tied to a vendor. That does not have to be true. If there were one high-level free software library that supported multiple types of hardware, you would not be tied to a single vendor for software support or future hardware purchases. jwe From xaerochina at gmail.com Sun Nov 22 10:21:27 2009 From: xaerochina at gmail.com (Chengqi Chang) Date: Mon, 23 Nov 2009 00:21:27 +0800 Subject: CUDA acceleration in GNU Octave In-Reply-To: <4B09608E.5080903@acc.umu.se> References: <19209.16160.892121.182192@segfault.lan> <4B09608E.5080903@acc.umu.se> Message-ID: Well, I've underestimated Nv's plot. -- Best Regards Sincerely Yours Chengqi Chang ------------------------------- China Center for Economic Research Peking University, P.R. China Gtalk/MSN: XaeroChina at gmail.com Personal Website: http://Macro2.cn From individ at acc.umu.se Sun Nov 22 10:02:22 2009 From: individ at acc.umu.se (David Grundberg) Date: Sun, 22 Nov 2009 17:02:22 +0100 Subject: CUDA acceleration in GNU Octave In-Reply-To: References: <19209.16160.892121.182192@segfault.lan> Message-ID: <4B09608E.5080903@acc.umu.se> Chengqi Chang skrev: > On Sun, 22 Nov 2009 21:39:44 +0800, John W. Eaton wrote: > > >> On 22-Nov-2009, Chengqi Chang wrote: >> >> | I think it would be great if someone can provide a "bridge" -- like MPI >> | toolbox(http://atc.ugr.es/javier-bin/mpitb) -- connecting Octave and >> CUDA >> | computing libraries. Besides, in my opinion, it matters little whether >> | this "bridge" is universal or tied to a single vendor (Nv/ATI). Both of >> | the two choices have merits and drawbacks. If it is tied to a single >> | vendor, it can be easier to take advantage of some special features of >> the >> | GPU and it also has a larger possibility to get donation from that >> vendor. >> >> Are the libraries that take advantage of this single vendor >> distributed under a license that is compatible with the GPL? >> >> If so, then I think this would be acceptable, but not great as it is >> still ties you to a single vendor. >> >> If not, then you would not be able to distribute .oct files that >> require these libraries, and such an extension would never become a >> part of the core Octave itself. The Octave project is about software >> freedom, not about promoting links to proprietary software, or >> encouraging users to lock themselves into single-vendor solutions. >> >> jwe >> > GPL compatibility depends on how the libraries use CUDA -- if the libs > only call them, GPL can be retained. > Since there are limited numbers of popular vendors, it is possible to > initialize different projects. Once you buy your graphic card, you are > actually tied to a vendor. > BTW, I like the freedom philosophy as well, while I think whether the > freedom is pure or conditional on some exogenous constraints can be > equally acceptable. > > So freedom has a price, and it is parallel computing? Come on! Besides, I think you are underestimating the license clash between Nvidia's CUDA license and the GNU GPL. I think OpenCL will be a more vendor-agnostic way to go. David From storrsjm at email.uc.edu Sun Nov 22 10:54:43 2009 From: storrsjm at email.uc.edu (Judd Storrs) Date: Sun, 22 Nov 2009 11:54:43 -0500 Subject: calling octave from C In-Reply-To: <69d8d540911212146y6187ebb1h7157cae6c94784d2@mail.gmail.com> References: <0EA9662A402E6A4B88078E93D7F20D7B78472D@x346-001w2k3.sup2000.sup-logistik.de> <69d8d540911200154k7fb5c769t68688d402ce900c@mail.gmail.com> <69d8d540911201258k7c4febc7neee1579faddddd9b@mail.gmail.com> <4B07CDFA.8060808@acc.umu.se> <69d8d540911211226h9122a84r4565505ba715a3eb@mail.gmail.com> <69d8d540911212146y6187ebb1h7157cae6c94784d2@mail.gmail.com> Message-ID: Sorry, I think it's pretty clear I was being dense. It's pretty obvious that using pytave is a binary link into octave and should invoke the full GPL on python scripts that use it. Using pytave is equivalent to using the .oct interface not m-files. Which should have been pretty obvious to me. How embarrassing. Sorry for the noise. --judd From highegg at gmail.com Sun Nov 22 15:04:12 2009 From: highegg at gmail.com (Jaroslav Hajek) Date: Sun, 22 Nov 2009 22:04:12 +0100 Subject: calling octave from C In-Reply-To: References: <0EA9662A402E6A4B88078E93D7F20D7B78472D@x346-001w2k3.sup2000.sup-logistik.de> <69d8d540911201258k7c4febc7neee1579faddddd9b@mail.gmail.com> <4B07CDFA.8060808@acc.umu.se> <69d8d540911211226h9122a84r4565505ba715a3eb@mail.gmail.com> <69d8d540911212146y6187ebb1h7157cae6c94784d2@mail.gmail.com> Message-ID: <69d8d540911221304y63941fcfxa0234b61e617a9b0@mail.gmail.com> On Sun, Nov 22, 2009 at 5:54 PM, Judd Storrs wrote: > Sorry, I think it's pretty clear I was being dense. It's pretty > obvious that using pytave is a binary link into octave and should > invoke the full GPL on python scripts that use it. Using pytave is > equivalent to using the .oct interface not m-files. Which should have > been pretty obvious to me. How embarrassing. Sorry for the noise. > > > --judd > Now I don't know if you're serious :) Maybe there was some confusion that is to be blamed. You thought (or at least said) that we're adding new restrictions to the GPL in Pytave; we're not. We're just using the GPL, and also respect the FSF's authority regarding specific licensing implications. And the FSF's FAQ states that if a script uses Pytave, it is "effectively linked to" Octave (hence must comply with GPL). As a matter of fact, I do *not* really understand how this conclusion follows from the text of GPL 3, I just trust the FAQ. I respect the opinion of FSF because they probably studied GPL-related issues more than most GPL developers, and as creators they should think in accordance with the "spirit" of GPL. But of course even FSF can be wrong. If the licensing issues pose a problem for your work; I'd suggest you still contact the FSF; maybe they can advise something. best regards -- RNDr. Jaroslav Hajek computing expert & GNU Octave developer Aeronautical Research and Test Institute (VZLU) Prague, Czech Republic url: www.highegg.matfyz.cz -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091122/c84386d9/attachment.html From naveen.garg at gmail.com Sun Nov 22 18:08:38 2009 From: naveen.garg at gmail.com (tinku99) Date: Sun, 22 Nov 2009 16:08:38 -0800 (PST) Subject: exporting sparse matrix or inverse of spconvert Message-ID: <26471004.post@talk.nabble.com> I want access to the 3 vectors representing rows, columns, and values of my sparse matrix. Is there a way to get at these easier than having to iterate through the nonsparse matrix? I am trying to find the orientation of the largest connected region in a binary image as follows: I need a column and row vectors of the sparse matrix to feed fitellipse.m by fitzgibbon here: http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/FITZGIBBON/ELLIPSE/ I am able to get the largest connected region with the following: % Copyright 2009 Naveen Garg (naveen.garg at gmail.com) % GPL V2 http://www.gnu.org/licenses/gpl-2.0.html function largest_blob = maxregion(binary_image) % $$$ return region with largest area for given binary image [labeled_image, num] = bwlabel(binary_image); [N, X]=imhist(labeled_image, num + 1); N(1) = 0; [max,index_max] = max(N); largest_blob = (labeled_image == (index_max - 1)); -- View this message in context: http://old.nabble.com/exporting-sparse-matrix-or-inverse-of-spconvert-tp26471004p26471004.html Sent from the Octave - General mailing list archive at Nabble.com. From naveen.garg at gmail.com Sun Nov 22 18:17:01 2009 From: naveen.garg at gmail.com (tinku99) Date: Sun, 22 Nov 2009 16:17:01 -0800 (PST) Subject: exporting sparse matrix or inverse of spconvert In-Reply-To: <26471004.post@talk.nabble.com> References: <26471004.post@talk.nabble.com> Message-ID: <26471050.post@talk.nabble.com> ok, find does it... [i, j, v] = find (a); somehow i skipped over that in the octave manual luckily searching the matlab google group found it easily http://www.google.com/groups/search?ie=UTF-8&q=spconvert&btnG=Search&sitesearch=groups.google.com tinku99 wrote: > > I want access to the 3 vectors representing rows, columns, and values of > my sparse matrix. > Is there a way to get at these easier than having to iterate through the > nonsparse matrix? > -- View this message in context: http://old.nabble.com/exporting-sparse-matrix-or-inverse-of-spconvert-tp26471004p26471050.html Sent from the Octave - General mailing list archive at Nabble.com. From dbateman at dbateman.org Sun Nov 22 18:19:47 2009 From: dbateman at dbateman.org (David Bateman) Date: Mon, 23 Nov 2009 01:19:47 +0100 Subject: exporting sparse matrix or inverse of spconvert In-Reply-To: <26471004.post@talk.nabble.com> References: <26471004.post@talk.nabble.com> Message-ID: <4B09D523.6040903@dbateman.org> tinku99 wrote: > I want access to the 3 vectors representing rows, columns, and values of my > sparse matrix. > Is there a way to get at these easier than having to iterate through the > nonsparse matrix? > Is there anything wrong with [r, c, v] = find (S); D. From storrsjm at email.uc.edu Sun Nov 22 20:04:25 2009 From: storrsjm at email.uc.edu (Judd Storrs) Date: Sun, 22 Nov 2009 21:04:25 -0500 Subject: calling octave from C In-Reply-To: <69d8d540911221304y63941fcfxa0234b61e617a9b0@mail.gmail.com> References: <0EA9662A402E6A4B88078E93D7F20D7B78472D@x346-001w2k3.sup2000.sup-logistik.de> <69d8d540911201258k7c4febc7neee1579faddddd9b@mail.gmail.com> <4B07CDFA.8060808@acc.umu.se> <69d8d540911211226h9122a84r4565505ba715a3eb@mail.gmail.com> <69d8d540911212146y6187ebb1h7157cae6c94784d2@mail.gmail.com> <69d8d540911221304y63941fcfxa0234b61e617a9b0@mail.gmail.com> Message-ID: On Sun, Nov 22, 2009 at 4:04 PM, Jaroslav Hajek wrote: > As a matter of fact, I do *not* really understand how this conclusion > follows from the text of GPL 3, I just trust the FAQ. I respect the opinion I can't say that I do either. I think the FSF avoids specific language within the FAQ statements purposefully to avoid helping scumbags find holes in the licenses. Based on the FAQ entry it may be that if someone were to create a new program that combines octave, pytave and python into a new GPL-licensed single work then it may be possible to monkey with what has been said in the FAQ. That said, the FAQ is not the GPL so who knows if that would be successful at all anyway. In any case octave+pytave+python is not currently a single work and the FAQ entry applies immediately to pytave's relationship to python. Again, sorry for the noise. --judd From naveen.garg at gmail.com Sun Nov 22 21:37:26 2009 From: naveen.garg at gmail.com (Naveen Garg) Date: Sun, 22 Nov 2009 22:37:26 -0500 Subject: bwlabeln or 3d version of bwlabel Message-ID: Is there an opensource implementation for multidimensional connected component labeling? -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091122/9635331c/attachment.html From soren at hauberg.org Mon Nov 23 01:43:40 2009 From: soren at hauberg.org (=?ISO-8859-1?Q?S=F8ren?= Hauberg) Date: Mon, 23 Nov 2009 08:43:40 +0100 Subject: bwlabeln or 3d version of bwlabel In-Reply-To: References: Message-ID: <1258962220.2637.98.camel@hauberg-laptop> s?n, 22 11 2009 kl. 22:37 -0500, skrev Naveen Garg: > Is there an opensource implementation for multidimensional connected > component labeling? Not that I know of. If you find one or decides to implement yourself, please let me know, as that would be a valuable contribution to the 'image' package. S?ren From rovitotv at gmail.com Mon Nov 23 05:30:17 2009 From: rovitotv at gmail.com (Todd Rovito) Date: Mon, 23 Nov 2009 01:30:17 -1000 Subject: imshow is slow on Mac OSX 10.5 Message-ID: I just started to use Octave for some image processing work and have noticed how slow Octave is to display images in gnu-plot. On my 1 year old Mac Book Pro it can take 5 seconds to display a 4 mega-pixel 8 bit image. Attached is the function I use to read such image. I am wondering if I have something installed wrong or this is a natural behavior or Octave? Please understand I am not complaining about Octave's performance, it seems speedy on everything except for image display. Thanks for the help. -------------- next part -------------- A non-text attachment was scrubbed... Name: ReadRawImage.m Type: application/octet-stream Size: 326 bytes Desc: not available Url : https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091123/84507f63/attachment.obj From carlo.defalco at gmail.com Mon Nov 23 06:16:37 2009 From: carlo.defalco at gmail.com (Carlo de Falco) Date: Mon, 23 Nov 2009 13:16:37 +0100 Subject: imshow is slow on Mac OSX 10.5 In-Reply-To: References: Message-ID: <80ED95D5-E338-4A00-AF30-4EDA559B5056@gmail.com> On 23 Nov 2009, at 12:30, Todd Rovito wrote: > I just started to use Octave for some image processing work and have > noticed how slow Octave is to display images in gnu-plot. > On my 1 > year old Mac Book Pro it can take 5 seconds to display a 4 mega-pixel > 8 bit image. Attached is the function I use to read such image. I am > wondering if I have something installed wrong or this is a natural > behavior or Octave? Please understand I am not complaining about > Octave's performance, it seems speedy on everything except for image > display. > > > Thanks for the help. I am afraid this is due to the way communication between Octave and gnuplot is implemented. As communication is implemented via pipes, transferring the image data to gnuplot takes about the same time as writing the whole uncompressed image data to a file and then reading it back. This is one of the reasons why a new graphics backend based on OpenGL is currently under developement. To get an idea of the speed improvement given by the new backend you can try: sombrero (500) close all backend ('fltk') sombrero (500) The difference is really impressive on my own white plastic Core 2 Duo MacBook. unfortunately the new backend does not yet support imshow in the current stable release. If this feature is important to you might want to consider joining the developers mailing list and helping get Octave 3.4 out soon. HTH, c. From jrgsampaio at gmail.com Sun Nov 22 22:00:51 2009 From: jrgsampaio at gmail.com (JSampaio57) Date: Sun, 22 Nov 2009 20:00:51 -0800 (PST) Subject: fltk backend and undefined gluOrtho2D In-Reply-To: <24614534.post@talk.nabble.com> References: <923da9300907160207na9fff44ld6804ddec1b08edf@mail.gmail.com> <19039.7415.554457.367021@segfault.lan> <24596921.post@talk.nabble.com> <19046.21211.941628.898939@segfault.lan> <24614534.post@talk.nabble.com> Message-ID: <26472506.post@talk.nabble.com> I had the same problem. I could compile with no problem after installing libftgl-dev. Cheers... Jorge Jeff Keacher wrote: > > > John W. Eaton-3 wrote: >> >> On 21-Jul-2009, teuobk wrote: >> >> | John W. Eaton-3 wrote: >> | > >> | > On 16-Jul-2009, Alexander Barth wrote: >> | > >> | > | Hi all, >> | > | I try to compile a recent checkout of octave (from >> | > | http://www.octave.org/hg/octave). The compilation fails at: >> | > | >> | > | ./DLD-FUNCTIONS/fltk_backend.cc: In member function ?3u=1rxvirtual >> void >> | > | OpenGL_fltk::draw_overlay()?3u=1ry: >> | > | ./DLD-FUNCTIONS/fltk_backend.cc:145: error: >> ?3u=1rxgluOrtho2D?3u=1ry was not >> | > | declared in this scope >> | > | >> | > | I have fltk version 1.1.7. Is this version recent enough? On my >> system >> | > | gluOrtho2D is declared in /usr/include/GL/glu.h but this file is >> not >> | > | included in fltk_backend.cc. >> | > >> | > On my system, /usr/include/GL/glu.h is part of the libglu1-mesa-dev >> | > package, and the version of that package is 7.0.3. I also have >> | > version 1.1.9 of libfltk1.1-dev. >> | > >> | >> | Ran into this problem, too. I have fltk 1.1.9 on an Intrepid-release >> Ubuntu >> | box, and I was trying to compile Octave 3.2.0 from source. My solution >> was >> | to edit fltk_backend.cc to #include . Now everything builds >> | fine, and all of the integrated tests pass. >> >> Strange that you need to include this file and I don't. Does anyone >> know why that might be? >> >> At least on my system, the file FL/glu.h doesn't appear to declare >> gluOrtho2D directly, but gets the declaration when it includes >> GL/glu.h. >> >> The file src/DLD-FUNCTIONS/fltk_backend.cc includes gl-render.h which >> includes GL/glu.h if it exists. So if everything is configured >> correctly, I think the symbol gluOrtho2D should be defined correctly, >> and no changes should be required. >> >> Does your system have GL/glu.h? Does it provide a declaration for >> the gluOrtho2D function? Does Octave's configure script find GL/glu.h >> and define HAVE_GL_GLU_H on your system? >> > > Indeed, gluOrtho2D is declared in GL/glu.h. I included it (indirectly) > via FL/glu.h mainly for consistency with the other includes in that file, > which tend to pull from the FL directory. > > Curiously, Octave's configuration script seems to find GL/glu.h, as it > defines HAVE_GL_GLU_H. Since that is defined, GL/glu.h should be included > via gl-render.h, which of course is included conditionally if > HAVE_GL_GLU_H is defined -- but that didn't seem to be happening. > > To make matters worse, I backed out the change to fltk_backend.cc, ran > make clean, and tried the build again in an attempt to reproduce the > problem. This time the build completed without errors. Odd. I assume > that something is sticking around from the previous builds, but I'm not > sure what it could be. > > Jeff > -- View this message in context: http://old.nabble.com/fltk-backend-and-undefined-gluOrtho2D-tp24513000p26472506.html Sent from the Octave - General mailing list archive at Nabble.com. From relleradrian at yahoo.com Fri Nov 20 23:39:41 2009 From: relleradrian at yahoo.com (Adrian pamin) Date: Sat, 21 Nov 2009 13:39:41 +0800 (SGT) Subject: playaduio in octave 3.2.3 Message-ID: <532743.79146.qm@web76416.mail.sg1.yahoo.com> Hi, Im a little new to using octave and GNU systems but there seems to be a problem with the playaudio() function in the Octave 3.2.3 patch. When trying to use the playaudio(x) the error "The system cannot find the path specified." I have tried this in a Vista and Win XP system yielding the same results. Below is the code used: t = [0:1/8000:2] sig3 = 0.8*sin(2*pi*3*t) plot(t,sig3) playaudio(sig3) My friends and professor are stumped with this error as they can use the function without problems on a Linux and Mac OS. Is this possibly a Windows problem? would switching to a VM or dual booting help? Thanks in advance... -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091121/2a5173e8/attachment.html From highegg at gmail.com Mon Nov 23 07:19:10 2009 From: highegg at gmail.com (Jaroslav Hajek) Date: Mon, 23 Nov 2009 14:19:10 +0100 Subject: playaduio in octave 3.2.3 In-Reply-To: <532743.79146.qm@web76416.mail.sg1.yahoo.com> References: <532743.79146.qm@web76416.mail.sg1.yahoo.com> Message-ID: <69d8d540911230519i1d9a02c6m2ced33f850c925db@mail.gmail.com> On Sat, Nov 21, 2009 at 6:39 AM, Adrian pamin wrote: > Hi, > Im a little new to using octave and GNU systems but there seems to be a > problem with the playaudio() function in the Octave 3.2.3 patch. When trying > to use the playaudio(x) the error "The system cannot find the path > specified." I have tried this in a Vista and Win XP system yielding the same > results. Below is the code used: > > t = [0:1/8000:2] > sig3 = 0.8*sin(2*pi*3*t) > plot(t,sig3) > playaudio(sig3) > > My friends and professor are stumped with this error as they can use the > function without problems on a Linux and Mac OS. Is this possibly a Windows > problem? would switching to a VM or dual booting help? Thanks in advance... > > I'm afraid the current playaudio is only designed to run on Unix systems, because all it does is send data to /dev/dsp or /dev/audio. There could probably be an alternative path for Windows, using a temporary wav file or something similar. hth -- RNDr. Jaroslav Hajek computing expert & GNU Octave developer Aeronautical Research and Test Institute (VZLU) Prague, Czech Republic url: www.highegg.matfyz.cz -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091123/387f4d02/attachment.html From naveen.garg at gmail.com Mon Nov 23 09:10:23 2009 From: naveen.garg at gmail.com (Naveen Garg) Date: Mon, 23 Nov 2009 09:10:23 -0600 Subject: bwlabeln or 3d version of bwlabel In-Reply-To: <1258962220.2637.98.camel@hauberg-laptop> References: <1258962220.2637.98.camel@hauberg-laptop> Message-ID: > > Is there an opensource implementation for multidimensional connected > > component labeling? > > Not that I know of. If you find one or decides to implement yourself, > please let me know, as that would be a valuable contribution to the > 'image' package. > > The scipy.ndimage has a label function. http://www.google.com/codesearch/p?hl=en&sa=N&cd=1&ct=rc#sL5YdHMOlIg/scipy-0.4.9/Lib/ndimage/src/ni_measure.c&q=ndimage%20numpy http://docs.scipy.org/doc/scipy/reference/generated/scipy.ndimage.measurements.label.html#scipy.ndimage.measurements.label the ndimage is advertised for multidimensional arrays. The label function does not specifically list any limitations for dim > 2. I will see if I can translate it to octave, but i haven't been able to compile octave on mingw yet... Had trouble finding the glob library that is supposed to be on the octave website : http://hg.savannah.gnu.org/hgweb/octave/file/8d9e4752441a/README.MSVC -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091123/5ce76ce2/attachment.html From eddie.j.frie at intel.com Mon Nov 23 10:56:30 2009 From: eddie.j.frie at intel.com (Frie, Eddie J) Date: Mon, 23 Nov 2009 08:56:30 -0800 Subject: Printing a figure as a png... This should be basic! In-Reply-To: References: Message-ID: Here is some working example code I use in Octave: figure(4); plot (freq_dev_array/1e9,ild,";insertion loss deviation;", freq_dev_array/1e9, -il_max, ";bottom limit;",freq_dev_array/1e9,il_max,";top limit;"); title('Insertion loss deviation'); xlabel('Freq (Ghz)'); ylabel('ILD (db)'); grid on print -dpng x.png in gnuplot I use: set terminal png font "arial, 30" size 3200, 2400 transparent set output ?foo.png? I hope this helps. -Eddie Frie (Not speaking for Intel) From: Kristen Richter [mailto:christy1865 at gmail.com] Sent: Friday, November 20, 2009 11:06 AM To: help at octave.org Subject: Printing a figure as a png... This should be basic! Hi Octave family, I feel rather embarrassed, but I have been unable to print a figure as a png despite several searches on help forums. The commands I am using are as follows: print('graph.png','-dpng') And I get the following error: octave:13> print('graph1','-dpng') gnuplot> set terminal png enhanced size 1200,900 ^ line 0: unknown or ambiguous terminal type; type just 'set terminal' for a list line 0: No terminal defined gnuplot> plot "-" binary format='%float64' record=15 using ($1):($2) axes x1y1 title "" with lines linestyle 1 , "-" binary format='%float64' record=15 using ($1):($2) axes x1y1 title "" with lines linestyle 2 , "-" binary format='%float64' record=15 using ($1):($2) axes x1y1 title "" with lines linestyle 3 , "-" binary format='%float64' record=15 using ($1):($2) axes x1y1 title "" with lines linestyle 4 , "-" binary format='%float64' record=15 using ($1):($2) axes x1y1 title "" with lines linestyle 5 , "-" binary format='%float64' record=15 using ($1):($2) axes x1y1 title "" with lines linestyle 6 ; ^ line 0: use 'set term' to set terminal type first gnuplot> @??????g@??~???(@ ^ line 0: invalid character @ gnuplot> ??#)@ ^ line 0: invalid character ? This error also applies to attempting to print as a jpeg, but not as an eps... Perhaps because it doesn't have to convert the file? Searching google for the first two lines of the error message gives results reporting problems related to a multitude of plotting functionalities in multiple versions of Octave on different operating systems. Is there something simple I can correct to print a png (running Octave 3.2.2 and Ubuntu)? Thank you in advance for your help. I'd appreciate any advice. -Kristen -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091123/033cd50e/attachment-0001.html From gkousiou at telecom.ntua.gr Mon Nov 23 11:42:32 2009 From: gkousiou at telecom.ntua.gr (George Kousiouris) Date: Mon, 23 Nov 2009 19:42:32 +0200 Subject: Passing an array from java to octave In-Reply-To: References: <4AEF16F1.7010900@telecom.ntua.gr> Message-ID: <4B0AC988.601@telecom.ntua.gr> Hi Kim,all thanks, I have been using this, however the problem is when you want to pass values from an existing java array to an octave array. The fact that the octave array type is an OctaveMatrix type (extension of OctaveType), complicates a bit things. So I have written this somehow crude but effective script for copying one by one the elements of the java array to the octave workspace. I attach the code, it creates a 10x5 array (easily made as parameters) , initializes the values to 5 and then passes it to octave. Just for future reference if someone else needs it. OctaveEngine octave = new OctaveEngineFactory().getScriptEngine(); int rows=10; int columns=5; OctaveMatrix arr=new OctaveMatrix(rows,columns); int octave_array_index_offset_r,octave_array_index_offset_c; //Creation and initialization of test array int[][] a2 = new int[10][5]; // print array in rectangular form for (int r=0; r 2009/11/2 George Kousiouris : > >> Hi all, >> >> I want to pass a Java array to Octave, so that I can process the data >> inside. Does anyone have an idea how this can be done? I have tried a >> java to octave bridge (javaoctave-0.4.0.jar) however this seems to be >> only for executing Octave commands inside a Java program and not >> actually passing data from Java to Octave... >> > > JavaOctave can transfer many different types of data between Java and Octave. > > In the following simple example "a" is a 2x2 matrix that is passed > from Java to Octave and "b" is pulled out of Octave. > > The example is from: > http://kenai.com/projects/javaoctave/pages/SimpleExampleOfJavaOctaveUsage > ============== > final OctaveEngine octave = new OctaveEngineFactory().getScriptEngine(); > final OctaveMatrix a = new OctaveMatrix(new double[] { 1, 2, 3, 4 }, 2, 2); > octave.put("a", a); > final String func = "" // > + "function res = my_func(a)\n" // > + " res = 2 * a;\n" // > + "endfunction\n" // > + ""; > octave.eval(func); > octave.eval("b = my_func(a);"); > final OctaveMatrix b = octave.get("b"); > octave.close(); > ============== > > -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091123/1adb8c8c/attachment.html From gbarrick at walsh.edu Mon Nov 23 12:04:58 2009 From: gbarrick at walsh.edu (George Barrick) Date: Mon, 23 Nov 2009 13:04:58 -0500 Subject: Printing a figure as a png... This should be basic! Message-ID: <4B30AD0BED19E842AAE88DC39736493123FA64EB50@mail3.walsh.edu> 2009.11.23.13:04:51 EST Hi Kristen (and octave folks), I've been using only the 'print' command in octave-3.2.3 to do the kind of thing that you need: print(handle,"graph.png","-dpng","-S429,348"); I've trained myself to stay off the gnuplot calls. The octave developers keep saying 'gnuplot calls deprecated'. It is likely that the 'handle' argument is not needed when the current graph is the only one. I've been using double-quotes for the arguments. Again, I'm not certain that this is absolutely required, but it works for me under the CygWin/bash/octave environment with the Xwin.exe version of x11. The last argument is how I force the image exporter (I believe that this is ImageMagick ?) to give my output image the correct proportions. Try the 'print' call as above. If it does not work, then perhaps you have found a bug. George gbarrick at walsh.edu From chainreactionerator at gmail.com Mon Nov 23 12:43:57 2009 From: chainreactionerator at gmail.com (=?KOI8-R?B?59LJx8/Sycog8M/Mo9TP1w==?=) Date: Mon, 23 Nov 2009 21:43:57 +0300 Subject: Need help with nelder_mead_min.m Message-ID: Hi all! I can't figure out how to work with this function. I will be very glad if one could explain the subject. For an example lets see the problem. function y = foo (x, y, z) y = x**2 + y**2 + z**2; endfunction I need to find a minima of the foo in [-1;1]*[-1;1]*[-1;1] region. I know the answer, but how I must set up an options and arguments for nelder_mead_min.m? Best regards, Grigory -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091123/0d1a9679/attachment.html From sergstesh at yahoo.com Mon Nov 23 13:09:47 2009 From: sergstesh at yahoo.com (Sergei Steshenko) Date: Mon, 23 Nov 2009 11:09:47 -0800 (PST) Subject: playaduio in octave 3.2.3 In-Reply-To: <69d8d540911230519i1d9a02c6m2ced33f850c925db@mail.gmail.com> Message-ID: <87824.85111.qm@web112119.mail.gq1.yahoo.com> --- On Mon, 11/23/09, Jaroslav Hajek wrote: > From: Jaroslav Hajek > Subject: Re: playaduio in octave 3.2.3 > To: "Adrian pamin" > Cc: help at octave.org > Date: Monday, November 23, 2009, 5:19 AM > > > On Sat, Nov 21, 2009 at 6:39 AM, > Adrian pamin > wrote: > > Hi, > Im a little new to using octave and GNU systems but there > seems to be a problem with the playaudio() function in the > Octave 3.2.3 patch. When trying to use the playaudio(x) the > error "The system cannot find the path specified." > I have tried this in a Vista and Win XP system yielding the > same results. Below is the code used: > > > t = [0:1/8000:2] > sig3 = 0.8*sin(2*pi*3*t) > plot(t,sig3) > playaudio(sig3) > > My friends and professor are stumped with this error as > they can use the function without problems on a Linux and > Mac OS. Is this possibly a Windows problem? would switching > to a VM or dual booting help? Thanks in advance... > > > > > > > > I'm afraid the current playaudio is only designed to > run on Unix systems, because all it does is send data to > /dev/dsp or /dev/audio. There could probably be an > alternative path for Windows, using a temporary wav file or > something similar. > > > hth > > -- > RNDr. Jaroslav Hajek > computing expert & GNU Octave developer > Aeronautical Research and Test Institute (VZLU) > Prague, Czech Republic > url: www.highegg.matfyz.cz 'sox' works both on Linux and Windows and can accept data from stdin. Under Windows sox' needs CYGWIN dll, but, I think, 'sox' is distributed in binary for with the dll. I.e. in practical terms it behaves like regular Windows console application - it doesn't need full fledged CYGWIN. It might make sense to implement octave -> sox interface. Regards, Sergei. From macy at sfo.com Mon Nov 23 13:23:35 2009 From: macy at sfo.com (macy at sfo.com) Date: Mon, 23 Nov 2009 11:23:35 -0800 (PST) Subject: Need help with nelder_mead_min.m In-Reply-To: References: Message-ID: <1465.66.81.42.209.1259004215.squirrel@cp01.sfo.com> I got this to work: >> function w=foo(x); w=x.*x+2;endfunction; >> x=[-1:.01:1]; >> nelder_mead_min("foo","x") Answer 2 > Hi all! > > I can't figure out how to work with this function. I will be very glad if > one could explain the subject. > > For an example lets see the problem. > > function y = foo (x, y, z) > y = x**2 + y**2 + z**2; > endfunction > > I need to find a minima of the foo in [-1;1]*[-1;1]*[-1;1] region. I know > the answer, but how I must set up an options and arguments for > nelder_mead_min.m? > > Best regards, > Grigory From rovitotv at gmail.com Mon Nov 23 16:04:28 2009 From: rovitotv at gmail.com (Todd Rovito) Date: Mon, 23 Nov 2009 12:04:28 -1000 Subject: imshow is slow on Mac OSX 10.5 In-Reply-To: <80ED95D5-E338-4A00-AF30-4EDA559B5056@gmail.com> References: <80ED95D5-E338-4A00-AF30-4EDA559B5056@gmail.com> Message-ID: Carlo, Thanks for the information! For sure the FLTK backend is much faster. I was looking at the imshow command to GNUPlot and was surprised to see that the code seems to be converting the data to double. Here is the code snippet from imshow.m: ======================================================== ## Set default display range if display_range not set yet. if (isempty (display_range)) display_range = [min(im(:)), max(im(:))]; elseif (isna (display_range)) t = class (im); switch (t) case {"double", "single", "logical"} display_range = [0, 1]; case {"int8", "int16", "int32", "uint8", "uint16", "uint32"} ## For compatibility, uint8 data should not be handled as ## double. Doing so is a quick fix to allow the images to be ## displayed correctly. display_range = double ([intmin(t), intmax(t)]); otherwise error ("imshow: invalid data type for image"); endswitch endif ====================================================== Notice that the uint8 data is actually converted to double. If I read the code correctly that would make the transmission to GNU Plot over the pipe much slower. I will have to look into the FLTK backend too. Again thanks for the help. On Mon, Nov 23, 2009 at 2:16 AM, Carlo de Falco wrote: > > On 23 Nov 2009, at 12:30, Todd Rovito wrote: > >> I just started to use Octave for some image processing work and have >> noticed how slow Octave is to display images in gnu-plot. >> On my 1 >> year old Mac Book Pro it can take 5 seconds to display a 4 mega-pixel >> 8 bit image. ?Attached is the function I use to read such image. ?I am >> wondering if I have something installed wrong or this is a natural >> behavior or Octave? ?Please understand I am not complaining about >> Octave's performance, it seems speedy on everything except for image >> display. >> >> >> Thanks for the help. > > > I am afraid this is due to the way communication between Octave and gnuplot > is implemented. > As communication is implemented via pipes, transferring the image data to > gnuplot takes about > the same time as writing the whole uncompressed image data to a file and > then reading it back. > This is one of the reasons why a new graphics backend based on OpenGL is > currently under > developement. > To get an idea of the speed improvement given by the new backend you can > try: > > sombrero (500) > close all > backend ('fltk') > sombrero (500) > > The difference is really impressive on my own white plastic Core 2 Duo > MacBook. > unfortunately the new backend does not yet support imshow in the current > stable release. > If this feature is important to you might want to consider joining the > developers mailing list > and helping get Octave 3.4 out soon. > > HTH, > c. > > > > From rovitotv at gmail.com Mon Nov 23 19:22:58 2009 From: rovitotv at gmail.com (Todd Rovito) Date: Mon, 23 Nov 2009 15:22:58 -1000 Subject: imshow is slow on Mac OSX 10.5 In-Reply-To: References: <80ED95D5-E338-4A00-AF30-4EDA559B5056@gmail.com> Message-ID: After more examination I realize that the display range being double won't have much effect on performance. On Mon, Nov 23, 2009 at 12:04 PM, Todd Rovito wrote: > Carlo, > ? Thanks for the information! ?For sure the FLTK backend is much > faster. ?I was looking at the imshow command to GNUPlot and was > surprised to see that the code seems to be converting the data to > double. ?Here is the code snippet from imshow.m: > > ======================================================== > ## Set default display range if display_range not set yet. > ?if (isempty (display_range)) > ? ?display_range = [min(im(:)), max(im(:))]; > ?elseif (isna (display_range)) > ? ?t = class (im); > ? ?switch (t) > ? ? ?case {"double", "single", "logical"} > ? ? ? ?display_range = [0, 1]; > ? ? ?case {"int8", "int16", "int32", "uint8", "uint16", "uint32"} > ? ? ? ?## For compatibility, uint8 data should not be handled as > ? ? ? ?## double. ?Doing so is a quick fix to allow the images to be > ? ? ? ?## displayed correctly. > ? ? ? ?display_range = double ([intmin(t), intmax(t)]); > ? ? ?otherwise > ? ? ? ?error ("imshow: invalid data type for image"); > ? ?endswitch > ?endif > ====================================================== > > Notice that the uint8 data is actually converted to double. ?If I read > the code correctly that would make the transmission to GNU Plot over > the pipe much slower. ?I will have to look into the FLTK backend too. > Again thanks for the help. > > On Mon, Nov 23, 2009 at 2:16 AM, Carlo de Falco wrote: >> >> On 23 Nov 2009, at 12:30, Todd Rovito wrote: >> >>> I just started to use Octave for some image processing work and have >>> noticed how slow Octave is to display images in gnu-plot. >>> On my 1 >>> year old Mac Book Pro it can take 5 seconds to display a 4 mega-pixel >>> 8 bit image. ?Attached is the function I use to read such image. ?I am >>> wondering if I have something installed wrong or this is a natural >>> behavior or Octave? ?Please understand I am not complaining about >>> Octave's performance, it seems speedy on everything except for image >>> display. >>> >>> >>> Thanks for the help. >> >> >> I am afraid this is due to the way communication between Octave and gnuplot >> is implemented. >> As communication is implemented via pipes, transferring the image data to >> gnuplot takes about >> the same time as writing the whole uncompressed image data to a file and >> then reading it back. >> This is one of the reasons why a new graphics backend based on OpenGL is >> currently under >> developement. >> To get an idea of the speed improvement given by the new backend you can >> try: >> >> sombrero (500) >> close all >> backend ('fltk') >> sombrero (500) >> >> The difference is really impressive on my own white plastic Core 2 Duo >> MacBook. >> unfortunately the new backend does not yet support imshow in the current >> stable release. >> If this feature is important to you might want to consider joining the >> developers mailing list >> and helping get Octave 3.4 out soon. >> >> HTH, >> c. >> >> >> >> > From jordigh at gmail.com Mon Nov 23 19:25:33 2009 From: jordigh at gmail.com (=?UTF-8?Q?Jordi_Guti=C3=A9rrez_Hermoso?=) Date: Mon, 23 Nov 2009 19:25:33 -0600 Subject: Sound File Images? In-Reply-To: <26447356.post@talk.nabble.com> References: <26447356.post@talk.nabble.com> Message-ID: <9543b3a40911231725q7a426a40n6500b60f488a1b81@mail.gmail.com> 2009/11/20 rs-232 : > Pardon the Noob question, but does anyone know the best method for > transferring the data from a range of samples of a sound file into a > printable image file? Have you tried using the functions from the audio package in Octave Forge? http://octave.sourceforge.net/doc/funref_audio.html From etienne at isr.ist.utl.pt Mon Nov 23 20:07:12 2009 From: etienne at isr.ist.utl.pt (etienne at isr.ist.utl.pt) Date: Mon, 23 Nov 2009 18:07:12 -0800 Subject: Need help with nelder_mead_min.m In-Reply-To: References: Message-ID: <20091123180712.81051cgeorteaym8@webmail.isr.ist.utl.pt> Hello, something like octave:408> function val = foo (xyz), val = sum (xyz .^ 2); endfunction octave:409> help nelder_mead_min [snip] ### Start nelder_mead_min() from a random point octave:410> [xyz0, val0, nev] = nelder_mead_min ("foo", randn(1,3)) xyz0 = 2.1237e-08 1.0243e-08 -4.4610e-09 val0 = 5.7582e-16 nev = 201 ### Start nelder_mead_min() from the minimum octave:411> [xyz0, val0, nev] = nelder_mead_min ("foo", [0 0 0]) xyz0 = 0 0 0 val0 = 0 nev = 236 Hth, Etienne Quoting ???????? ??????? (Mon, 23 Nov 2009 21:43:57 +0300): > Hi all! > > I can't figure out how to work with this function. I will be very > glad if one could explain the subject. > > > For an example lets see the problem. > > > function y = foo (x, y, z) > ? ? y = x**2 + y**2 + z**2; > endfunction > > > I need to find a minima of the foo in [-1;1]*[-1;1]*[-1;1] region. > I know the answer, but how I must set up an options and arguments > for nelder_mead_min.m? > > > Best regards, > Grigory? -- http://www.isr.ist.utl.pt/~etienne ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program. From mollet at pacbell.net Mon Nov 23 20:31:02 2009 From: mollet at pacbell.net (Henry F. Mollet) Date: Mon, 23 Nov 2009 18:31:02 -0800 Subject: playaduio in octave 3.2.3 In-Reply-To: <69d8d540911230519i1d9a02c6m2ced33f850c925db@mail.gmail.com> Message-ID: on 11/23/09 5:19 AM, Jaroslav Hajek at highegg at gmail.com wrote: > On Sat, Nov 21, 2009 at 6:39 AM, Adrian pamin wrote: > >> Hi, >> Im a little new to using octave and GNU systems but there seems to be a >> problem with the playaudio() function in the Octave 3.2.3 patch. When trying >> to use the playaudio(x) the error "The system cannot find the path >> specified." I have tried this in a Vista and Win XP system yielding the same >> results. Below is the code used: >> >> t = [0:1/8000:2] >> sig3 = 0.8*sin(2*pi*3*t) >> plot(t,sig3) >> playaudio(sig3) >> >> My friends and professor are stumped with this error as they can use the >> function without problems on a Linux and Mac OS. Is this possibly a Windows >> problem? would switching to a VM or dual booting help? Thanks in advance... >> >> > I'm afraid the current playaudio is only designed to run on Unix systems, > because all it does is send data to /dev/dsp or /dev/audio. There could > probably be an alternative path for Windows, using a temporary wav file or > something similar. > > hth I cannot find /dev/dsp or /dev/audio on my mac: [/dev] -bash-2.05b 504$ locate /dev/dsp [/dev] -bash-2.05b 505$ locate /dev/audio [/dev] -bash-2.05b 506$ Accordingly? : octave-3.2.2:1> t = [0:1/8000:2]; octave-3.2.2:2> sig3 = 0.8*sin(2*pi*3*t); octave-3.2.2:3> plot(t,sig3) octave-3.2.2:4> playaudio(sig3) sh: line 1: /dev/dsp: Permission denied octave-3.2.2:5> help playaudio `playaudio' is a function from the file /Applications/Octave.app/Contents/Resources/share/octave/3.2.2/m/audio/playa udio.m -- Function File: playaudio (NAME, EXT) -- Function File: playaudio (X) Plays the audio file `NAME.EXT' or the audio data stored in the vector X. See also: lin2mu, mu2lin, loadaudio, saveaudio, setaudio, record Henry From highegg at gmail.com Tue Nov 24 01:11:59 2009 From: highegg at gmail.com (Jaroslav Hajek) Date: Tue, 24 Nov 2009 08:11:59 +0100 Subject: keyboard does not provide local context In-Reply-To: <19206.48464.134641.483029@segfault.lan> References: <75a01c1d0911200716l33236314s1da9791fdb066780@mail.gmail.com> <19206.48464.134641.483029@segfault.lan> Message-ID: <69d8d540911232311o773a4ff9r12bca2c0fba2b664@mail.gmail.com> On Fri, Nov 20, 2009 at 5:01 PM, John W. Eaton wrote: > On 20-Nov-2009, Eric Chassande-Mottin wrote: > > | using foo.m below, > | if I say foo(1) from prompt I get access to local vars > | > | octave3.2:1> foo(1) > | keyboard: stopped in /home/ecm/foo.m > | a = 1 > | debug> whos > | Variables in the current scope: > | > | Attr Name Size Bytes Class > | ==== ==== ==== ===== ===== > | a 1x1 8 double > | argn 1x1 1 char > | f x 1x1 8 double > | > | Total is 3 elements using 17 bytes > | > | but when calling foo() from a script I don't > | > | octave3.2:1> test > | keyboard: stopped in /home/ecm/foo.m > | b = 2 > | a = 1 > | debug> whos > | Variables in the current scope: > | > | Attr Name Size Bytes Class > | ==== ==== ==== ===== ===== > | ans 1x30 30 char > | b 1x1 8 double > | > | Total is 31 elements using 38 bytes > | > | why is that? is there a way to access local vars when calling from a > script? > | > | I am using > | > | GNU Octave, version 3.2.3 > > It's best to report bugs to the bug at octave.org list. > > This problem has been reported several times now and it is fixed in > the current development version of Octave. > > I think the relevant patches are > > http://hg.savannah.gnu.org/hgweb/octave/rev/fb22dd5d6242 > http://hg.savannah.gnu.org/hgweb/octave/rev/25c2e92ee03c > http://hg.savannah.gnu.org/hgweb/octave/rev/bbe033dcfe13 > > Jaroslav, I think it is safe to apply the first two to the 3.2.x > branch. I'm not so sure about the third one though as it removes some > variables from a class and changes at least one function signature, > which might cause some binary compatibility problems. > These don't apply due to unwind_protect changes. I think the second one reverts the first one, so maybe it would suffice to adapt the second one for 3.2.x. Does it make sense without also taking the third one? -- RNDr. Jaroslav Hajek computing expert & GNU Octave developer Aeronautical Research and Test Institute (VZLU) Prague, Czech Republic url: www.highegg.matfyz.cz -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091124/a2770b9b/attachment.html From xaerochina at gmail.com Tue Nov 24 09:18:18 2009 From: xaerochina at gmail.com (Chengqi Chang) Date: Tue, 24 Nov 2009 23:18:18 +0800 Subject: CUDA acceleration in GNU Octave In-Reply-To: <19209.16160.892121.182192@segfault.lan> References: <19209.16160.892121.182192@segfault.lan> Message-ID: On Sun, 22 Nov 2009 21:39:44 +0800, John W. Eaton wrote: > On 22-Nov-2009, Chengqi Chang wrote: > > | I think it would be great if someone can provide a "bridge" -- like MPI > | toolbox(http://atc.ugr.es/javier-bin/mpitb) -- connecting Octave and > CUDA > | computing libraries. Besides, in my opinion, it matters little whether > | this "bridge" is universal or tied to a single vendor (Nv/ATI). Both of > | the two choices have merits and drawbacks. If it is tied to a single > | vendor, it can be easier to take advantage of some special features of > the > | GPU and it also has a larger possibility to get donation from that > vendor. > > Are the libraries that take advantage of this single vendor > distributed under a license that is compatible with the GPL? > > If so, then I think this would be acceptable, but not great as it is > still ties you to a single vendor. > > If not, then you would not be able to distribute .oct files that > require these libraries, and such an extension would never become a > part of the core Octave itself. The Octave project is about software > freedom, not about promoting links to proprietary software, or > encouraging users to lock themselves into single-vendor solutions. > > jwe GPL compatibility depends on how the libraries use CUDA -- if the libs only call them, GPL can be retained. Since there are limited numbers of popular vendors, it is possible to initialize different projects. Once you buy your graphic card, you are actually tied to a vendor. BTW, I like the freedom philosophy as well, while I think whether the freedom is pure or conditional on some exogenous constraints can be equally acceptable. -- Best Regards! --------------------------- Sincerely Yours Chengqi Chang China Center for Economic Research Mail: XaeroChina at Gmail.com Personal Website: http://macro2.cn From yamane at diamondcut.com.br Tue Nov 24 13:29:51 2009 From: yamane at diamondcut.com.br (Renato S. Yamane) Date: Tue, 24 Nov 2009 17:29:51 -0200 Subject: Multiply some colums, discarding others Message-ID: <4B0C342F.8010607@diamondcut.com.br> Hi, I have a doubt about how can I use Octave :-) E.g.: Matrix A is "freq", "impedance" and "phase", like this: A = 20.66 12.32 49.63 21.47 13.75 48.86 22.30 15.92 47.71 23.17 18.43 45.06 24.07 22.61 39.76 I would like to get another Matrix, B, with the result of multiplication of "impedance" and "phase", like this: A(1,2) * cos(A(1,3)) A(2,2) * cos(A(2,3)) A(3,2) * cos(A(3,3)) A(4,2) * cos(A(4,3)) A(5,2) * cos(A(5,3)) As you can see, the collum "frequency" is not used. The problem is: Matrix "A" have a lot of lines and I need avoid type one by one, so I would like to know if is possible multiply *automatically* to get "frequency" and multiplication of impedance and phase, like this: Matrix "B" = 20.66 A(1,2) * cos(A(1,3)) 21.47 A(2,2) * cos(A(2,3)) 22.30 A(3,2) * cos(A(3,3)) 23.17 A(4,2) * cos(A(4,3)) 24.07 A(5,2) * cos(A(5,3)) Regards, Renato S. Yamane From dbateman at dbateman.org Tue Nov 24 13:40:55 2009 From: dbateman at dbateman.org (David Bateman) Date: Tue, 24 Nov 2009 20:40:55 +0100 Subject: Multiply some colums, discarding others In-Reply-To: <4B0C342F.8010607@diamondcut.com.br> References: <4B0C342F.8010607@diamondcut.com.br> Message-ID: <4B0C36C7.5060007@dbateman.org> Renato S. Yamane wrote: > Hi, > > I have a doubt about how can I use Octave :-) > > E.g.: > > Matrix A is "freq", "impedance" and "phase", like this: > > A = > 20.66 12.32 49.63 > 21.47 13.75 48.86 > 22.30 15.92 47.71 > 23.17 18.43 45.06 > 24.07 22.61 39.76 > > I would like to get another Matrix, B, with the result of multiplication > of "impedance" and "phase", like this: > > A(1,2) * cos(A(1,3)) > A(2,2) * cos(A(2,3)) > A(3,2) * cos(A(3,3)) > A(4,2) * cos(A(4,3)) > A(5,2) * cos(A(5,3)) > > A(:,2).*cos(A(:,3)) > As you can see, the collum "frequency" is not used. > > The problem is: Matrix "A" have a lot ofA lines and I need avoid type one > by one, so I would like to know if is possible multiply *automatically* > to get "frequency" and multiplication of impedance and phase, like this: > > Matrix "B" = > > 20.66 A(1,2) * cos(A(1,3)) > 21.47 A(2,2) * cos(A(2,3)) > 22.30 A(3,2) * cos(A(3,3)) > 23.17 A(4,2) * cos(A(4,3)) > 24.07 A(5,2) * cos(A(5,3)) > [A(:,1),A(:,2).*cos(A(:,3))] > Regards, > Renato S. Yamane > _______________________________________________ > Help-octave mailing list > Help-octave at octave.org > https://www-old.cae.wisc.edu/mailman/listinfo/help-octave > > From norm_hecht at ricochet.com Tue Nov 24 13:49:42 2009 From: norm_hecht at ricochet.com (Norm Hecht) Date: Tue, 24 Nov 2009 12:49:42 -0700 Subject: Multiply some colums, discarding others In-Reply-To: <4B0C342F.8010607@diamondcut.com.br> References: <4B0C342F.8010607@diamondcut.com.br> Message-ID: Try B = [A(:,1) A(:,2).*A(:,3)] Norm Hecht Thornton, CO, USA On Nov 24, 2009, at 12:29 PM, Renato S. Yamane wrote: > Hi, > > I have a doubt about how can I use Octave :-) > > E.g.: > > Matrix A is "freq", "impedance" and "phase", like this: > > A = > 20.66 12.32 49.63 > 21.47 13.75 48.86 > 22.30 15.92 47.71 > 23.17 18.43 45.06 > 24.07 22.61 39.76 > > I would like to get another Matrix, B, with the result of multiplication > of "impedance" and "phase", like this: > > A(1,2) * cos(A(1,3)) > A(2,2) * cos(A(2,3)) > A(3,2) * cos(A(3,3)) > A(4,2) * cos(A(4,3)) > A(5,2) * cos(A(5,3)) > > As you can see, the collum "frequency" is not used. > > The problem is: Matrix "A" have a lot of lines and I need avoid type one > by one, so I would like to know if is possible multiply *automatically* > to get "frequency" and multiplication of impedance and phase, like this: > > Matrix "B" = > > 20.66 A(1,2) * cos(A(1,3)) > 21.47 A(2,2) * cos(A(2,3)) > 22.30 A(3,2) * cos(A(3,3)) > 23.17 A(4,2) * cos(A(4,3)) > 24.07 A(5,2) * cos(A(5,3)) > > Regards, > Renato S. Yamane > _______________________________________________ > Help-octave mailing list > Help-octave at octave.org > https://www-old.cae.wisc.edu/mailman/listinfo/help-octave From macy at sfo.com Tue Nov 24 13:50:37 2009 From: macy at sfo.com (macy at sfo.com) Date: Tue, 24 Nov 2009 11:50:37 -0800 (PST) Subject: Multiply some colums, discarding others In-Reply-To: <4B0C342F.8010607@diamondcut.com.br> References: <4B0C342F.8010607@diamondcut.com.br> Message-ID: <2046.66.81.37.136.1259092237.squirrel@cp01.sfo.com> you might try: >> B = [ A(:,1), A(:,2).*cos(A(:,3)) ]; > Hi, > > I have a doubt about how can I use Octave :-) > > E.g.: > > Matrix A is "freq", "impedance" and "phase", like this: > > A = > 20.66 12.32 49.63 > 21.47 13.75 48.86 > 22.30 15.92 47.71 > 23.17 18.43 45.06 > 24.07 22.61 39.76 > > I would like to get another Matrix, B, with the result of multiplication > of "impedance" and "phase", like this: > > A(1,2) * cos(A(1,3)) > A(2,2) * cos(A(2,3)) > A(3,2) * cos(A(3,3)) > A(4,2) * cos(A(4,3)) > A(5,2) * cos(A(5,3)) > > As you can see, the collum "frequency" is not used. > > The problem is: Matrix "A" have a lot of lines and I need avoid type one > by one, so I would like to know if is possible multiply *automatically* > to get "frequency" and multiplication of impedance and phase, like this: > > Matrix "B" = > > 20.66 A(1,2) * cos(A(1,3)) > 21.47 A(2,2) * cos(A(2,3)) > 22.30 A(3,2) * cos(A(3,3)) > 23.17 A(4,2) * cos(A(4,3)) > 24.07 A(5,2) * cos(A(5,3)) > > Regards, > Renato S. Yamane From yamane at diamondcut.com.br Tue Nov 24 13:52:34 2009 From: yamane at diamondcut.com.br (Renato S. Yamane) Date: Tue, 24 Nov 2009 17:52:34 -0200 Subject: Multiply some colums, discarding others In-Reply-To: <4B0C36C7.5060007@dbateman.org> References: <4B0C342F.8010607@diamondcut.com.br> <4B0C36C7.5060007@dbateman.org> Message-ID: <4B0C3982.6030906@diamondcut.com.br> On 24-11-2009 17:40, David Bateman wrote: >> The problem is: Matrix "A" have a lot ofA lines and I need avoid type >> one by one, so I would like to know if is possible multiply >> *automatically* to get "frequency" and multiplication of impedance and >> phase, like this: >> >> Matrix "B" = >> >> 20.66 A(1,2) * cos(A(1,3)) >> 21.47 A(2,2) * cos(A(2,3)) >> 22.30 A(3,2) * cos(A(3,3)) >> 23.17 A(4,2) * cos(A(4,3)) >> 24.07 A(5,2) * cos(A(5,3)) > > [A(:,1),A(:,2).*cos(A(:,3))] Thanks so much David and Norm! I really apreciate it! Regards, Renato From storrsjm at email.uc.edu Tue Nov 24 13:52:45 2009 From: storrsjm at email.uc.edu (Judd Storrs) Date: Tue, 24 Nov 2009 14:52:45 -0500 Subject: Multiply some colums, discarding others In-Reply-To: <4B0C342F.8010607@diamondcut.com.br> References: <4B0C342F.8010607@diamondcut.com.br> Message-ID: On Tue, Nov 24, 2009 at 2:29 PM, Renato S. Yamane wrote: > > Matrix "B" = > > ? ? ? ?20.66 ? ? ?A(1,2) * cos(A(1,3)) > ? ? ? ?21.47 ? ? ?A(2,2) * cos(A(2,3)) > ? ? ? ?22.30 ? ? ?A(3,2) * cos(A(3,3)) > ? ? ? ?23.17 ? ? ?A(4,2) * cos(A(4,3)) > ? ? ? ?24.07 ? ? ?A(5,2) * cos(A(5,3)) > You can extract columns using this notation A(:,1) A(:,2) A(:,3) More about this here: http://www.gnu.org/software/octave/doc/interpreter/Index-Expressions.html#Index-Expressions You can then compute the second column at once like this: A(:,2).*cos(A(:,3)) Notice the .* part. This is element wise multiplication instead of matrix multiplication. More about this here: http://www.gnu.org/software/octave/doc/interpreter/Arithmetic-Ops.html#Arithmetic-Ops You can also combine columns using the [ ] syntax. Putting this all together, I think this does what you want: [ A(:,1), A(:,2).*cos(A(:,3)) ] --judd From ron.simonson at analog.com Tue Nov 24 14:15:15 2009 From: ron.simonson at analog.com (Ron.Simonson) Date: Tue, 24 Nov 2009 12:15:15 -0800 Subject: Multiply some colums, discarding others In-Reply-To: <4B0C342F.8010607@diamondcut.com.br> References: <4B0C342F.8010607@diamondcut.com.br> Message-ID: <4B0C3ED3.6070306@analog.com> Good afternoon Renato, The approach I would take to your problem is as follows: # Matrix A is "freq", "impedance" and "phase", like this: # properly define the Matrix A A = [20.66, 12.32, 49.63; 21.47, 13.75, 48.86; 22.30, 15.92, 47.71; 23.17, 18.43, 45.06; 24.07, 22.61, 39.76]; # I would like to get another Matrix, B, with the result of # multiplication of "impedance" and "phase": # # A(1,2) * cos(A(1,3) # A(2,2) * cos(A(2,3)) # A(3,2) * cos(A(3,3)) # A(4,2) * cos(A(4,3)) # A(5,2) * cos(A(5,3)) # # # Matrix "B" = # # 20.66 A(1,2) * cos(A(1,3)) # 21.47 A(2,2) * cos(A(2,3)) # 22.30 A(3,2) * cos(A(3,3)) # 23.17 A(4,2) * cos(A(4,3)) # 24.07 A(5,2) * cos(A(5,3)) freq = A(:,1); # extract column 1 data into freq vector impedance = A(:,2); # extract column 2 data into impedance vector phase = A(:,3); # extract column 3 data into phase vector B = [freq impedance .* cos(phase)]; # generate desired B matrix B clear freq impedance phase; # scuttle freq, impedance, and phase vectors # clearing variables helps to recover memory when needed Though not efficient in terms of storage and likely speed, extracting the data into named variables helps me to keep track of what each variable is. I am not an expert by any means. Thanks to all the expert users/programmers on this list for all the help I have gleaned from your posts. I store away so many of your suggestions and hints that I am actually able to use octave for most of my data analysis needs. A very special thanks to Professor Eaton. Talk to you later. Ron. From highegg at gmail.com Tue Nov 24 14:27:00 2009 From: highegg at gmail.com (Jaroslav Hajek) Date: Tue, 24 Nov 2009 21:27:00 +0100 Subject: Multiply some colums, discarding others In-Reply-To: <4B0C3ED3.6070306@analog.com> References: <4B0C342F.8010607@diamondcut.com.br> <4B0C3ED3.6070306@analog.com> Message-ID: <69d8d540911241227i6a9df125kf2847a755e1fbb1b@mail.gmail.com> On Tue, Nov 24, 2009 at 9:15 PM, Ron.Simonson wrote: > Good afternoon Renato, The approach I would take to your > problem is as follows: > > # Matrix A is "freq", "impedance" and "phase", like this: > > # properly define the Matrix A > A = [20.66, 12.32, 49.63; > 21.47, 13.75, 48.86; > 22.30, 15.92, 47.71; > 23.17, 18.43, 45.06; > 24.07, 22.61, 39.76]; > > # I would like to get another Matrix, B, with the result of > # multiplication of "impedance" and "phase": > # > # A(1,2) * cos(A(1,3) > # A(2,2) * cos(A(2,3)) > # A(3,2) * cos(A(3,3)) > # A(4,2) * cos(A(4,3)) > # A(5,2) * cos(A(5,3)) > # > # > # Matrix "B" = > # > # 20.66 A(1,2) * cos(A(1,3)) > # 21.47 A(2,2) * cos(A(2,3)) > # 22.30 A(3,2) * cos(A(3,3)) > # 23.17 A(4,2) * cos(A(4,3)) > # 24.07 A(5,2) * cos(A(5,3)) > > freq = A(:,1); # extract column 1 data into freq vector > impedance = A(:,2); # extract column 2 data into impedance vector > phase = A(:,3); # extract column 3 data into phase vector > > B = [freq impedance .* cos(phase)]; # generate desired B matrix > B > clear freq impedance phase; # scuttle freq, impedance, and phase vectors > # clearing variables helps to recover memory when needed > > Though not efficient in terms of storage and likely speed, extracting > the data into named variables helps me to keep track of what each > variable is. I am not an expert by any means. > > Basically all Octave expressions are reference-counted values, so storing an expression into a variable never (well, almost never) causes any extra copying. Hence your approach carries essentially no extra penalty. -- RNDr. Jaroslav Hajek computing expert & GNU Octave developer Aeronautical Research and Test Institute (VZLU) Prague, Czech Republic url: www.highegg.matfyz.cz -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091124/ef08409a/attachment.html From cloetens at esrf.fr Tue Nov 24 14:45:40 2009 From: cloetens at esrf.fr (Peter Cloetens) Date: Tue, 24 Nov 2009 21:45:40 +0100 Subject: edit on a read only file Message-ID: <4B0C45F4.1080906@esrf.eu> Hello, When you call 'edit' on a read only file, a copy of the file is made in your home directory and the copy is edited. People tend to edit scripts just to view the code and learn from it. The issue is that after they used 'edit' a single time on a standard script they will have a copy in their home directory that will become their default. This copy will not be maintained and necessarily give incompatibility issues with later versions of octave. Is there a way to change this behavior and just edit the read only file as it is (read only)? It could be solved by asking the user if a copy should be made or not, something along the lines: ## If the file exists and is modifiable in place then edit it, ## otherwise copy it and then edit it. if (! isempty (path)) fid = fopen (path, "r+t"); if (fid < 0) copyreadonly = input("File is read-only, make a copy [y/n] ? ","s"); if strcmp(copyreadonly, "y") from = path; path = strcat (FUNCTION.HOME, from (rindex (from, filesep):end)) [status, msg] = copyfile (from, path, 1); if (status == 0) error (msg); endif endif else fclose(fid); endif system (sprintf (FUNCTION.EDITOR, strcat ("\"", path, "\"")), [], FUNCTION.MODE); return; endif Peter -- Peter Cloetens X-Ray Imaging Group Tel: +33 4 76 88 26 50 Mailto: cloetens at esrf.eu European Synchrotron Radiation Facility (ESRF) 6 rue Jules Horowitz F-38043 Grenoble http://www.esrf.eu From highegg at gmail.com Tue Nov 24 14:53:49 2009 From: highegg at gmail.com (Jaroslav Hajek) Date: Tue, 24 Nov 2009 21:53:49 +0100 Subject: edit on a read only file In-Reply-To: <4B0C45F4.1080906@esrf.eu> References: <4B0C45F4.1080906@esrf.eu> Message-ID: <69d8d540911241253t31b5a054td4330ebcfa90400@mail.gmail.com> On Tue, Nov 24, 2009 at 9:45 PM, Peter Cloetens wrote: > Hello, > When you call 'edit' on a read only file, a copy of the file is made in > your home directory and the copy is edited. > People tend to edit scripts just to view the code and learn from it. The > issue is that after they used 'edit' a single time on a standard script > they will have a copy in their home directory that will become their > default. > This copy will not be maintained and necessarily give incompatibility > issues with later versions of octave. > Is there a way to change this behavior and just edit the read only file > as it is (read only)? > It could be solved by asking the user if a copy should be made or not, > something along the lines: > > ## If the file exists and is modifiable in place then edit it, > ## otherwise copy it and then edit it. > if (! isempty (path)) > fid = fopen (path, "r+t"); > if (fid < 0) > copyreadonly = input("File is read-only, make a copy [y/n] ? ","s"); > if strcmp(copyreadonly, "y") > from = path; > path = strcat (FUNCTION.HOME, from (rindex (from, filesep):end)) > [status, msg] = copyfile (from, path, 1); > if (status == 0) > error (msg); > endif > endif > else > fclose(fid); > endif > system (sprintf (FUNCTION.EDITOR, strcat ("\"", path, "\"")), > [], FUNCTION.MODE); > return; > endif > > Peter > > > > -- > Peter Cloetens > X-Ray Imaging Group > Tel: +33 4 76 88 26 50 > Mailto: cloetens at esrf.eu > > European Synchrotron Radiation Facility (ESRF) > 6 rue Jules Horowitz > F-38043 Grenoble > http://www.esrf.eu > > Add this to your ~/.octaverc: edit editinplace true hth -- RNDr. Jaroslav Hajek computing expert & GNU Octave developer Aeronautical Research and Test Institute (VZLU) Prague, Czech Republic url: www.highegg.matfyz.cz -------------- next part -------------- An HTML attachment was scrubbed... URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091124/cc04c180/attachment.html From cloetens at esrf.fr Tue Nov 24 16:26:53 2009 From: cloetens at esrf.fr (Peter Cloetens) Date: Tue, 24 Nov 2009 23:26:53 +0100 Subject: edit on a read only file In-Reply-To: <69d8d540911241253t31b5a054td4330ebcfa90400@mail.gmail.com> References: <4B0C45F4.1080906@esrf.eu> <69d8d540911241253t31b5a054td4330ebcfa90400@mail.gmail.com> Message-ID: <4B0C5DAD.8080500@esrf.eu> Jaroslav Hajek wrote: > > > On Tue, Nov 24, 2009 at 9:45 PM, Peter Cloetens > wrote: > > Hello, > When you call 'edit' on a read only file, a copy of the file is > made in > your home directory and the copy is edited. > People tend to edit scripts just to view the code and learn from > it. The > issue is that after they used 'edit' a single time on a standard > script > they will have a copy in their home directory that will become their > default. > This copy will not be maintained and necessarily give incompatibility > issues with later versions of octave. > Is there a way to change this behavior and just edit the read only > file > as it is (read only)? > It could be solved by asking the user if a copy should be made or not, > something along the lines: > > ## If the file exists and is modifiable in place then edit it, > ## otherwise copy it and then edit it. > if (! isempty (path)) > fid = fopen (path, "r+t"); > if (fid < 0) > copyreadonly = input("File is read-only, make a copy [y/n] ? > ","s"); > if strcmp(copyreadonly, "y") > from = path; > path = strcat (FUNCTION.HOME, from (rindex (from, > filesep):end)) > [status, msg] = copyfile (from, path, 1); > if (status == 0) > error (msg); > endif > endif > else > fclose(fid); > endif > system (sprintf (FUNCTION.EDITOR, strcat ("\"", path, "\"")), > [], FUNCTION.MODE); > return; > endif > > Peter > > > > -- > Peter Cloetens > X-Ray Imaging Group > Tel: +33 4 76 88 26 50 > Mailto: cloetens at esrf.eu > > European Synchrotron Radiation Facility (ESRF) > 6 rue Jules Horowitz > F-38043 Grenoble > http://www.esrf.eu > > > > Add this to your ~/.octaverc: > edit editinplace true > > hth > -- > RNDr. Jaroslav Hajek > computing expert & GNU Octave developer > Aeronautical Research and Test Institute (VZLU) > Prague, Czech Republic > url: www.highegg.matfyz.cz Thanks a lot. I did not notice this possibility because we are still using version 3.0.5. Peter