From Samuel.Gougeon at univ-lemans.fr Mon Jun 1 00:35:53 2009 From: Samuel.Gougeon at univ-lemans.fr (Samuel GOUGEON) Date: Mon, 01 Jun 2009 00:35:53 +0200 Subject: [Scilab-Dev] x_mdialog for editing matrices In-Reply-To: <1243808273.4016.17.camel@faith.universe> References: <1243808273.4016.17.camel@faith.universe> Message-ID: <4A230649.4040401@univ-lemans.fr> (Follow-up redirected to users@ instead of dev@ ) ----- Message d'origine ----- De : Kirill Kirillov Date : 01/06/2009 00:17: > Hi! > > I've tried to use x_mdialog function for editing matrices using idea > found in Scilab demos (GUI dialog example), but it seems that this > function is not suitable for this. > > Take a look at the following example: > rows = ['row1' 'row2']; > cols = ['col1' 'col2' 'col3']; > test = [1 1 1; 0 0 0]; > x_mdialog('Testing', rows, cols, string(test)) > > Results: > 1) [1 0 1; 0 1 0] in row1 and row2 instead original [1 1 1; 0 0 0]; > 2) col1, col2 and col3 should be shifted to be above correspondent cells > > Are these bugs? > Strange, indeed. Have you tried with x_matrix() ? From Samuel.Gougeon at univ-lemans.fr Mon Jun 1 00:42:03 2009 From: Samuel.Gougeon at univ-lemans.fr (Samuel GOUGEON) Date: Mon, 01 Jun 2009 00:42:03 +0200 Subject: [scilab-Users] Re: [Scilab-Dev] x_mdialog for editing matrices In-Reply-To: <4A230649.4040401@univ-lemans.fr> References: <1243808273.4016.17.camel@faith.universe> <4A230649.4040401@univ-lemans.fr> Message-ID: <4A2307BB.5020408@univ-lemans.fr> >> Take a look at the following example: >> rows = ['row1' 'row2']; >> cols = ['col1' 'col2' 'col3']; >> test = [1 1 1; 0 0 0]; >> x_mdialog('Testing', rows, cols, string(test)) >> >> ..../... >> >> Are these bugs? Yes it is. Try the same with test = [1 2 3; 4 5 6 ; 7 8 9]; The display is transposed... From stephane.mottelet at utc.fr Thu Jun 4 12:34:32 2009 From: stephane.mottelet at utc.fr (=?UTF-8?B?U3TCjsOpcGhhbmUgTW90dGVsZXQ=?=) Date: Thu, 04 Jun 2009 12:34:32 +0200 Subject: Bizarre figure_size convention in 5.1.1 In-Reply-To: <4A0C2878.7020202@utc.fr> References: <4A02F34E.8020205@utc.fr> <1241786374.4977.34.camel@zlarin> <4A0BCBD1.60305@utc.fr> <1242287201.4719.13149.camel@korcula.inria.fr> <4A0BCE8E.1090200@utc.fr> <1242288182.4719.13210.camel@korcula.inria.fr> <4A0BD177.4020802@utc.fr> <4A0C2878.7020202@utc.fr> Message-ID: <4A27A338.4010309@utc.fr> Hi all, this as been bugzilled #4521, but I discovered that really big problems are a consequence of this issue. I am currently developping a feature which needs to identify the handle of an axis where a mouse clik occured (with an event_handler function). Since the coordinates recovered in the event handler function are integer coordinates in the *real*canvas of the figure, it is impossible to compute the real limits of the axis in pixel coordinates (using the axis_bounds property), since the figure_size property is wrong (the height is not equal to the height of the canvas). I now there may be more critical bugs, but this one is really problematic for people developping some stuff related to graphics... S. St??phane Mottelet a ?crit : > Hi again, > > seems that the figure_size definition has changed in 5.1.1, this > causes some > different behaviour between e.g. 4.1.2 and scilab>5. > > In Scilab 5.1.1, at least under windows xp, the height of the figure > given > by get(gcf(), figure_size) is equal to the full height of the window, > taking > into account the height of the scilab toolbar and the height of the > window > manager's window bar. > > In Scilab 4.1.2, the height given by figure_size is equal to the > height of > the canvas + the height of the Scilab toolbar. > > In Matlab, the height of the window given by get(gcf,'Position') is > equal to > the height of the canvas, which seems to be the most logical option (i.e. > platform independent). > > S. > From outrosdiasvirao at yahoo.com.br Fri Jun 5 04:35:32 2009 From: outrosdiasvirao at yahoo.com.br (Lucio Agostinho Rocha) Date: Thu, 4 Jun 2009 19:35:32 -0700 (PDT) Subject: Bug or restriction with matrices? Message-ID: <874467.90509.qm@web52710.mail.re2.yahoo.com> Hi, I'm working with matrices and I observed this strange behavior. I'd like to acquire as result a matrix with ten lines and ten columns. Then, I tried two things: //---Start program clear; m=zeros(10,10); function [] = test() test1(m); m(5,1)=1; disp(m); endfunction function [] = test1(m) m(5,1)=1; disp(m); endfunction //---End program When I use 'test1' function I acquire the expected result, but when I use only 'test' function, considering 'm' as global, the attribution 'cut' my matrix. Why this occurs? Thanks in advance, Lucio ..... Veja quais s?o os assuntos do momento no Yahoo! +Buscados http://br.maisbuscados.yahoo.com From Samuel.Gougeon at univ-lemans.fr Fri Jun 5 12:04:26 2009 From: Samuel.Gougeon at univ-lemans.fr (Samuel GOUGEON) Date: Fri, 05 Jun 2009 12:04:26 +0200 Subject: [scilab-Users] Bug or restriction with matrices? In-Reply-To: <874467.90509.qm@web52710.mail.re2.yahoo.com> References: <874467.90509.qm@web52710.mail.re2.yahoo.com> Message-ID: <4A28EDAA.1000602@univ-lemans.fr> ----- Message d'origine ----- De : Lucio Agostinho Rocha Date : 05/06/2009 04:35: > Hi, > > I'm working with matrices and I observed this strange behavior. I'd like to acquire as result a matrix with ten lines and ten columns. Then, I tried two things: > > //---Start program > clear; > m=zeros(10,10); > function [] = test() > > test1(m); > > m(5,1)=1; > disp(m); > endfunction > > function [] = test1(m) > > m(5,1)=1; > disp(m); > > endfunction > > //---End program > > When I use 'test1' function I acquire the expected result, but when I use only 'test' function, considering 'm' as global, the attribution 'cut' my matrix. Why this occurs? > > Thanks in advance, > > Lucio > Hello Lucio, The "m" in the test1(m) prototype is a local copy of the expected argument. Then, when you run test1() without argument, no m matrix is copied (and a bit surprisingly, no error occurs). So, the m(5,1)=1 statement creates the m from scratch, as a minimal object, here a column of 5 lines with 1 at the fifth one, and by default 0 on previous lines. In the test() definition, writing m(1,4)=1 will then display the 0 0 0 1 line-vector instead. It is the same in the test() definition: The test1(m) statement does not modify m (that is a copy of the one from the calling level), since test1() has no output argument. It just displays it. The following m(5,1)=1; statement modifies the local copy of m, that you display just after that, with the expected output. The m matrix of the calling level is not modified (always only zeros). HTH Regards Samuel From Samuel.Gougeon at univ-lemans.fr Fri Jun 5 12:08:16 2009 From: Samuel.Gougeon at univ-lemans.fr (Samuel GOUGEON) Date: Fri, 05 Jun 2009 12:08:16 +0200 Subject: [scilab-Users] Bug or restriction with matrices? In-Reply-To: <4A28EDAA.1000602@univ-lemans.fr> References: <874467.90509.qm@web52710.mail.re2.yahoo.com> <4A28EDAA.1000602@univ-lemans.fr> Message-ID: <4A28EE90.8070403@univ-lemans.fr> ----- Message d'origine ----- De : Samuel GOUGEON Date : 05/06/2009 12:04: > .../... > The "m" in the test1(m) prototype is a local copy of the expected > argument. > Then, when you run test1() without argument, no m matrix is copied > (and a bit surprisingly, no error occurs). So, the m(5,1)=1 statement > creates the m from scratch, as a minimal object, here a column of 5 > lines with 1 at the fifth one, and by default 0 on previous lines. > In the test() definition, writing m(1,4)=1 will then display the 0 0 > 0 1 > line-vector instead. Sorry, mistake: In the test*1(*) d?finition, writing m(1,4)=1; ..etc -------------- next part -------------- An HTML attachment was scrubbed... URL: From andreucci at dmmm.uniroma1.it Fri Jun 5 12:08:36 2009 From: andreucci at dmmm.uniroma1.it (Daniele Andreucci) Date: Fri, 05 Jun 2009 12:08:36 +0200 Subject: [scilab-Users] Bug or restriction with matrices? In-Reply-To: <874467.90509.qm@web52710.mail.re2.yahoo.com> References: <874467.90509.qm@web52710.mail.re2.yahoo.com> Message-ID: <4A28EEA4.2020301@dmmm.uniroma1.it> Lucio Agostinho Rocha wrote on 06/05/09 04:35: > Hi, > > I'm working with matrices and I observed this strange behavior. I'd like to acquire as result a matrix with ten lines and ten columns. Then, I tried two things: > > //---Start program > clear; > m=zeros(10,10); > function [] = test() > > test1(m); > > m(5,1)=1; > disp(m); > endfunction > > function [] = test1(m) > > m(5,1)=1; > disp(m); > > endfunction > > //---End program > > When I use 'test1' function I acquire the expected result, but when I use only 'test' function, considering 'm' as global, the attribution 'cut' my matrix. Why this occurs? > > Thanks in advance, > > Lucio > ..... > > Dear Lucio, was it because you did not declare global m; inside test? This way it works for me. If you also declare global m; in the main program, m is changed globally. Daniele -- [ Daniele Andreucci [ Dip. di Metodi e Modelli Matematici [ via A. Scarpa 16 00161 Roma, Italy [ tel. +39 0649766785 [ fax +39 064957647 [ e-mail: andreucci at dmmm.uniroma1.it [ http://www.dmmm.uniroma1.it/~andreucci/ [ gpg pub key id: D3ADC732 -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 197 bytes Desc: OpenPGP digital signature URL: From quiroga.d.a at gmail.com Fri Jun 5 20:58:06 2009 From: quiroga.d.a at gmail.com (David Alfredo Quiroga) Date: Fri, 5 Jun 2009 15:58:06 -0300 Subject: Visual Fortran run-time error Message-ID: <5ea1d0360906051158n1fac278eked4d621db6475fcf@mail.gmail.com> Hi, I've just installed Scilab 5.1.1 on windows xp professional. I wrote an .sce file and when I trie to run it doing Ctrl+l from scipad I get a 'Visual Fortran run-time error' and after I click 'Accept' the program closes. The .sce file and the error screenshot are attached. If I run scilex with no GUI (from Start->Run...) I don't get that error. I also use Scilab 4.1.2 on Debian 5.0 and I don't have any problems either. Windows is not my preferred OS so I don't care too much, but I wan't to share the file and almost everybody uses windows. Thanks, David. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Estadosnocom.sce Type: application/octet-stream Size: 3228 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Visual Fortran error-1.jpg Type: image/jpeg Size: 108323 bytes Desc: not available URL: From jnelson at satcharters.com Sat Jun 6 21:24:07 2009 From: jnelson at satcharters.com (Jerry Nelson) Date: Sat, 06 Jun 2009 14:24:07 -0500 Subject: Plotting three dimensional vectors Message-ID: <4A2AC257.9090703@satcharters.com> Good afternoon, I am trying to visualize two simple vectors in three dimensions, and not having much luck. So I thought I would try to create a picture to help. I'm not having much luck there either. I would like to create a plot of the two vectors x=(2, 4, 9) and y=(1, 3, 5), and to display them both on the same graphic with the axis' displayed as well. I have searched through the manual, the help system, and the demos to no avail. There is a lot of information there, but with no starting point, I am just getting further confused. If I'm not asking too much, it would be nice to display each vector in a different color, and to define the axis dimensions (in other words set the x-axis to -5 to 10, the y-axis to 0 to 10, and the z-axis to -10 to 10) Thanks for any help, Jerry From stephane.mottelet at utc.fr Sun Jun 7 17:22:51 2009 From: stephane.mottelet at utc.fr (Stephane Mottelet) Date: Sun, 07 Jun 2009 17:22:51 +0200 Subject: [scilab-Users] Plotting three dimensional vectors In-Reply-To: <4A2AC257.9090703@satcharters.com> References: <4A2AC257.9090703@satcharters.com> Message-ID: <20090607172251.16165vmchu8sag00@webmail.utc.fr> Hi, This can be done, but not directly. You have to plot the (x,y) component first using xarrows, get the handle of the segs entity then add a third column to the data field : xarrows(nx,ny) h=gce(); h.data=[h.data nz(:)]; nx, ny, nz are 2 x n matrices containing the origin of vectors on the first line and the extremity on the second line. S. Jerry Nelson a ?crit : > Good afternoon, > > I am trying to visualize two simple vectors in three dimensions, and > not having much luck. So I thought I would try to create a picture > to help. I'm not having much luck there either. > > I would like to create a plot of the two vectors x=(2, 4, 9) and > y=(1, 3, 5), and to display them both on the same graphic with the > axis' displayed as well. I have searched through the manual, the > help system, and the demos to no avail. There is a lot of > information there, but with no starting point, I am just getting > further confused. > > If I'm not asking too much, it would be nice to display each vector > in a different color, and to define the axis dimensions (in other > words set the x-axis to -5 to 10, the y-axis to 0 to 10, and the > z-axis to -10 to 10) > > Thanks for any help, > Jerry > From jnelson at satcharters.com Sun Jun 7 21:04:41 2009 From: jnelson at satcharters.com (Jerry Nelson) Date: Sun, 07 Jun 2009 14:04:41 -0500 Subject: [scilab-Users] Plotting three dimensional vectors In-Reply-To: <20090607172251.16165vmchu8sag00@webmail.utc.fr> References: <4A2AC257.9090703@satcharters.com> <20090607172251.16165vmchu8sag00@webmail.utc.fr> Message-ID: <4A2C0F49.9050000@satcharters.com> Hi Stepane, Thanks for the response. It was quite timely as I was just getting ready to reply back to my post. I've still been playing around, and I have a bit of a solution. Since I'm dealing with vectors that originate at the origin, I've come up with a macro that will plot the vector as a simple line. That definition is: function []=myplot3d(a, b, c) plot3d([0;a],[0;b],[0;c], flag=[5 2 4]); g=gca(); g.grid=[1 1 1] g.rotation_angles=[10 25]; g.labels_font_color=5; g.parent.background=4; g.background=color(210,210,210); g.parent.figure_size= [800,600]; g.box="on"; g.labels_font_size=4; g.x_label.text="x-axis"; g.y_label.text="y-axis"; g.z_label.text="z-axis"; endfunction This allows me to visualize things much better. I am still trying to figure out how to have the three axis's show up, and I wouldn't mind being able to have the line in a color other than black so I can have two distinguishable vectors on the same graphic. Your solution looks like it might do what I'm trying to do, so I will definitely look into it too. Either way I will report back with any successes. Thanks again, Jerry Stephane Mottelet wrote: > Hi, > > This can be done, but not directly. You have to plot the (x,y) component > first using xarrows, get the handle of the segs entity then add a third > column to the > data field : > > xarrows(nx,ny) > h=gce(); > h.data=[h.data nz(:)]; > > nx, ny, nz are 2 x n matrices containing the origin of vectors on the > first line and the extremity on the second line. > > S. > > > > Jerry Nelson a ?crit : > >> Good afternoon, >> >> I am trying to visualize two simple vectors in three dimensions, and >> not having much luck. So I thought I would try to create a picture to >> help. I'm not having much luck there either. >> >> I would like to create a plot of the two vectors x=(2, 4, 9) and y=(1, >> 3, 5), and to display them both on the same graphic with the axis' >> displayed as well. I have searched through the manual, the help >> system, and the demos to no avail. There is a lot of information >> there, but with no starting point, I am just getting further confused. >> >> If I'm not asking too much, it would be nice to display each vector in >> a different color, and to define the axis dimensions (in other words >> set the x-axis to -5 to 10, the y-axis to 0 to 10, and the z-axis to >> -10 to 10) >> >> Thanks for any help, >> Jerry >> > From kirill.kirillov at gmail.com Mon Jun 8 00:44:21 2009 From: kirill.kirillov at gmail.com (Kirill Kirillov) Date: Mon, 08 Jun 2009 02:44:21 +0400 Subject: [Scilab-Dev] x_mdialog for editing matrices In-Reply-To: <4A230649.4040401@univ-lemans.fr> References: <1243808273.4016.17.camel@faith.universe> <4A230649.4040401@univ-lemans.fr> Message-ID: <1244414661.3993.16.camel@faith.universe> Hi! ? ???, 01/06/2009 ? 00:35 +0200, Samuel GOUGEON ?????: > > I've tried to use x_mdialog function for editing matrices using idea > > found in Scilab demos (GUI dialog example), but it seems that this > > function is not suitable for this. > > > > Take a look at the following example: > > rows = ['row1' 'row2']; > > cols = ['col1' 'col2' 'col3']; > > test = [1 1 1; 0 0 0]; > > x_mdialog('Testing', rows, cols, string(test)) > > > > Results: > > 1) [1 0 1; 0 1 0] in row1 and row2 instead original [1 1 1; 0 0 0]; > > 2) col1, col2 and col3 should be shifted to be above correspondent cells > > > > Are these bugs? > > Strange, indeed. I fully agree with you, so http://bugzilla.scilab.org/show_bug.cgi?id=4564 > Have you tried with x_matrix() ? Yes, fortunately x_matrix works, but in Windows it uses too small font size in comparison with x_mdialog. Is there way to change its font size? Also if this bug was fixed, it would extremely improve usability of scilab dialogs: http://bugzilla.scilab.org/show_bug.cgi?id=4137 Thanks. -- Kirill Kirillov <>< From sylvestre.ledru at scilab.org Mon Jun 8 14:50:50 2009 From: sylvestre.ledru at scilab.org (Sylvestre Ledru) Date: Mon, 08 Jun 2009 14:50:50 +0200 Subject: [scilab-Users] compilation de scilab 5.1.1 sous RHEL 4u5 In-Reply-To: <092785B790DCD043BA45401EDA43D9B5045C831B@cst-xch-003.cnesnet.ad.cnes.fr> References: <092785B790DCD043BA45401EDA43D9B5045C831B@cst-xch-003.cnesnet.ad.cnes.fr> Message-ID: <1244465450.26763.767.camel@korcula.inria.fr> Sorry about the lag, I was off. Do you still have your problem ? If yes, could you sum up where you currently are ? Sylvestre Le lundi 25 mai 2009 ? 10:48 +0200, Langella Raphael a ?crit : > Thanks but it didn't help. I'm using Java 1.6.0_11 and I've added $JAVA_HOME/lib/amd64 and $JAVA_HOME/lib/amd64/server to my LD_LIBRARY_PATH for the following libraries : libjava.so, libverify.so and libjvm.so > Setting the JAVA_HOME variable didn't change anything. > > > > -----Message d'origine----- > > De : Collette Yann [mailto:ycollet at freesurf.fr] > > Envoy? : jeudi 21 mai 2009 08:12 > > ? : users at lists.scilab.org > > Objet : Re: [scilab-Users] compilation de scilab 5.1.1 sous RHEL 4u5 > > > > Another idea: go to java.sun.com and download a java package > > for your linux. > > Install it in a separate directory. For example /opt/java and > > before launching scilab, do a export JAVA_HOME=/opt/java/jre > > and start scilab > > > > Does this help ? > > > > YC > > > > > > > > There isn't any. When I start scilab, I got the Java > > configuration warning and that's all. The GUI doesn't appear, > > there's no error, the program doesn't return. The scilab-bin > > process runs, but nothing happens. > > > > > > I don't think it has anything to do with the Java warning, > > because with the binary version, I don't get the warning, but > > I still have exactly the same problem. Anyway, here is the warning : > > > > > > Could not find the Java configuration for the OS > > . > > > Please contact us or submit a bug report with your detailed > > > configuration http://bugzilla.scilab.org/ > > > > > > > > > > From raphael.langella at steria.cnes.fr Mon Jun 8 15:49:45 2009 From: raphael.langella at steria.cnes.fr (Langella Raphael) Date: Mon, 8 Jun 2009 15:49:45 +0200 Subject: [scilab-Users] compilation de scilab 5.1.1 sous RHEL 4u5 In-Reply-To: <1244465450.26763.767.camel@korcula.inria.fr> Message-ID: <092785B790DCD043BA45401EDA43D9B5045C8B14@cst-xch-003.cnesnet.ad.cnes.fr> Sure, I found were the Java warning was coming from. It's simply that my OS environnment variable was set to x86_64.Linux.2.6.9. After unsetting it, the warning is gone. Now, wether I use the binary version (last I checked was scilab-master-1242237518.bin.linux-x86_64.tar.gz) or if I compile from the source, I've got the same result: nothing. When I start (with or without -nw), the process runs, there is no error, but the GUI doesn't appear. Rapha?l > -----Message d'origine----- > De : Sylvestre Ledru [mailto:sylvestre.ledru at scilab.org] > Envoy? : lundi 8 juin 2009 14:51 > ? : users at lists.scilab.org > Objet : RE: [scilab-Users] compilation de scilab 5.1.1 sous RHEL 4u5 > > Sorry about the lag, I was off. > > Do you still have your problem ? If yes, could you sum up > where you currently are ? > > Sylvestre > > Le lundi 25 mai 2009 ? 10:48 +0200, Langella Raphael a ?crit : > > Thanks but it didn't help. I'm using Java 1.6.0_11 and I've added > > $JAVA_HOME/lib/amd64 and $JAVA_HOME/lib/amd64/server to my > LD_LIBRARY_PATH for the following libraries : libjava.so, > libverify.so and libjvm.so Setting the JAVA_HOME variable > didn't change anything. > > > > > > > -----Message d'origine----- > > > De : Collette Yann [mailto:ycollet at freesurf.fr] Envoy? : jeudi 21 > > > mai 2009 08:12 ? : users at lists.scilab.org Objet : Re: > [scilab-Users] > > > compilation de scilab 5.1.1 sous RHEL 4u5 > > > > > > Another idea: go to java.sun.com and download a java package for > > > your linux. > > > Install it in a separate directory. For example /opt/java > and before > > > launching scilab, do a export JAVA_HOME=/opt/java/jre and start > > > scilab > > > > > > Does this help ? > > > > > > YC > > > > > > > > > > > There isn't any. When I start scilab, I got the Java > > > configuration warning and that's all. The GUI doesn't appear, > > > there's no error, the program doesn't return. The > scilab-bin process > > > runs, but nothing happens. > > > > > > > > I don't think it has anything to do with the Java warning, > > > because with the binary version, I don't get the warning, but I > > > still have exactly the same problem. Anyway, here is the warning : > > > > > > > > Could not find the Java configuration for the OS > > > . > > > > Please contact us or submit a bug report with your detailed > > > > configuration http://bugzilla.scilab.org/ > > > > > > > > > > > > > > > > From sylvestre.ledru at scilab.org Mon Jun 8 15:50:18 2009 From: sylvestre.ledru at scilab.org (Sylvestre Ledru) Date: Mon, 08 Jun 2009 15:50:18 +0200 Subject: [scilab-Users] compilation de scilab 5.1.1 sous RHEL 4u5 In-Reply-To: <092785B790DCD043BA45401EDA43D9B5045C8B14@cst-xch-003.cnesnet.ad.cnes.fr> References: <092785B790DCD043BA45401EDA43D9B5045C8B14@cst-xch-003.cnesnet.ad.cnes.fr> Message-ID: <1244469018.26763.927.camel@korcula.inria.fr> Le lundi 08 juin 2009 ? 15:49 +0200, Langella Raphael a ?crit : > Now, wether I use the binary version (last I checked was scilab-master-1242237518.bin.linux-x86_64.tar.gz) or if I compile from the source, I've got the same result: nothing. When I start (with or without -nw), the process runs, there is no error, but the GUI doesn't appear. It is weird. What do get if you try: $ ./bin/scilab -nw -e "plot3d()" Sylvestre From raphael.langella at steria.cnes.fr Mon Jun 8 16:19:33 2009 From: raphael.langella at steria.cnes.fr (Langella Raphael) Date: Mon, 8 Jun 2009 16:19:33 +0200 Subject: [scilab-Users] compilation de scilab 5.1.1 sous RHEL 4u5 In-Reply-To: <1244469018.26763.927.camel@korcula.inria.fr> Message-ID: <092785B790DCD043BA45401EDA43D9B5045C8B22@cst-xch-003.cnesnet.ad.cnes.fr> > -----Message d'origine----- > De : Sylvestre Ledru [mailto:sylvestre.ledru at scilab.org] > Envoy? : lundi 8 juin 2009 15:50 > ? : users at lists.scilab.org > Objet : RE: [scilab-Users] compilation de scilab 5.1.1 sous RHEL 4u5 > > Le lundi 08 juin 2009 ? 15:49 +0200, Langella Raphael a ?crit : > > Now, wether I use the binary version (last I checked was > scilab-master-1242237518.bin.linux-x86_64.tar.gz) or if I > compile from the source, I've got the same result: nothing. > When I start (with or without -nw), the process runs, there > is no error, but the GUI doesn't appear. > It is weird. > What do get if you try: > $ ./bin/scilab -nw -e "plot3d()" The text below appears, and then nothing. ___________________________________________ scilab-5.1.1 Consortium Scilab (DIGITEO) Copyright (c) 1989-2009 (INRIA) Copyright (c) 1989-2007 (ENPC) ___________________________________________ Initialisation: Chargement de l'environnement de travail Then, I type ctrl-C, a window named "Figure n?0" appears and the terminal says : Saisissez 'resume' ou 'abort' pour revenir au niveau de prompt normal. -1-> From stephane.mottelet at utc.fr Tue Jun 9 09:01:52 2009 From: stephane.mottelet at utc.fr (=?UTF-8?B?U3TCjsOpcGhhbmUgTW90dGVsZXQ=?=) Date: Tue, 09 Jun 2009 09:01:52 +0200 Subject: More events needed Message-ID: <4A2E08E0.8030809@utc.fr> Hi all, just for info (request #647, does anybody watch requests ?) The mouse wheel and resize events should be transmitted by the event_handler function. As far as I am concerned, I need the mouse wheel to implement a zoom command in the Plotlib, and the resize event could help to preserve the window content when using the pixmap mode. S. From sylvestre.ledru at scilab.org Tue Jun 9 09:22:33 2009 From: sylvestre.ledru at scilab.org (Sylvestre Ledru) Date: Tue, 09 Jun 2009 09:22:33 +0200 Subject: [scilab-Users] More events needed In-Reply-To: <4A2E08E0.8030809@utc.fr> References: <4A2E08E0.8030809@utc.fr> Message-ID: <1244532153.7669.24.camel@zlarin> Le mardi 09 juin 2009 ? 09:01 +0200, St??phane Mottelet a ?crit : > Hi all, > > just for info (request #647, does anybody watch requests ?) Yep, all the team is receiving them. > The mouse wheel and resize events should be transmitted by the > event_handler function. As far as I am concerned, I need > the mouse wheel to implement a zoom command in the Plotlib, and the > resize event could help to preserve the window > content when using the pixmap mode. Indeed, this feature (mouse wheel in particular) could be interesting. Would you mind writing a SEP to detail how you would like to see it from the user perspective ? Sylvestre From stephane.mottelet at utc.fr Tue Jun 9 09:26:22 2009 From: stephane.mottelet at utc.fr (=?UTF-8?B?U3TCjsOpcGhhbmUgTW90dGVsZXQ=?=) Date: Tue, 09 Jun 2009 09:26:22 +0200 Subject: [scilab-Users] More events needed In-Reply-To: <1244532153.7669.24.camel@zlarin> References: <4A2E08E0.8030809@utc.fr> <1244532153.7669.24.camel@zlarin> Message-ID: <4A2E0E9E.8010304@utc.fr> Sylvestre Ledru a ?crit : > Le mardi 09 juin 2009 ? 09:01 +0200, St??phane Mottelet a ?crit : > >> Hi all, >> >> just for info (request #647, does anybody watch requests ?) >> > Yep, all the team is receiving them. > > >> The mouse wheel and resize events should be transmitted by the >> event_handler function. As far as I am concerned, I need >> the mouse wheel to implement a zoom command in the Plotlib, and the >> resize event could help to preserve the window >> content when using the pixmap mode. >> > Indeed, this feature (mouse wheel in particular) could be interesting. > Would you mind writing a SEP to detail how you would like to see it from > the user perspective ? > > Sylvestre > > > Well, I have been seing many SEPs these former weeks, where is the repository/place to issue them ? S. -------------- next part -------------- An HTML attachment was scrubbed... URL: From sylvestre.ledru at scilab.org Tue Jun 9 09:31:30 2009 From: sylvestre.ledru at scilab.org (Sylvestre Ledru) Date: Tue, 09 Jun 2009 09:31:30 +0200 Subject: [scilab-Users] More events needed In-Reply-To: <4A2E0E9E.8010304@utc.fr> References: <4A2E08E0.8030809@utc.fr> <1244532153.7669.24.camel@zlarin> <4A2E0E9E.8010304@utc.fr> Message-ID: <1244532690.7669.30.camel@zlarin> > > > The mouse wheel and resize events should be transmitted by the > > > event_handler function. As far as I am concerned, I need > > > the mouse wheel to implement a zoom command in the Plotlib, and the > > > resize event could help to preserve the window > > > content when using the pixmap mode. > > > > > Indeed, this feature (mouse wheel in particular) could be interesting. > > Would you mind writing a SEP to detail how you would like to see it from > > the user perspective ? > > > Well, I have been seing many SEPs these former weeks, where is the > repository/place > to issue them ? The SEP #1 describes what is a SEP. http://gitweb.scilab.org/?p=scilab;a=blob;f=SEP/SEP_1_SEP_definition.odt;h=43ad3364d1a822e172ea2c82cb2db9012a4b0c58;hb=HEAD To summarize: * you write it and explain how you see the feature and so on * you send it on the developer ML * we discuss about it * when a concensius is found, the development can start/be pushed. Sylvestre From sylvestre.ledru at scilab.org Tue Jun 9 11:26:30 2009 From: sylvestre.ledru at scilab.org (Sylvestre Ledru) Date: Tue, 09 Jun 2009 11:26:30 +0200 Subject: [scilab-Users] compilation de scilab 5.1.1 sous RHEL 4u5 In-Reply-To: <092785B790DCD043BA45401EDA43D9B5045C8B22@cst-xch-003.cnesnet.ad.cnes.fr> References: <092785B790DCD043BA45401EDA43D9B5045C8B22@cst-xch-003.cnesnet.ad.cnes.fr> Message-ID: <1244539590.4681.3160.camel@korcula.inria.fr> Le lundi 08 juin 2009 ? 16:19 +0200, Langella Raphael a ?crit : > > > > Le lundi 08 juin 2009 ? 15:49 +0200, Langella Raphael a ?crit : > > > Now, wether I use the binary version (last I checked was > > scilab-master-1242237518.bin.linux-x86_64.tar.gz) or if I > > compile from the source, I've got the same result: nothing. > > When I start (with or without -nw), the process runs, there > > is no error, but the GUI doesn't appear. > > It is weird. > > What do get if you try: > > $ ./bin/scilab -nw -e "plot3d()" > > The text below appears, and then nothing. [...] Seems the same bug as: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=532206 I am upgrading my system to see if I can reproduce it. Sylvestre From sylvestre.ledru at scilab.org Wed Jun 10 14:37:52 2009 From: sylvestre.ledru at scilab.org (Sylvestre Ledru) Date: Wed, 10 Jun 2009 14:37:52 +0200 Subject: [scilab-Users] compilation de scilab 5.1.1 sous RHEL 4u5 In-Reply-To: <1244539590.4681.3160.camel@korcula.inria.fr> References: <092785B790DCD043BA45401EDA43D9B5045C8B22@cst-xch-003.cnesnet.ad.cnes.fr> <1244539590.4681.3160.camel@korcula.inria.fr> Message-ID: <1244637472.7669.121.camel@zlarin> Le mardi 09 juin 2009 ? 11:26 +0200, Sylvestre Ledru a ?crit : > Le lundi 08 juin 2009 ? 16:19 +0200, Langella Raphael a ?crit : > > > > > > Le lundi 08 juin 2009 ? 15:49 +0200, Langella Raphael a ?crit : > > > > Now, wether I use the binary version (last I checked was > > > scilab-master-1242237518.bin.linux-x86_64.tar.gz) or if I > > > compile from the source, I've got the same result: nothing. > > > When I start (with or without -nw), the process runs, there > > > is no error, but the GUI doesn't appear. > > > It is weird. > > > What do get if you try: > > > $ ./bin/scilab -nw -e "plot3d()" > > > > The text below appears, and then nothing. > [...] > Seems the same bug as: > http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=532206 > > I am upgrading my system to see if I can reproduce it. I could not reproduce it. What is your window manager ? (the reporter of the bug #532206 said it seems to be related to the wm) Sylvestre From raphael.langella at steria.cnes.fr Wed Jun 10 15:37:02 2009 From: raphael.langella at steria.cnes.fr (Langella Raphael) Date: Wed, 10 Jun 2009 15:37:02 +0200 Subject: [scilab-Users] compilation de scilab 5.1.1 sous RHEL 4u5 In-Reply-To: <1244637472.7669.121.camel@zlarin> Message-ID: <092785B790DCD043BA45401EDA43D9B5045C8CF8@cst-xch-003.cnesnet.ad.cnes.fr> > -----Message d'origine----- > De : Sylvestre Ledru [mailto:sylvestre.ledru at scilab.org] > Envoy? : mercredi 10 juin 2009 14:38 > ? : users at lists.scilab.org > Objet : RE: [scilab-Users] compilation de scilab 5.1.1 sous RHEL 4u5 > > Le mardi 09 juin 2009 ? 11:26 +0200, Sylvestre Ledru a ?crit : > > Le lundi 08 juin 2009 ? 16:19 +0200, Langella Raphael a ?crit : > > > > > > > > Le lundi 08 juin 2009 ? 15:49 +0200, Langella Raphael a ?crit : > > > > > Now, wether I use the binary version (last I checked was > > > > scilab-master-1242237518.bin.linux-x86_64.tar.gz) or if > I compile > > > > from the source, I've got the same result: nothing. > > > > When I start (with or without -nw), the process runs, > there is no > > > > error, but the GUI doesn't appear. > > > > It is weird. > > > > What do get if you try: > > > > $ ./bin/scilab -nw -e "plot3d()" > > > > > > The text below appears, and then nothing. > > [...] > > Seems the same bug as: > > http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=532206 > > > > I am upgrading my system to see if I can reproduce it. > I could not reproduce it. > > What is your window manager ? (the reporter of the bug > #532206 said it seems to be related to the wm) I guess it would be Windows, or explorer! I mean I'm starting it from a Windows PC with cygwin and remote display. I tried with both multiwindow and rootless cygwin options and no option, same result. Also, it seems some windows are created, but they are invisible. When I quit cygwin while scilab is running, it tells me that 3 clients are connected. Also, I think my symptoms are a bit different than the ones from but #532206. I do have a similar strace message : futex(0xb7af14, FUTEX_WAIT, 5, NULL but I don't have an empty console window. I don't have any window appearing. From sylvestre.ledru at scilab.org Wed Jun 10 17:46:51 2009 From: sylvestre.ledru at scilab.org (Sylvestre Ledru) Date: Wed, 10 Jun 2009 17:46:51 +0200 Subject: [scilab-Users] Using functions in Java In-Reply-To: <22688.17681.qm@web63704.mail.re1.yahoo.com> References: <22688.17681.qm@web63704.mail.re1.yahoo.com> Message-ID: <1244648811.7669.174.camel@zlarin> Hello, Le samedi 30 mai 2009 ? 01:15 -0700, Sattiraju Prabhakar a ?crit : > Hi, > > I am trying to use Scilab (5.1.1) from a Java (jdk 6 update 13) > application. > I have been experimenting with some Scilab scripts that use > function ("function" and "deff") definitions. > When I tried to convert these scripts into Java, I have come > across a number of problems. > > Problems using "function" > ================ > > I took the "function percentile" declaration from Professor Gilberto > Gurroz's > Basic Statistics and Probability using Scilab. I reproduce below the > script. > > function [p] = percentile(x,r) > //This function calculates the 100*r-th percentile > //(0 xx = gsort(x); > [n m] = size(xx); > if m>n & n == 1 > n = m; > end > if r<0 | r>1 then > disp('Percentile value must be between 0 and 1'); > else > k = n*r; > if k-floor(k) ~= 0 > p = xx(round(n*r)); > else > p = (xx(k)+xx(k+1))/2; > end > end > > It is used as follows > Q1 = percentile(x,0.25) > > I tried to put it in Java code in two different ways. > > A. In the first attempt, I tried to execute each line using > Scilab.Exec. The code follows. > > public void percentile() { > Scilab.Exec("function [p] = percentile(x,r)"); > //This function calculates the 100*r-th percentile > //(0 Scilab.Exec("xx = gsort(x);"); > Scilab.Exec("[n m] = size(xx);"); > Scilab.Exec("if m>n & n == 1"); > Scilab.Exec("n = m;"); > Scilab.Exec("end"); > Scilab.Exec("if r<0 | r>1 then"); > Scilab.Exec("disp('Percentile value must be between 0 and > 1');"); > Scilab.Exec("else"); > Scilab.Exec("k = n*r;"); > Scilab.Exec(" if k-floor(k) ~= 0"); > Scilab.Exec("p = xx(round(n*r)); "); > Scilab.Exec("else"); > Scilab.Exec("p = (xx(k)+xx(k+1))/2;"); > Scilab.Exec("end"); > Scilab.Exec("endfunction"); > } Why don't you directly store this into a dedicated percentile.sci file and call the java method Scilab.ExecuteScilabScript(String filename) ? Btw, your error is due to a missing end just before the endfunction. > I tried to apply this function as follows. > SciDouble Q1P = new SciDouble("Q1"); > Scilab.Exec("Q1 = percentile(x,0.25)"); > Q1P.Get(); > Q1P.disp(); > > I get the following error. > double Q1= > > 0. > Error in Java_javasci_Scilab_Exec routine. This is normal that it is failling here. Scilab.Exec is waiting for a consistent expression. If you try: if (!Scilab.Exec("function [p] = percentile(x,r)")){ System.out.println(Scilab.GetLastErrorCode()); } you will that that you will get an error (code 272... no endfunction). > B. I tried to declare the entire function as a string and pass the > string as argument to Scilab.Exec(). > > > public void percentile() { > String perc2 = "function [p] = percentile(x,r) \n xx = gsort(x); > \n [n m] = size(xx); \n if m>n & n == 1 \n n = m; \n end \n if r<0 | > r>1 then \n disp('Percentile value must be between 0 and 1'); \n else > \n k = n*r; \n if k-floor(k) ~= 0 \n p = xx(round(n*r)); \n else \n p > = (xx(k)+xx(k+1))/2; \n end \n endfunction"; > Scilab.Exec(perc2); > } > I tried it without \n, and later with \n. In both cases, I got the > same error as above. Same issue, you forgot the end. The following code is working for me: import javasci.*; public class percentile { public static void main(String args[]){ String aze="function [p] = percentile(x,r); xx = gsort(x); [n m] = size(xx); if m>n & n == 1 n = m; end; if r<0 | r>1 then disp('Percentile value must be between 0 and 1'); else; k = n*r; if k-floor(k) ~= 0; p = xx(round(n*r)); else; p = (xx(k)+xx(k+1))/2; end; end; endfunction"; if (!Scilab.Exec(aze)){ System.out.println(Scilab.GetLastErrorCode()); } SciDouble Q1P = new SciDouble("Q1"); Scilab.Exec("x=[23,2323,934,42];"); Scilab.Exec("Q1 = percentile(x,0.25)"); Q1P.Get(); Q1P.disp(); } } > 2. Using deff > ============= > > I was able to successfully write and execute the above example using deff > > Scilab.Exec("deff('[x,y]=myfct(a,b)', ['x=a+b'; 'y=a-b'])"); > > "deff" requires that we state the "statements" of the function as matrix of strings. > If you have a String inside the function declaration (of Scilab script), as in percentile, then > it becomes a problem. > > I was not able to get a correct result for percentile using deff and Java. > Here is my code: > Scilab.Exec("deff('[p]=percentile(x,r)', ['xx = gsort(x);'; '[n m] = size(xx);'; ' if m>n & n == 1 n = m;'; 'end'; 'if r<0 | r>1 then disp('Percentile value must be between 0 and 1');' ; 'else k = n*r;'; 'if k-floor(k) ~= 0 p = xx(round(n*r));'; 'else p = (xx(k)+xx(k+1))/2;'; 'end' ])"); Probably the same issue as before. > I would like to end with a general question. Each of the above methods > takes some effort. > If the function definition is long, then the effort needed to convert > into Java code can be > substantial. Is there a simple method? Yep, load the function from a file. Sylvestre From sylvestre.ledru at scilab.org Wed Jun 10 22:24:48 2009 From: sylvestre.ledru at scilab.org (Sylvestre Ledru) Date: Wed, 10 Jun 2009 22:24:48 +0200 Subject: [scilab-Users] Using functions in Java In-Reply-To: <1244648811.7669.174.camel@zlarin> References: <22688.17681.qm@web63704.mail.re1.yahoo.com> <1244648811.7669.174.camel@zlarin> Message-ID: <1244665488.7669.201.camel@zlarin> Le mercredi 10 juin 2009 ? 17:46 +0200, Sylvestre Ledru a ?crit : > > > Error in Java_javasci_Scilab_Exec routine. > This is normal that it is failling here. > Scilab.Exec is waiting for a consistent expression. > > If you try: > if (!Scilab.Exec("function [p] = percentile(x,r)")){ > System.out.println(Scilab.GetLastErrorCode()); > } > you will that that you will get an error (code 272... no endfunction). Btw, thanks for pointing this out. I updated the documentation here to highlight this point. Sylvestre From kirill.kirillov at gmail.com Thu Jun 11 01:00:19 2009 From: kirill.kirillov at gmail.com (Kirill Kirillov) Date: Thu, 11 Jun 2009 03:00:19 +0400 Subject: [scilab-Users] Problems with creating toolbox Message-ID: <1244674819.4048.15.camel@faith.universe> Hi, all! I've created my first toolbox based on toolbox_skeleton, but I can't resolve the following issues myself, please, advice: 1) I've build a library with the following macros: heat_flow_inspectorlib = calcU calcFG calcHH calcY ptp rule But after toolbox starting functions from that macros are not available. So first problem, how to make functions inside macros visible in console just after toolbox loading. 2) In my toolbox there is also a GUI program, which I want to run just after loading all functions from library . I know that one can create demo, but is it possible to run GUI program just from main menu like "Matlab to Scilab conversion tool"? Thanks in advance. -- Kirill Kirillov <>< From jean-michel.innocent at centrale-marseille.fr Thu Jun 11 16:56:33 2009 From: jean-michel.innocent at centrale-marseille.fr (Jean-Michel Innocent) Date: Thu, 11 Jun 2009 16:56:33 +0200 Subject: commande portrait Message-ID: <4A311B21.5060806@ec-marseille.fr> Bonjour, je n'arrive pas a trouver sous Scilab-5 la commande 'portrait' qui donnait le portrait de phase d'un systeme dynamique encore sous Scilab-4 a ma grande satisfaction. Est-ce un oubli? A-t-elle change de nom? Si quelqu'un peut m'eclairer, merci d'avance. -- Jean-Michel INNOCENT Mathematiques Ecole Centrale de Marseille From lixo1 at hotmail.fr Thu Jun 11 22:04:20 2009 From: lixo1 at hotmail.fr (Louis Ixo) Date: Thu, 11 Jun 2009 22:04:20 +0200 Subject: Scilab graphics in C application Message-ID: Hi everybody, I would like to know if is possible to embed Scilab graphics (2D and 3D plots) in a C/C++ application, for example integrating it on a Qt application, etc. So please, if you have any information about this kind of things please post it! Thank you very much for all help. -------------- next part -------------- An HTML attachment was scrubbed... URL: From sylvestre.ledru at scilab.org Thu Jun 11 22:10:16 2009 From: sylvestre.ledru at scilab.org (Sylvestre Ledru) Date: Thu, 11 Jun 2009 22:10:16 +0200 Subject: [scilab-Users] Scilab graphics in C application In-Reply-To: References: Message-ID: <1244751016.20121.14.camel@zlarin> Le jeudi 11 juin 2009 ? 22:04 +0200, Louis Ixo a ?crit : > Hi everybody, > > I would like to know if is possible to embed Scilab graphics (2D and > 3D plots) in a C/C++ application, for example integrating it on a Qt > application, etc? Out of the box, no, it is not possible (the actual rendering is done in Java) However, if you have some sparse time, since a part of the OpenGL rendering is done in C++, you could plug an OpenGL driver straight on it. Sylvestre From celso.co at gmail.com Sat Jun 13 16:00:11 2009 From: celso.co at gmail.com (Celso Co) Date: Sat, 13 Jun 2009 22:00:11 +0800 Subject: [scilab-Users] Plotting three dimensional vectors In-Reply-To: <4A2AC257.9090703@satcharters.com> Message-ID: Jerry, Please try my attachment. It may help. Regards, cels -----Original Message----- From: Jerry Nelson [mailto:jnelson at satcharters.com] Sent: Sunday, June 07, 2009 3:24 AM To: users at lists.scilab.org Subject: [scilab-Users] Plotting three dimensional vectors Good afternoon, I am trying to visualize two simple vectors in three dimensions, and not having much luck. So I thought I would try to create a picture to help. I'm not having much luck there either. I would like to create a plot of the two vectors x=(2, 4, 9) and y=(1, 3, 5), and to display them both on the same graphic with the axis' displayed as well. I have searched through the manual, the help system, and the demos to no avail. There is a lot of information there, but with no starting point, I am just getting further confused. If I'm not asking too much, it would be nice to display each vector in a different color, and to define the axis dimensions (in other words set the x-axis to -5 to 10, the y-axis to 0 to 10, and the z-axis to -10 to 10) Thanks for any help, Jerry -------------- next part -------------- A non-text attachment was scrubbed... Name: vector.sce Type: application/octet-stream Size: 1582 bytes Desc: not available URL: From kirill.kirillov at gmail.com Sun Jun 14 01:10:33 2009 From: kirill.kirillov at gmail.com (Kirill Kirillov) Date: Sun, 14 Jun 2009 03:10:33 +0400 Subject: [scilab-Users] Problems with loading functions from toolbox Message-ID: <1244934633.3958.13.camel@faith.universe> Hi, all! Please, help to solve the following problem: I've file ptp.sci in my heat_flow_inspector toolbox with four functions: getPTP, getBlocks, getGU1type and getGU2type. After I built toolbox, I got ptp.bin file and name "ptp" in "names" file. When I load toolbox I get library heat_flow_inspectorlib, which has ptp macros, but all my functions are not available in this macros. If I type and execute "ptp", then I'll get error about unknown variable "ptp" and all my functions will be available. So the problem is how to make all functions in *.bin available just after toolbox loading. Any help will be very appreciated, I can't solve it myself, sorry. -- Kirill Kirillov <>< From yann.collette at scilab.org Sun Jun 14 08:49:33 2009 From: yann.collette at scilab.org (Yann Collette) Date: Sun, 14 Jun 2009 08:49:33 +0200 Subject: [scilab-Users] Problems with loading functions from toolbox In-Reply-To: <1244934633.3958.13.camel@faith.universe> References: <1244934633.3958.13.camel@faith.universe> Message-ID: <4A349D7D.40307@scilab.org> Kirill Kirillov a ?crit : > Hi, all! > > Please, help to solve the following problem: > I've file ptp.sci in my heat_flow_inspector toolbox with four functions: > getPTP, getBlocks, getGU1type and getGU2type. > After I built toolbox, I got ptp.bin file and name "ptp" in "names" > file. > When I load toolbox I get library heat_flow_inspectorlib, which has ptp > macros, but all my functions are not available in this macros. > If I type and execute "ptp", then I'll get error about unknown variable > "ptp" and all my functions will be available. > > So the problem is how to make all functions in *.bin available just > after toolbox loading. > > Any help will be very appreciated, I can't solve it myself, sorry. > > You can try 2 things: - rename your .sci file into .sce (I have not tested this solution) - use the following rule: one function per file YC From kirill.kirillov at gmail.com Sun Jun 14 15:26:49 2009 From: kirill.kirillov at gmail.com (Kirill Kirillov) Date: Sun, 14 Jun 2009 17:26:49 +0400 Subject: [scilab-Users] Problems with loading functions from toolbox In-Reply-To: <4A349D7D.40307@scilab.org> References: <1244934633.3958.13.camel@faith.universe> <4A349D7D.40307@scilab.org> Message-ID: <1244986009.3931.23.camel@faith.universe> Hi! ? ???, 14/06/2009 ? 08:49 +0200, Yann Collette ?????: > > Please, help to solve the following problem: > > I've file ptp.sci in my heat_flow_inspector toolbox with four functions: > > getPTP, getBlocks, getGU1type and getGU2type. > > After I built toolbox, I got ptp.bin file and name "ptp" in "names" > > file. > > When I load toolbox I get library heat_flow_inspectorlib, which has ptp > > macros, but all my functions are not available in this macros. > > If I type and execute "ptp", then I'll get error about unknown variable > > "ptp" and all my functions will be available. > > > > So the problem is how to make all functions in *.bin available just > > after toolbox loading. > > > > Any help will be very appreciated, I can't solve it myself, sorry. > > > > > You can try 2 things: > - rename your .sci file into .sce (I have not tested this solution) .sce files aren't built by build.sce script and they aren't loaded on toolbox start. So this way is even worse. > - use the following rule: one function per file I thought about this way too, but since Scilab has feature to support many functions in one file and it loads them fine using "getf" function. I think there should be a way to achieve the same behaviour for libraries, otherwise it's very bad example of inconsistency in Scilab and at least it should be documented in wiki page about toolbox creation. I don't want to populate files and brake logical structure (I have 7 files, each with about 5 functions). I think that I refuse using build.sce and just change loader.sce to use "getf" function. Thank you for your replay. -- Kirill Kirillov <>< From jnelson at satcharters.com Sun Jun 14 17:00:17 2009 From: jnelson at satcharters.com (Jerry Nelson) Date: Sun, 14 Jun 2009 10:00:17 -0500 Subject: [scilab-Users] Plotting three dimensional vectors In-Reply-To: References: Message-ID: <4A351081.10702@satcharters.com> Cels, This is almost exactly what I am looking for, and pretty neat too. Not only does it help me visualize the vectors, your code gives offers me a bit of a tutorial on how things work here. I appreciate your effort very much! Jerry Celso Co wrote: > Jerry, Please try my attachment. It may help. Regards, cels > > -----Original Message----- > From: Jerry Nelson [mailto:jnelson at satcharters.com] > Sent: Sunday, June 07, 2009 3:24 AM > To: users at lists.scilab.org > Subject: [scilab-Users] Plotting three dimensional vectors > > > Good afternoon, > > I am trying to visualize two simple vectors in three dimensions, and not > having much luck. So I thought I would try to create a picture to help. > I'm not having much luck there either. > > I would like to create a plot of the two vectors x=(2, 4, 9) and y=(1, > 3, 5), and to display them both on the same graphic with the axis' > displayed as well. I have searched through the manual, the help system, > and the demos to no avail. There is a lot of information there, but with > no starting point, I am just getting further confused. > > If I'm not asking too much, it would be nice to display each vector in a > different color, and to define the axis dimensions (in other words set > the x-axis to -5 to 10, the y-axis to 0 to 10, and the z-axis to -10 to 10) > > Thanks for any help, > Jerry From maitreyakara at yahoo.com Tue Jun 16 06:34:22 2009 From: maitreyakara at yahoo.com (Sattiraju Prabhakar) Date: Mon, 15 Jun 2009 21:34:22 -0700 Subject: [scilab-Users] Using functions in Java In-Reply-To: <1244648811.7669.174.camel@zlarin> References: <22688.17681.qm@web63704.mail.re1.yahoo.com> <1244648811.7669.174.camel@zlarin> Message-ID: <000601c9ee3b$ba2d4560$2e87d020$@com> Thanks Sylvestre! Your response is very helpful. Sorry for the delayed reply. First, let me explain why I was trying to create Java methods for Scilab functions, without using Scilab.ExecuteScilabScript(String filename). I have been developing a complex Java application, and a lot of effort has gone into structuring the application to make it extensible and readable. I would like Java to continue to provide that structure while using other programs like Scilab. For example, I can have variations of methods as the classes get extended. I agree with you that using Scilab.ExecuteScilabScript(String filename) saves time. I tested your suggestion for "Problem Using Function" below -include "end". It is still giving error. When I tried to step through the function declaration, in debugger, I found something interesting. Everytime Scilab.Exec() encountered, it returns "false", except in the case of "disp". I think Scilab.Exec requires an executable statements as arguments. Since the function declaration does not provide statements for immediate execution, it returns false (error, according to Scialb.Exec()). I think that is also the reason why it executes disp statement during the function declaration. Am I correct? Is there a way around this problem, without entering the function body as a very long string? Thanks for suggesting me to include "end". The "string" type solution which you provided is working for me too. I guess the same problems are applicable to "deff" also. Thanks! Prabhakar > -----Original Message----- > From: Sylvestre Ledru [mailto:sylvestre.ledru at scilab.org] > Sent: Wednesday, June 10, 2009 8:47 AM > To: users at lists.scilab.org > Cc: Sattiraju Prabhakar > Subject: Re: [scilab-Users] Using functions in Java > > Hello, > > > Le samedi 30 mai 2009 ? 01:15 -0700, Sattiraju Prabhakar a ?crit : > > Hi, > > > > I am trying to use Scilab (5.1.1) from a Java (jdk 6 update 13) > > application. > > I have been experimenting with some Scilab scripts that use > > function ("function" and "deff") definitions. > > When I tried to convert these scripts into Java, I have come > > across a number of problems. > > > > Problems using "function" > > ================ > > > > I took the "function percentile" declaration from Professor Gilberto > > Gurroz's > > Basic Statistics and Probability using Scilab. I reproduce below the > > script. > > > > function [p] = percentile(x,r) > > //This function calculates the 100*r-th percentile > > //(0 > xx = gsort(x); > > [n m] = size(xx); > > if m>n & n == 1 > > n = m; > > end > > if r<0 | r>1 then > > disp('Percentile value must be between 0 and 1'); > > else > > k = n*r; > > if k-floor(k) ~= 0 > > p = xx(round(n*r)); > > else > > p = (xx(k)+xx(k+1))/2; > > end > > end > > > > It is used as follows > > Q1 = percentile(x,0.25) > > > > I tried to put it in Java code in two different ways. > > > > A. In the first attempt, I tried to execute each line using > > Scilab.Exec. The code follows. > > > > public void percentile() { > > Scilab.Exec("function [p] = percentile(x,r)"); > > //This function calculates the 100*r-th percentile > > //(0 > Scilab.Exec("xx = gsort(x);"); > > Scilab.Exec("[n m] = size(xx);"); > > Scilab.Exec("if m>n & n == 1"); > > Scilab.Exec("n = m;"); > > Scilab.Exec("end"); > > Scilab.Exec("if r<0 | r>1 then"); > > Scilab.Exec("disp('Percentile value must be between 0 and > > 1');"); > > Scilab.Exec("else"); > > Scilab.Exec("k = n*r;"); > > Scilab.Exec(" if k-floor(k) ~= 0"); > > Scilab.Exec("p = xx(round(n*r)); "); > > Scilab.Exec("else"); > > Scilab.Exec("p = (xx(k)+xx(k+1))/2;"); > > Scilab.Exec("end"); > > Scilab.Exec("endfunction"); > > } > Why don't you directly store this into a dedicated percentile.sci file > and call the java method Scilab.ExecuteScilabScript(String filename) ? > > Btw, your error is due to a missing end just before the endfunction. > > > > I tried to apply this function as follows. > > SciDouble Q1P = new SciDouble("Q1"); > > Scilab.Exec("Q1 = percentile(x,0.25)"); > > Q1P.Get(); > > Q1P.disp(); > > > > I get the following error. > > double Q1= > > > > 0. > > Error in Java_javasci_Scilab_Exec routine. > This is normal that it is failling here. > Scilab.Exec is waiting for a consistent expression. > > If you try: > if (!Scilab.Exec("function [p] = percentile(x,r)")){ > System.out.println(Scilab.GetLastErrorCode()); > } > you will that that you will get an error (code 272... no endfunction). > > > > B. I tried to declare the entire function as a string and pass the > > string as argument to Scilab.Exec(). > > > > > > public void percentile() { > > String perc2 = "function [p] = percentile(x,r) \n xx = gsort(x); > > \n [n m] = size(xx); \n if m>n & n == 1 \n n = m; \n end \n if r<0 | > > r>1 then \n disp('Percentile value must be between 0 and 1'); \n else > > \n k = n*r; \n if k-floor(k) ~= 0 \n p = xx(round(n*r)); \n else \n p > > = (xx(k)+xx(k+1))/2; \n end \n endfunction"; > > Scilab.Exec(perc2); > > } > > > I tried it without \n, and later with \n. In both cases, I got the > > same error as above. > Same issue, you forgot the end. > > The following code is working for me: > import javasci.*; > public class percentile { > > > public static void main(String args[]){ > String aze="function [p] = percentile(x,r); xx = gsort(x); > [n m] = > size(xx); if m>n & n == 1 n = m; end; if r<0 > | r>1 then disp('Percentile value must be between 0 and 1'); > else; k = n*r; if k-floor(k) ~= 0; p = > xx(round(n*r)); else; p = (xx(k)+xx(k+1))/2; end; > end; endfunction"; > if (!Scilab.Exec(aze)){ > System.out.println(Scilab.GetLastErrorCode()); > } > SciDouble Q1P = new SciDouble("Q1"); > Scilab.Exec("x=[23,2323,934,42];"); > Scilab.Exec("Q1 = percentile(x,0.25)"); > Q1P.Get(); > Q1P.disp(); > } > } > > > 2. Using deff > > ============= > > > > I was able to successfully write and execute the above example using > deff > > > > Scilab.Exec("deff('[x,y]=myfct(a,b)', ['x=a+b'; 'y=a-b'])"); > > > > "deff" requires that we state the "statements" of the function as > matrix of strings. > > If you have a String inside the function declaration (of Scilab > script), as in percentile, then > > it becomes a problem. > > > > I was not able to get a correct result for percentile using deff and > Java. > > Here is my code: > > Scilab.Exec("deff('[p]=percentile(x,r)', ['xx = gsort(x);'; '[n m] = > size(xx);'; ' if m>n & n == 1 n = m;'; 'end'; 'if r<0 | r>1 then > disp('Percentile value must be between 0 and 1');' ; 'else k = n*r;'; > 'if k-floor(k) ~= 0 p = xx(round(n*r));'; 'else p = > (xx(k)+xx(k+1))/2;'; 'end' ])"); > Probably the same issue as before. > > > I would like to end with a general question. Each of the above methods > > takes some effort. > > If the function definition is long, then the effort needed to convert > > into Java code can be > > substantial. Is there a simple method? > Yep, load the function from a file. > > Sylvestre From sylvestre.ledru at scilab.org Tue Jun 16 09:35:21 2009 From: sylvestre.ledru at scilab.org (Sylvestre Ledru) Date: Tue, 16 Jun 2009 09:35:21 +0200 Subject: [scilab-Users] Using functions in Java In-Reply-To: <000601c9ee3b$ba2d4560$2e87d020$@com> References: <22688.17681.qm@web63704.mail.re1.yahoo.com> <1244648811.7669.174.camel@zlarin> <000601c9ee3b$ba2d4560$2e87d020$@com> Message-ID: <1245137721.4681.19627.camel@korcula.inria.fr> Le lundi 15 juin 2009 ? 21:34 -0700, Sattiraju Prabhakar a ?crit : > Thanks Sylvestre! Your response is very helpful. Good > Sorry for the delayed reply. No worries > First, let me explain why I was trying to create Java methods for > Scilab functions, without using Scilab.ExecuteScilabScript(String filename). > I have been developing a complex Java application, and a lot of effort > has gone into structuring the application to make it extensible and > readable. I would like Java to continue to provide that structure while > using other programs like Scilab. For example, I can have variations of > methods as the classes get extended. > > I agree with you that using Scilab.ExecuteScilabScript(String filename) > saves time. > > I tested your suggestion for "Problem Using Function" below -include "end". > It is still giving error. When I tried to step through the function > declaration, in debugger, I found something interesting. > Everytime Scilab.Exec() encountered, it returns "false", > except in the case of "disp". I think Scilab.Exec requires an > executable statements as arguments. Yep, it is what I tried to say in my previous email. > Since the function declaration does not provide statements for immediate execution, it returns false > (error, according to Scialb.Exec()). I think that is also the > reason why it executes disp statement during the function declaration. > Am I correct? Is there a way around this problem, without entering the function > body as a very long string? It is not really a problem. Each instruction has to be syntactically correct... If you do want to be able to do that, you can inherent from the Scilab class and create a SQL-commit like feature. Ie, write into a buffer your series of commands and once you are happy, you commit it (and the commit with just merge all the strings into one or write into a temp file and Scilab.ExecuteScilabScript it). Am I clear ? > Thanks for suggesting me to include "end". The "string" type solution which you provided > is working for me too. Good. > I guess the same problems are applicable to "deff" also. Probably ! Sylvestre > Thanks! > > Prabhakar > > > > > > -----Original Message----- > > From: Sylvestre Ledru [mailto:sylvestre.ledru at scilab.org] > > Sent: Wednesday, June 10, 2009 8:47 AM > > To: users at lists.scilab.org > > Cc: Sattiraju Prabhakar > > Subject: Re: [scilab-Users] Using functions in Java > > > > Hello, > > > > > > Le samedi 30 mai 2009 ? 01:15 -0700, Sattiraju Prabhakar a ?crit : > > > Hi, > > > > > > I am trying to use Scilab (5.1.1) from a Java (jdk 6 update 13) > > > application. > > > I have been experimenting with some Scilab scripts that use > > > function ("function" and "deff") definitions. > > > When I tried to convert these scripts into Java, I have come > > > across a number of problems. > > > > > > Problems using "function" > > > ================ > > > > > > I took the "function percentile" declaration from Professor Gilberto > > > Gurroz's > > > Basic Statistics and Probability using Scilab. I reproduce below the > > > script. > > > > > > function [p] = percentile(x,r) > > > //This function calculates the 100*r-th percentile > > > //(0 > > xx = gsort(x); > > > [n m] = size(xx); > > > if m>n & n == 1 > > > n = m; > > > end > > > if r<0 | r>1 then > > > disp('Percentile value must be between 0 and 1'); > > > else > > > k = n*r; > > > if k-floor(k) ~= 0 > > > p = xx(round(n*r)); > > > else > > > p = (xx(k)+xx(k+1))/2; > > > end > > > end > > > > > > It is used as follows > > > Q1 = percentile(x,0.25) > > > > > > I tried to put it in Java code in two different ways. > > > > > > A. In the first attempt, I tried to execute each line using > > > Scilab.Exec. The code follows. > > > > > > public void percentile() { > > > Scilab.Exec("function [p] = percentile(x,r)"); > > > //This function calculates the 100*r-th percentile > > > //(0 > > Scilab.Exec("xx = gsort(x);"); > > > Scilab.Exec("[n m] = size(xx);"); > > > Scilab.Exec("if m>n & n == 1"); > > > Scilab.Exec("n = m;"); > > > Scilab.Exec("end"); > > > Scilab.Exec("if r<0 | r>1 then"); > > > Scilab.Exec("disp('Percentile value must be between 0 and > > > 1');"); > > > Scilab.Exec("else"); > > > Scilab.Exec("k = n*r;"); > > > Scilab.Exec(" if k-floor(k) ~= 0"); > > > Scilab.Exec("p = xx(round(n*r)); "); > > > Scilab.Exec("else"); > > > Scilab.Exec("p = (xx(k)+xx(k+1))/2;"); > > > Scilab.Exec("end"); > > > Scilab.Exec("endfunction"); > > > } > > Why don't you directly store this into a dedicated percentile.sci file > > and call the java method Scilab.ExecuteScilabScript(String filename) ? > > > > Btw, your error is due to a missing end just before the endfunction. > > > > > > > I tried to apply this function as follows. > > > SciDouble Q1P = new SciDouble("Q1"); > > > Scilab.Exec("Q1 = percentile(x,0.25)"); > > > Q1P.Get(); > > > Q1P.disp(); > > > > > > I get the following error. > > > double Q1= > > > > > > 0. > > > Error in Java_javasci_Scilab_Exec routine. > > This is normal that it is failling here. > > Scilab.Exec is waiting for a consistent expression. > > > > If you try: > > if (!Scilab.Exec("function [p] = percentile(x,r)")){ > > System.out.println(Scilab.GetLastErrorCode()); > > } > > you will that that you will get an error (code 272... no endfunction). > > > > > > > B. I tried to declare the entire function as a string and pass the > > > string as argument to Scilab.Exec(). > > > > > > > > > public void percentile() { > > > String perc2 = "function [p] = percentile(x,r) \n xx = gsort(x); > > > \n [n m] = size(xx); \n if m>n & n == 1 \n n = m; \n end \n if r<0 | > > > r>1 then \n disp('Percentile value must be between 0 and 1'); \n else > > > \n k = n*r; \n if k-floor(k) ~= 0 \n p = xx(round(n*r)); \n else \n p > > > = (xx(k)+xx(k+1))/2; \n end \n endfunction"; > > > Scilab.Exec(perc2); > > > } > > > > > I tried it without \n, and later with \n. In both cases, I got the > > > same error as above. > > Same issue, you forgot the end. > > > > The following code is working for me: > > import javasci.*; > > public class percentile { > > > > > > public static void main(String args[]){ > > String aze="function [p] = percentile(x,r); xx = gsort(x); > > [n m] = > > size(xx); if m>n & n == 1 n = m; end; if r<0 > > | r>1 then disp('Percentile value must be between 0 and 1'); > > else; k = n*r; if k-floor(k) ~= 0; p = > > xx(round(n*r)); else; p = (xx(k)+xx(k+1))/2; end; > > end; endfunction"; > > if (!Scilab.Exec(aze)){ > > System.out.println(Scilab.GetLastErrorCode()); > > } > > SciDouble Q1P = new SciDouble("Q1"); > > Scilab.Exec("x=[23,2323,934,42];"); > > Scilab.Exec("Q1 = percentile(x,0.25)"); > > Q1P.Get(); > > Q1P.disp(); > > } > > } > > > > > 2. Using deff > > > ============= > > > > > > I was able to successfully write and execute the above example using > > deff > > > > > > Scilab.Exec("deff('[x,y]=myfct(a,b)', ['x=a+b'; 'y=a-b'])"); > > > > > > "deff" requires that we state the "statements" of the function as > > matrix of strings. > > > If you have a String inside the function declaration (of Scilab > > script), as in percentile, then > > > it becomes a problem. > > > > > > I was not able to get a correct result for percentile using deff and > > Java. > > > Here is my code: > > > Scilab.Exec("deff('[p]=percentile(x,r)', ['xx = gsort(x);'; '[n m] = > > size(xx);'; ' if m>n & n == 1 n = m;'; 'end'; 'if r<0 | r>1 then > > disp('Percentile value must be between 0 and 1');' ; 'else k = n*r;'; > > 'if k-floor(k) ~= 0 p = xx(round(n*r));'; 'else p = > > (xx(k)+xx(k+1))/2;'; 'end' ])"); > > Probably the same issue as before. > > > > > I would like to end with a general question. Each of the above methods > > > takes some effort. > > > If the function definition is long, then the effort needed to convert > > > into Java code can be > > > substantial. Is there a simple method? > > Yep, load the function from a file. > > > > Sylvestre > > > From sekulkar at tibco.com Tue Jun 16 11:20:04 2009 From: sekulkar at tibco.com (Setumadhav Kulkarni) Date: Tue, 16 Jun 2009 02:20:04 -0700 Subject: API Mode Message-ID: <3C63D4B0739D7745B3B326A551CDB5ACE86826@NA-PA-VBE04.na.tibco.com> Hello and sorry for the broadcast! I am a new user and here is exactly what I want to do: 1. I want to submit a job to the Scilab compute engine programmatically (preferably using Java or C#). My questions regarding this are: 1. I just need to install Scilab in the API mode, am I correct? If yes, how do I install this software in the API mode. 2. Are there any sample available that show how one of the Scilab examples can be used for this submission? Any help/pointers are much appreciated! Thanks, Setu -------------- next part -------------- An HTML attachment was scrubbed... URL: From sylvestre.ledru at scilab.org Tue Jun 16 12:03:23 2009 From: sylvestre.ledru at scilab.org (Sylvestre Ledru) Date: Tue, 16 Jun 2009 12:03:23 +0200 Subject: [scilab-Users] API Mode In-Reply-To: <3C63D4B0739D7745B3B326A551CDB5ACE86826@NA-PA-VBE04.na.tibco.com> References: <3C63D4B0739D7745B3B326A551CDB5ACE86826@NA-PA-VBE04.na.tibco.com> Message-ID: <1245146603.4681.19967.camel@korcula.inria.fr> Le mardi 16 juin 2009 ? 02:20 -0700, Setumadhav Kulkarni a ?crit : > Hello and sorry for the broadcast! No problem, it is the goal of this mailing list. > 1. I just need to install Scilab in the API mode, am I correct? > If yes, how do I install this software in the API mode. If you are under Windows, on the installer, disable most of the items. Under Linux, you have to build it yourself (it is not hard) and disable the features you don't need with --without-xxxxx ./configure --help|grep without will give you some answer. > 1. Are there any sample available that show how one of the Scilab > examples can be used for this submission? This can be useful: http://www.scilab.org/product/man/compile_and_run_javasci.html If you want to call Scilab from C/C++, have a look to the call_scilab documentation in a nightly build version of Scilab (the documentation has been written recently on it). Sylvestre From sekulkar at tibco.com Tue Jun 16 12:08:19 2009 From: sekulkar at tibco.com (Setumadhav Kulkarni) Date: Tue, 16 Jun 2009 03:08:19 -0700 Subject: [scilab-Users] API Mode In-Reply-To: <1245146603.4681.19967.camel@korcula.inria.fr> References: <3C63D4B0739D7745B3B326A551CDB5ACE86826@NA-PA-VBE04.na.tibco.com> <1245146603.4681.19967.camel@korcula.inria.fr> Message-ID: <3C63D4B0739D7745B3B326A551CDB5ACE86844@NA-PA-VBE04.na.tibco.com> Thanks Sylvestre! The way I was approaching it is as follows: 1. I just imported all the Java files (in Eclipse) from the examples in: \scilab-5.1.1\modules\javasci\examples\others\ 2. I added the javasci.jar to the build path of the project. 3. I am thinking of compiling and running the Example1.java and hoping that it will make a call to the Scilab engine. I understand that there will be some JNI calls underneath this, to make calls to the native library that has the engine code. Please correct my assumptions. Right now I have reached till step 2. I am hunting for the dll that has the entry point to the engine native code. Regards, Setu -----Original Message----- From: Sylvestre Ledru [mailto:sylvestre.ledru at scilab.org] Sent: Tuesday, June 16, 2009 3:33 PM To: users at lists.scilab.org Subject: Re: [scilab-Users] API Mode Le mardi 16 juin 2009 ? 02:20 -0700, Setumadhav Kulkarni a ?crit : > Hello and sorry for the broadcast! No problem, it is the goal of this mailing list. > 1. I just need to install Scilab in the API mode, am I correct? > If yes, how do I install this software in the API mode. If you are under Windows, on the installer, disable most of the items. Under Linux, you have to build it yourself (it is not hard) and disable the features you don't need with --without-xxxxx ./configure --help|grep without will give you some answer. > 1. Are there any sample available that show how one of the Scilab > examples can be used for this submission? This can be useful: http://www.scilab.org/product/man/compile_and_run_javasci.html If you want to call Scilab from C/C++, have a look to the call_scilab documentation in a nightly build version of Scilab (the documentation has been written recently on it). Sylvestre -------------- next part -------------- An HTML attachment was scrubbed... URL: From sylvestre.ledru at scilab.org Tue Jun 16 12:14:41 2009 From: sylvestre.ledru at scilab.org (Sylvestre Ledru) Date: Tue, 16 Jun 2009 12:14:41 +0200 Subject: [scilab-Users] API Mode In-Reply-To: <3C63D4B0739D7745B3B326A551CDB5ACE86844@NA-PA-VBE04.na.tibco.com> References: <3C63D4B0739D7745B3B326A551CDB5ACE86826@NA-PA-VBE04.na.tibco.com> <1245146603.4681.19967.camel@korcula.inria.fr> <3C63D4B0739D7745B3B326A551CDB5ACE86844@NA-PA-VBE04.na.tibco.com> Message-ID: <1245147281.4681.19998.camel@korcula.inria.fr> Le mardi 16 juin 2009 ? 03:08 -0700, Setumadhav Kulkarni a ?crit : > Thanks Sylvestre! > > > > The way I was approaching it is as follows: > > > > 1. I just imported all the Java files (in Eclipse) from the > examples in: \scilab-5.1.1\modules\javasci\examples\others\ > > 2. I added the javasci.jar to the build path of the project. 2.1 Set the SCI variable to the Scilab path (data) 2.2 Set the LD_LIBRARY_PATH or PATH to the directory containing Scilab native libraries (ie, .so, .jnilib or .dll). 2.3 Set the LD_LIBRARY_PATH or PATH to the directory containing Java native libraries (usually, libjava, libjvm and libhpi) Check the help of "Compile and run with javasci" of a Scilab nightly build for the actual path under Windows. > 3. I am thinking of compiling and running the Example1.java and > hoping that it will make a call to the Scilab engine. I understand > that there will be some JNI calls underneath this, to make calls to > the native library that has the engine code. S From sekulkar at tibco.com Tue Jun 16 13:04:19 2009 From: sekulkar at tibco.com (Setumadhav Kulkarni) Date: Tue, 16 Jun 2009 04:04:19 -0700 Subject: [scilab-Users] API Mode In-Reply-To: <1245146603.4681.19967.camel@korcula.inria.fr> References: <3C63D4B0739D7745B3B326A551CDB5ACE86826@NA-PA-VBE04.na.tibco.com> <1245146603.4681.19967.camel@korcula.inria.fr> Message-ID: <3C63D4B0739D7745B3B326A551CDB5ACE8685C@NA-PA-VBE04.na.tibco.com> Thanks Sylvestre! I got it working, and I had to set PATH, SCI, SCILAB variables in my env. :-) -----Original Message----- From: Sylvestre Ledru [mailto:sylvestre.ledru at scilab.org] Sent: Tuesday, June 16, 2009 3:33 PM To: users at lists.scilab.org Subject: Re: [scilab-Users] API Mode Le mardi 16 juin 2009 ? 02:20 -0700, Setumadhav Kulkarni a ?crit : > Hello and sorry for the broadcast! No problem, it is the goal of this mailing list. > 1. I just need to install Scilab in the API mode, am I correct? > If yes, how do I install this software in the API mode. If you are under Windows, on the installer, disable most of the items. Under Linux, you have to build it yourself (it is not hard) and disable the features you don't need with --without-xxxxx ./configure --help|grep without will give you some answer. > 1. Are there any sample available that show how one of the Scilab > examples can be used for this submission? This can be useful: http://www.scilab.org/product/man/compile_and_run_javasci.html If you want to call Scilab from C/C++, have a look to the call_scilab documentation in a nightly build version of Scilab (the documentation has been written recently on it). Sylvestre From vaborg at gmail.com Tue Jun 16 17:53:06 2009 From: vaborg at gmail.com (Ivan Maximov) Date: Tue, 16 Jun 2009 17:53:06 +0200 Subject: analogy for Matlab fminunc function Message-ID: <20090616175306.9d1678c2.vaborg@gmail.com> Does anybody know the analogy for the Matlab function fminunc() from Matlab optimal toolbox through out the Scilab toolboxes? Thanks a lot in advance. --------- best regards, Ivan From stephane.mottelet at utc.fr Tue Jun 16 18:07:54 2009 From: stephane.mottelet at utc.fr (=?UTF-8?B?U3TCjsOpcGhhbmUgTW90dGVsZXQ=?=) Date: Tue, 16 Jun 2009 18:07:54 +0200 Subject: [scilab-Users] analogy for Matlab fminunc function In-Reply-To: <20090616175306.9d1678c2.vaborg@gmail.com> References: <20090616175306.9d1678c2.vaborg@gmail.com> Message-ID: <4A37C35A.8040909@utc.fr> Ivan Maximov a ?crit : > Does anybody know the analogy for the Matlab function > fminunc() from Matlab optimal toolbox through out the Scilab toolboxes? > Thanks a lot in advance. > --------- > best regards, > Ivan > > help optim S. From sekulkar at tibco.com Tue Jun 16 19:25:33 2009 From: sekulkar at tibco.com (Setumadhav Kulkarni) Date: Tue, 16 Jun 2009 10:25:33 -0700 Subject: API Mode Java version? In-Reply-To: <1DA523F4760AA94C983A9F08578B219E16E22EAB@NA-PA-VBE04.na.tibco.com> References: <3C63D4B0739D7745B3B326A551CDB5ACE86826@NA-PA-VBE04.na.tibco.com> <1245146603.4681.19967.camel@korcula.inria.fr> <1DA523F4760AA94C983A9F08578B219E16E22EAB@NA-PA-VBE04.na.tibco.com> Message-ID: <3C63D4B0739D7745B3B326A551CDB5ACE868DD@NA-PA-VBE04.na.tibco.com> Is it necessary to have Java 6 for API Mode to work? I am bound by a limitation to use Java 5. My use case is to invoke the sci engine from within Java code. Thanks much! Setu From sylvestre.ledru at scilab.org Tue Jun 16 19:27:10 2009 From: sylvestre.ledru at scilab.org (Sylvestre Ledru) Date: Tue, 16 Jun 2009 19:27:10 +0200 Subject: [scilab-Users] API Mode Java version? In-Reply-To: <3C63D4B0739D7745B3B326A551CDB5ACE868DD@NA-PA-VBE04.na.tibco.com> References: <3C63D4B0739D7745B3B326A551CDB5ACE86826@NA-PA-VBE04.na.tibco.com> <1245146603.4681.19967.camel@korcula.inria.fr> <1DA523F4760AA94C983A9F08578B219E16E22EAB@NA-PA-VBE04.na.tibco.com> <3C63D4B0739D7745B3B326A551CDB5ACE868DD@NA-PA-VBE04.na.tibco.com> Message-ID: <1245173230.4680.2671.camel@zlarin> Le mardi 16 juin 2009 ? 10:25 -0700, Setumadhav Kulkarni a ?crit : > Is it necessary to have Java 6 for API Mode to work? No, Java 5 is OK too. Sylvestre From sekulkar at tibco.com Tue Jun 16 19:31:30 2009 From: sekulkar at tibco.com (Setumadhav Kulkarni) Date: Tue, 16 Jun 2009 10:31:30 -0700 Subject: [scilab-Users] API Mode Java version? In-Reply-To: <1245173230.4680.2671.camel@zlarin> References: <3C63D4B0739D7745B3B326A551CDB5ACE86826@NA-PA-VBE04.na.tibco.com> <1245146603.4681.19967.camel@korcula.inria.fr> <1DA523F4760AA94C983A9F08578B219E16E22EAB@NA-PA-VBE04.na.tibco.com> <3C63D4B0739D7745B3B326A551CDB5ACE868DD@NA-PA-VBE04.na.tibco.com> <1245173230.4680.2671.camel@zlarin> Message-ID: <3C63D4B0739D7745B3B326A551CDB5ACE868DE@NA-PA-VBE04.na.tibco.com> I always get: java.lang.UnsupportedClassVersionError: Bad version number in .class file when I try to run the sample. Earlier, to get it working, I upgraded to Java 6, but I am bound to use Java 5. Thanks, Setu -----Original Message----- From: Sylvestre Ledru [mailto:sylvestre.ledru at scilab.org] Sent: Tuesday, June 16, 2009 10:57 PM To: users at lists.scilab.org Subject: Re: [scilab-Users] API Mode Java version? Le mardi 16 juin 2009 ? 10:25 -0700, Setumadhav Kulkarni a ?crit : > Is it necessary to have Java 6 for API Mode to work? No, Java 5 is OK too. Sylvestre From sylvestre.ledru at scilab.org Tue Jun 16 19:39:11 2009 From: sylvestre.ledru at scilab.org (Sylvestre Ledru) Date: Tue, 16 Jun 2009 19:39:11 +0200 Subject: [scilab-Users] API Mode Java version? In-Reply-To: <3C63D4B0739D7745B3B326A551CDB5ACE868DE@NA-PA-VBE04.na.tibco.com> References: <3C63D4B0739D7745B3B326A551CDB5ACE86826@NA-PA-VBE04.na.tibco.com> <1245146603.4681.19967.camel@korcula.inria.fr> <1DA523F4760AA94C983A9F08578B219E16E22EAB@NA-PA-VBE04.na.tibco.com> <3C63D4B0739D7745B3B326A551CDB5ACE868DD@NA-PA-VBE04.na.tibco.com> <1245173230.4680.2671.camel@zlarin> <3C63D4B0739D7745B3B326A551CDB5ACE868DE@NA-PA-VBE04.na.tibco.com> Message-ID: <1245173951.4680.2709.camel@zlarin> Le mardi 16 juin 2009 ? 10:31 -0700, Setumadhav Kulkarni a ?crit : > I always get: > > java.lang.UnsupportedClassVersionError: Bad version number in .class file > > when I try to run the sample. >From the binary ? If yes, Windows, Linux or Mac OS x ? > Earlier, to get it working, I upgraded to Java 6, but I am bound to use Java 5. Please submit a bug report. That means that we forgot an option somewhere to make sure that the class file number version is compatible with Java 5. Sylvestre > Thanks, > > Setu > > -----Original Message----- > From: Sylvestre Ledru [mailto:sylvestre.ledru at scilab.org] > Sent: Tuesday, June 16, 2009 10:57 PM > To: users at lists.scilab.org > Subject: Re: [scilab-Users] API Mode Java version? > > Le mardi 16 juin 2009 ? 10:25 -0700, Setumadhav Kulkarni a ?crit : > > Is it necessary to have Java 6 for API Mode to work? > No, Java 5 is OK too. > > Sylvestre > > From sekulkar at tibco.com Tue Jun 16 19:42:27 2009 From: sekulkar at tibco.com (Setumadhav Kulkarni) Date: Tue, 16 Jun 2009 10:42:27 -0700 Subject: [scilab-Users] API Mode Java version? Message-ID: <3C63D4B0739D7745B3B326A551CDB5ACDBD06E@NA-PA-VBE04.na.tibco.com> Yes, I downloaded the binary and installed it for windows, Sylvestre. Would you have a java 5 compatible version of javasci.jar that I could use? ----- Original Message ----- From: Sylvestre Ledru To: users at lists.scilab.org Sent: Tue Jun 16 10:39:11 2009 Subject: RE: [scilab-Users] API Mode Java version? Le mardi 16 juin 2009 ? 10:31 -0700, Setumadhav Kulkarni a ?crit : > I always get: > > java.lang.UnsupportedClassVersionError: Bad version number in .class file > > when I try to run the sample. >From the binary ? If yes, Windows, Linux or Mac OS x ? > Earlier, to get it working, I upgraded to Java 6, but I am bound to use Java 5. Please submit a bug report. That means that we forgot an option somewhere to make sure that the class file number version is compatible with Java 5. Sylvestre > Thanks, > > Setu > > -----Original Message----- > From: Sylvestre Ledru [mailto:sylvestre.ledru at scilab.org] > Sent: Tuesday, June 16, 2009 10:57 PM > To: users at lists.scilab.org > Subject: Re: [scilab-Users] API Mode Java version? > > Le mardi 16 juin 2009 ? 10:25 -0700, Setumadhav Kulkarni a ?crit : > > Is it necessary to have Java 6 for API Mode to work? > No, Java 5 is OK too. > > Sylvestre > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sylvestre.ledru at scilab.org Tue Jun 16 21:39:00 2009 From: sylvestre.ledru at scilab.org (Sylvestre Ledru) Date: Tue, 16 Jun 2009 21:39:00 +0200 Subject: [scilab-Users] API Mode Java version? In-Reply-To: <3C63D4B0739D7745B3B326A551CDB5ACDBD06E@NA-PA-VBE04.na.tibco.com> References: <3C63D4B0739D7745B3B326A551CDB5ACDBD06E@NA-PA-VBE04.na.tibco.com> Message-ID: <1245181140.5558.63.camel@zlarin> Le mardi 16 juin 2009 ? 10:42 -0700, Setumadhav Kulkarni a ?crit : > Yes, > > I downloaded the binary and installed it for windows, Sylvestre. > > Would you have a java 5 compatible version of javasci.jar that I could > use? I just rebuilt with java 5 and uploaded it here: http://www.scilab.org/team/sylvestre.ledru/misc/javasci.jar However, I advice you to wait for your bug to be fixed to use this one in production... Sylvestre > ----- Original Message ----- > From: Sylvestre Ledru > To: users at lists.scilab.org > Sent: Tue Jun 16 10:39:11 2009 > Subject: RE: [scilab-Users] API Mode Java version? > > Le mardi 16 juin 2009 ? 10:31 -0700, Setumadhav Kulkarni a ?crit : > > I always get: > > > > java.lang.UnsupportedClassVersionError: Bad version number in .class > file > > > > when I try to run the sample. > >From the binary ? > If yes, Windows, Linux or Mac OS x ? > > > Earlier, to get it working, I upgraded to Java 6, but I am bound to > use Java 5. > Please submit a bug report. That means that we forgot an option > somewhere to make sure that the class file number version is > compatible > with Java 5. > > Sylvestre > > > Thanks, > > > > Setu > > > > -----Original Message----- > > From: Sylvestre Ledru [mailto:sylvestre.ledru at scilab.org] > > Sent: Tuesday, June 16, 2009 10:57 PM > > To: users at lists.scilab.org > > Subject: Re: [scilab-Users] API Mode Java version? > > > > Le mardi 16 juin 2009 ? 10:25 -0700, Setumadhav Kulkarni a ?crit : > > > Is it necessary to have Java 6 for API Mode to work? > > No, Java 5 is OK too. > > > > Sylvestre > > > > > > > From sekulkar at tibco.com Wed Jun 17 12:59:47 2009 From: sekulkar at tibco.com (Setumadhav Kulkarni) Date: Wed, 17 Jun 2009 03:59:47 -0700 Subject: [scilab-Users] API Mode Java version? In-Reply-To: <1245181140.5558.63.camel@zlarin> References: <3C63D4B0739D7745B3B326A551CDB5ACDBD06E@NA-PA-VBE04.na.tibco.com> <1245181140.5558.63.camel@zlarin> Message-ID: <3C63D4B0739D7745B3B326A551CDB5ACE869C4@NA-PA-VBE04.na.tibco.com> Thanks Sylvestre, But I tried this jar out and I get the following error now: "Scilab cannot create Scilab Java Main-Class (we have not been able to find the main Scilab class. Check if the Scilab and thirdparty packages are available" "Some problems during the loading of the Java libraries occured. This could lead to inconsistent behaviours. Please check SCI/etc/classpath.xml." I guess there is still some issue with the JAR file? Regards, Setu -----Original Message----- From: Sylvestre Ledru [mailto:sylvestre.ledru at scilab.org] Sent: Wednesday, June 17, 2009 1:09 AM To: users at lists.scilab.org Subject: Re: [scilab-Users] API Mode Java version? Le mardi 16 juin 2009 ? 10:42 -0700, Setumadhav Kulkarni a ?crit : > Yes, > > I downloaded the binary and installed it for windows, Sylvestre. > > Would you have a java 5 compatible version of javasci.jar that I could > use? I just rebuilt with java 5 and uploaded it here: http://www.scilab.org/team/sylvestre.ledru/misc/javasci.jar However, I advice you to wait for your bug to be fixed to use this one in production... Sylvestre > ----- Original Message ----- > From: Sylvestre Ledru > To: users at lists.scilab.org > Sent: Tue Jun 16 10:39:11 2009 > Subject: RE: [scilab-Users] API Mode Java version? > > Le mardi 16 juin 2009 ? 10:31 -0700, Setumadhav Kulkarni a ?crit : > > I always get: > > > > java.lang.UnsupportedClassVersionError: Bad version number in .class > file > > > > when I try to run the sample. > >From the binary ? > If yes, Windows, Linux or Mac OS x ? > > > Earlier, to get it working, I upgraded to Java 6, but I am bound to > use Java 5. > Please submit a bug report. That means that we forgot an option > somewhere to make sure that the class file number version is > compatible > with Java 5. > > Sylvestre > > > Thanks, > > > > Setu > > > > -----Original Message----- > > From: Sylvestre Ledru [mailto:sylvestre.ledru at scilab.org] > > Sent: Tuesday, June 16, 2009 10:57 PM > > To: users at lists.scilab.org > > Subject: Re: [scilab-Users] API Mode Java version? > > > > Le mardi 16 juin 2009 ? 10:25 -0700, Setumadhav Kulkarni a ?crit : > > > Is it necessary to have Java 6 for API Mode to work? > > No, Java 5 is OK too. > > > > Sylvestre > > > > > > > From sylvestre.ledru at scilab.org Wed Jun 17 13:21:27 2009 From: sylvestre.ledru at scilab.org (Sylvestre Ledru) Date: Wed, 17 Jun 2009 13:21:27 +0200 Subject: [scilab-Users] API Mode Java version? In-Reply-To: <3C63D4B0739D7745B3B326A551CDB5ACE869C4@NA-PA-VBE04.na.tibco.com> References: <3C63D4B0739D7745B3B326A551CDB5ACDBD06E@NA-PA-VBE04.na.tibco.com> <1245181140.5558.63.camel@zlarin> <3C63D4B0739D7745B3B326A551CDB5ACE869C4@NA-PA-VBE04.na.tibco.com> Message-ID: <1245237687.4681.24460.camel@korcula.inria.fr> Le mercredi 17 juin 2009 ? 03:59 -0700, Setumadhav Kulkarni a ?crit : > Thanks Sylvestre, > > But I tried this jar out and I get the following error now: > > "Scilab cannot create Scilab Java Main-Class (we have not been able to find the main Scilab class. Check if the Scilab and thirdparty packages are available" > > "Some problems during the loading of the Java libraries occured. > This could lead to inconsistent behaviours. > Please check SCI/etc/classpath.xml." Could you provide the full java backtrace if available ? > I guess there is still some issue with the JAR file? Maybe... You can try to rebuild Scilab yourself, switch to java 1.6 or wait for your bug to be fixed. Sylvestre > Regards, > > Setu > > -----Original Message----- > From: Sylvestre Ledru [mailto:sylvestre.ledru at scilab.org] > Sent: Wednesday, June 17, 2009 1:09 AM > To: users at lists.scilab.org > Subject: Re: [scilab-Users] API Mode Java version? > > Le mardi 16 juin 2009 ? 10:42 -0700, Setumadhav Kulkarni a ?crit : > > Yes, > > > > I downloaded the binary and installed it for windows, Sylvestre. > > > > Would you have a java 5 compatible version of javasci.jar that I could > > use? > I just rebuilt with java 5 and uploaded it here: > http://www.scilab.org/team/sylvestre.ledru/misc/javasci.jar > > However, I advice you to wait for your bug to be fixed to use this one > in production... > > Sylvestre > > > > ----- Original Message ----- > > From: Sylvestre Ledru > > To: users at lists.scilab.org > > Sent: Tue Jun 16 10:39:11 2009 > > Subject: RE: [scilab-Users] API Mode Java version? > > > > Le mardi 16 juin 2009 ? 10:31 -0700, Setumadhav Kulkarni a ?crit : > > > I always get: > > > > > > java.lang.UnsupportedClassVersionError: Bad version number in .class > > file > > > > > > when I try to run the sample. > > >From the binary ? > > If yes, Windows, Linux or Mac OS x ? > > > > > Earlier, to get it working, I upgraded to Java 6, but I am bound to > > use Java 5. > > Please submit a bug report. That means that we forgot an option > > somewhere to make sure that the class file number version is > > compatible > > with Java 5. > > > > Sylvestre > > > > > Thanks, > > > > > > Setu > > > > > > -----Original Message----- > > > From: Sylvestre Ledru [mailto:sylvestre.ledru at scilab.org] > > > Sent: Tuesday, June 16, 2009 10:57 PM > > > To: users at lists.scilab.org > > > Subject: Re: [scilab-Users] API Mode Java version? > > > > > > Le mardi 16 juin 2009 ? 10:25 -0700, Setumadhav Kulkarni a ?crit : > > > > Is it necessary to have Java 6 for API Mode to work? > > > No, Java 5 is OK too. > > > > > > Sylvestre > > > > > > > > > > > > > From sylvestre.ledru at scilab.org Wed Jun 17 13:53:46 2009 From: sylvestre.ledru at scilab.org (Sylvestre Ledru) Date: Wed, 17 Jun 2009 13:53:46 +0200 Subject: [scilab-Users] Problems with creating toolbox In-Reply-To: <1244674819.4048.15.camel@faith.universe> References: <1244674819.4048.15.camel@faith.universe> Message-ID: <1245239626.4681.24534.camel@korcula.inria.fr> > 2) In my toolbox there is also a GUI program, which I want to run just > after loading all functions from library . I know that one can create > demo, but is it possible to run GUI program just from main menu like > "Matlab to Scilab conversion tool"? Yep, see just call "addmenu" in the .start of your toolbox. Sylvestre From calixte.denizet at ac-rennes.fr Wed Jun 17 14:19:59 2009 From: calixte.denizet at ac-rennes.fr (Calixte Denizet) Date: Wed, 17 Jun 2009 14:19:59 +0200 Subject: New toolbox to overload user-defined functions Message-ID: <1245241199.2017.0.camel@debian> Hi, You can get this toolbox at the address http://www.scilab.org/contrib/index_contrib.php?page=displayContribution&fileID=1221 I developped it under Linux for Scilab 5.1 and it was not tested under an other system. Normally, the code (C and fortran) is portable and no problems should occure. I'm waiting for the opinions of Scilab's users. Calixte Denizet From celso.co at gmail.com Wed Jun 17 15:34:31 2009 From: celso.co at gmail.com (Celso Co) Date: Wed, 17 Jun 2009 21:34:31 +0800 Subject: [scilab-Users] Plotting three dimensional vectors In-Reply-To: <4A351081.10702@satcharters.com> Message-ID: Jerry, You are welcome. cels, -----Original Message----- From: Jerry Nelson [mailto:jnelson at satcharters.com] Sent: Sunday, June 14, 2009 11:00 PM To: users at lists.scilab.org Subject: Re: [scilab-Users] Plotting three dimensional vectors Cels, This is almost exactly what I am looking for, and pretty neat too. Not only does it help me visualize the vectors, your code gives offers me a bit of a tutorial on how things work here. I appreciate your effort very much! Jerry Celso Co wrote: > Jerry, Please try my attachment. It may help. Regards, cels > > -----Original Message----- > From: Jerry Nelson [mailto:jnelson at satcharters.com] > Sent: Sunday, June 07, 2009 3:24 AM > To: users at lists.scilab.org > Subject: [scilab-Users] Plotting three dimensional vectors > > > Good afternoon, > > I am trying to visualize two simple vectors in three dimensions, and not > having much luck. So I thought I would try to create a picture to help. > I'm not having much luck there either. > > I would like to create a plot of the two vectors x=(2, 4, 9) and y=(1, > 3, 5), and to display them both on the same graphic with the axis' > displayed as well. I have searched through the manual, the help system, > and the demos to no avail. There is a lot of information there, but with > no starting point, I am just getting further confused. > > If I'm not asking too much, it would be nice to display each vector in a > different color, and to define the axis dimensions (in other words set > the x-axis to -5 to 10, the y-axis to 0 to 10, and the z-axis to -10 to 10) > > Thanks for any help, > Jerry From kirill.kirillov at gmail.com Wed Jun 17 21:58:32 2009 From: kirill.kirillov at gmail.com (Kirill Kirillov) Date: Wed, 17 Jun 2009 23:58:32 +0400 Subject: [scilab-Users] Problems with creating toolbox In-Reply-To: <1245239626.4681.24534.camel@korcula.inria.fr> References: <1244674819.4048.15.camel@faith.universe> <1245239626.4681.24534.camel@korcula.inria.fr> Message-ID: <1245268712.5579.5.camel@faith.universe> Hi! ? ???, 17/06/2009 ? 13:53 +0200, Sylvestre Ledru ?????: > > 2) In my toolbox there is also a GUI program, which I want to run just > > after loading all functions from library . I know that one can create > > demo, but is it possible to run GUI program just from main menu like > > "Matlab to Scilab conversion tool"? > Yep, see just call "addmenu" in the .start of your toolbox. Thanks for suggestion, but there is one problem with "addmenu": I would like to add "Heat Flow Inspector" item at the end of the existing Tools menu, but the following command duplicates menu instead of just adding new item: addmenu(gettext("&Tools"), 'Heat Flow Inspector'); -- Kirill Kirillov <>< From maitreyakara at yahoo.com Fri Jun 19 01:18:24 2009 From: maitreyakara at yahoo.com (Sattiraju Prabhakar) Date: Thu, 18 Jun 2009 16:18:24 -0700 Subject: [scilab-Users] Using functions in Java In-Reply-To: <1245137721.4681.19627.camel@korcula.inria.fr> References: <22688.17681.qm@web63704.mail.re1.yahoo.com> <1244648811.7669.174.camel@zlarin> <000601c9ee3b$ba2d4560$2e87d020$@com> <1245137721.4681.19627.camel@korcula.inria.fr> Message-ID: <001201c9f06b$14fafdd0$3ef0f970$@com> Thanks Sylvestre, it is very helpful! Prabhakar > -----Original Message----- > From: Sylvestre Ledru [mailto:sylvestre.ledru at scilab.org] > Sent: Tuesday, June 16, 2009 12:35 AM > To: Sattiraju Prabhakar > Cc: users at lists.scilab.org > Subject: RE: [scilab-Users] Using functions in Java > > Le lundi 15 juin 2009 ? 21:34 -0700, Sattiraju Prabhakar a ?crit : > > Thanks Sylvestre! Your response is very helpful. > Good > > > Sorry for the delayed reply. > No worries > > > First, let me explain why I was trying to create Java methods for > > Scilab functions, without using Scilab.ExecuteScilabScript(String > filename). > > I have been developing a complex Java application, and a lot of effort > > has gone into structuring the application to make it extensible and > > readable. I would like Java to continue to provide that structure > while > > using other programs like Scilab. For example, I can have variations > of > > methods as the classes get extended. > > > > I agree with you that using Scilab.ExecuteScilabScript(String > filename) > > saves time. > > > > I tested your suggestion for "Problem Using Function" below -include > "end". > > It is still giving error. When I tried to step through the function > > declaration, in debugger, I found something interesting. > > Everytime Scilab.Exec() encountered, it returns "false", > > except in the case of "disp". I think Scilab.Exec requires an > > executable statements as arguments. > Yep, it is what I tried to say in my previous email. > > > Since the function declaration does not provide statements for > immediate execution, it returns false > > (error, according to Scialb.Exec()). I think that is also the > > reason why it executes disp statement during the function declaration. > > Am I correct? Is there a way around this problem, without entering the > function > > body as a very long string? > It is not really a problem. Each instruction has to be syntactically > correct... > If you do want to be able to do that, you can inherent from the Scilab > class and create a SQL-commit like feature. > Ie, write into a buffer your series of commands and once you are happy, > you commit it (and the commit with just merge all the strings into one > or write into a temp file and Scilab.ExecuteScilabScript it). > Am I clear ? > > > > Thanks for suggesting me to include "end". The "string" type solution > which you provided > > is working for me too. > Good. > > I guess the same problems are applicable to "deff" also. > Probably ! > > Sylvestre > > > Thanks! > > > > Prabhakar > > > > > > > > > > > -----Original Message----- > > > From: Sylvestre Ledru [mailto:sylvestre.ledru at scilab.org] > > > Sent: Wednesday, June 10, 2009 8:47 AM > > > To: users at lists.scilab.org > > > Cc: Sattiraju Prabhakar > > > Subject: Re: [scilab-Users] Using functions in Java > > > > > > Hello, > > > > > > > > > Le samedi 30 mai 2009 ? 01:15 -0700, Sattiraju Prabhakar a ?crit : > > > > Hi, > > > > > > > > I am trying to use Scilab (5.1.1) from a Java (jdk 6 update 13) > > > > application. > > > > I have been experimenting with some Scilab scripts that use > > > > function ("function" and "deff") definitions. > > > > When I tried to convert these scripts into Java, I have come > > > > across a number of problems. > > > > > > > > Problems using "function" > > > > ================ > > > > > > > > I took the "function percentile" declaration from Professor > Gilberto > > > > Gurroz's > > > > Basic Statistics and Probability using Scilab. I reproduce below > the > > > > script. > > > > > > > > function [p] = percentile(x,r) > > > > //This function calculates the 100*r-th percentile > > > > //(0 > > > xx = gsort(x); > > > > [n m] = size(xx); > > > > if m>n & n == 1 > > > > n = m; > > > > end > > > > if r<0 | r>1 then > > > > disp('Percentile value must be between 0 and 1'); > > > > else > > > > k = n*r; > > > > if k-floor(k) ~= 0 > > > > p = xx(round(n*r)); > > > > else > > > > p = (xx(k)+xx(k+1))/2; > > > > end > > > > end > > > > > > > > It is used as follows > > > > Q1 = percentile(x,0.25) > > > > > > > > I tried to put it in Java code in two different ways. > > > > > > > > A. In the first attempt, I tried to execute each line using > > > > Scilab.Exec. The code follows. > > > > > > > > public void percentile() { > > > > Scilab.Exec("function [p] = percentile(x,r)"); > > > > //This function calculates the 100*r-th percentile > > > > //(0 > > > Scilab.Exec("xx = gsort(x);"); > > > > Scilab.Exec("[n m] = size(xx);"); > > > > Scilab.Exec("if m>n & n == 1"); > > > > Scilab.Exec("n = m;"); > > > > Scilab.Exec("end"); > > > > Scilab.Exec("if r<0 | r>1 then"); > > > > Scilab.Exec("disp('Percentile value must be between 0 and > > > > 1');"); > > > > Scilab.Exec("else"); > > > > Scilab.Exec("k = n*r;"); > > > > Scilab.Exec(" if k-floor(k) ~= 0"); > > > > Scilab.Exec("p = xx(round(n*r)); "); > > > > Scilab.Exec("else"); > > > > Scilab.Exec("p = (xx(k)+xx(k+1))/2;"); > > > > Scilab.Exec("end"); > > > > Scilab.Exec("endfunction"); > > > > } > > > Why don't you directly store this into a dedicated percentile.sci > file > > > and call the java method Scilab.ExecuteScilabScript(String filename) > ? > > > > > > Btw, your error is due to a missing end just before the endfunction. > > > > > > > > > > I tried to apply this function as follows. > > > > SciDouble Q1P = new SciDouble("Q1"); > > > > Scilab.Exec("Q1 = percentile(x,0.25)"); > > > > Q1P.Get(); > > > > Q1P.disp(); > > > > > > > > I get the following error. > > > > double Q1= > > > > > > > > 0. > > > > Error in Java_javasci_Scilab_Exec routine. > > > This is normal that it is failling here. > > > Scilab.Exec is waiting for a consistent expression. > > > > > > If you try: > > > if (!Scilab.Exec("function [p] = percentile(x,r)")){ > > > System.out.println(Scilab.GetLastErrorCode()); > > > } > > > you will that that you will get an error (code 272... no > endfunction). > > > > > > > > > > B. I tried to declare the entire function as a string and pass the > > > > string as argument to Scilab.Exec(). > > > > > > > > > > > > public void percentile() { > > > > String perc2 = "function [p] = percentile(x,r) \n xx = > gsort(x); > > > > \n [n m] = size(xx); \n if m>n & n == 1 \n n = m; \n end \n if r<0 > | > > > > r>1 then \n disp('Percentile value must be between 0 and 1'); \n > else > > > > \n k = n*r; \n if k-floor(k) ~= 0 \n p = xx(round(n*r)); \n else > \n p > > > > = (xx(k)+xx(k+1))/2; \n end \n endfunction"; > > > > Scilab.Exec(perc2); > > > > } > > > > > > > I tried it without \n, and later with \n. In both cases, I got the > > > > same error as above. > > > Same issue, you forgot the end. > > > > > > The following code is working for me: > > > import javasci.*; > > > public class percentile { > > > > > > > > > public static void main(String args[]){ > > > String aze="function [p] = percentile(x,r); xx = gsort(x); > > > [n m] = > > > size(xx); if m>n & n == 1 n = m; end; if > r<0 > > > | r>1 then disp('Percentile value must be between 0 and 1'); > > > else; k = n*r; if k-floor(k) ~= 0; p = > > > xx(round(n*r)); else; p = (xx(k)+xx(k+1))/2; > end; > > > end; endfunction"; > > > if (!Scilab.Exec(aze)){ > > > System.out.println(Scilab.GetLastErrorCode()); > > > } > > > SciDouble Q1P = new SciDouble("Q1"); > > > Scilab.Exec("x=[23,2323,934,42];"); > > > Scilab.Exec("Q1 = percentile(x,0.25)"); > > > Q1P.Get(); > > > Q1P.disp(); > > > } > > > } > > > > > > > 2. Using deff > > > > ============= > > > > > > > > I was able to successfully write and execute the above example > using > > > deff > > > > > > > > Scilab.Exec("deff('[x,y]=myfct(a,b)', ['x=a+b'; 'y=a-b'])"); > > > > > > > > "deff" requires that we state the "statements" of the function as > > > matrix of strings. > > > > If you have a String inside the function declaration (of Scilab > > > script), as in percentile, then > > > > it becomes a problem. > > > > > > > > I was not able to get a correct result for percentile using deff > and > > > Java. > > > > Here is my code: > > > > Scilab.Exec("deff('[p]=percentile(x,r)', ['xx = gsort(x);'; '[n m] > = > > > size(xx);'; ' if m>n & n == 1 n = m;'; 'end'; 'if r<0 | r>1 then > > > disp('Percentile value must be between 0 and 1');' ; 'else k = > n*r;'; > > > 'if k-floor(k) ~= 0 p = xx(round(n*r));'; 'else p = > > > (xx(k)+xx(k+1))/2;'; 'end' ])"); > > > Probably the same issue as before. > > > > > > > I would like to end with a general question. Each of the above > methods > > > > takes some effort. > > > > If the function definition is long, then the effort needed to > convert > > > > into Java code can be > > > > substantial. Is there a simple method? > > > Yep, load the function from a file. > > > > > > Sylvestre > > > > > > From main at zewaren.net Sat Jun 20 21:53:52 2009 From: main at zewaren.net (ZeWaren / Erwan Martin) Date: Sat, 20 Jun 2009 21:53:52 +0200 Subject: How to get a script's directory Message-ID: <4A3D3E50.6020304@zewaren.net> Hi, I'm writing scilab scripts (.sci files) on a daily basic. Theses scripts need to access some files around them, typically graphs. How can I get the location of the script in a variable, so that I can do something like this?: cpath=get_script_path(); graph=load_graph(cpath+'some_graph.graph'); I need to be able to execute my scripts on different computers in different places on different operating systems. I know that I can get scilab's current working directory using pwd() and change it using cd(...), but this doesn't solve my problem. Thanks for any response. -- Erwan MARTIN / ZeWaren ---------------------------------------------------- IRL: ARPEJ Lgt 453G, 1360 rte de Ste Anne, 29280 PLOUZANE, FRANCE tel: +33(0)9.51.66.58.34 cell: +33(0)6.32.01.15.01 80: http://zewaren.net 25: public at fzwte.net 5222: zewaren at rezid.org 1863: main at fzwte.net ---------------------------------------------------- From Dan_Gill at mksinst.com Sat Jun 20 22:00:47 2009 From: Dan_Gill at mksinst.com (Dan_Gill at mksinst.com) Date: Sat, 20 Jun 2009 16:00:47 -0400 Subject: Dan Gill/US/MKS is out of the office. Message-ID: I will be out of the office starting 06/19/2009 and will not return until 06/29/2009. I will respond to your message when I return. From calixte.denizet at ac-rennes.fr Sat Jun 20 23:50:28 2009 From: calixte.denizet at ac-rennes.fr (Calixte Denizet) Date: Sat, 20 Jun 2009 23:50:28 +0200 Subject: [scilab-Users] How to get a script's directory In-Reply-To: <4A3D3E50.6020304@zewaren.net> References: <4A3D3E50.6020304@zewaren.net> Message-ID: <1245534628.26937.2.camel@debian> Hi, > How can I get the location of the script in a variable, so that I can do > something like this?: > cpath=get_script_path(); > graph=load_graph(cpath+'some_graph.graph'); Maybe cpath=get_absolute_file_path('myscript.sci') could be useful. Calixte From yann.collette at scilab.org Sun Jun 21 08:30:51 2009 From: yann.collette at scilab.org (Yann Collette) Date: Sun, 21 Jun 2009 08:30:51 +0200 Subject: [scilab-Users] How to get a script's directory In-Reply-To: <4A3D3E50.6020304@zewaren.net> References: <4A3D3E50.6020304@zewaren.net> Message-ID: <4A3DD39B.40707@scilab.org> ZeWaren / Erwan Martin a ?crit : > Hi, > I'm writing scilab scripts (.sci files) on a daily basic. > Theses scripts need to access some files around them, typically graphs. > > How can I get the location of the script in a variable, so that I can > do something like this?: > cpath=get_script_path(); > graph=load_graph(cpath+'some_graph.graph'); > I need to be able to execute my scripts on different computers in > different places on different operating systems. > I know that I can get scilab's current working directory using pwd() > and change it using cd(...), but this doesn't solve my problem. > > Thanks for any response. > Try path = get_absolute_file_path(('your_script_name.sci'); YC From main at zewaren.net Sun Jun 21 12:57:03 2009 From: main at zewaren.net (ZeWaren / Erwan Martin) Date: Sun, 21 Jun 2009 12:57:03 +0200 Subject: [scilab-Users] How to get a script's directory In-Reply-To: <1245534628.26937.2.camel@debian> References: <4A3D3E50.6020304@zewaren.net> <1245534628.26937.2.camel@debian> Message-ID: <4A3E11FF.1080402@zewaren.net> This is what I was looking for. Thank you. This function should be added to the "See Also" section of the command "pwd". That way I would have found it on my own without having to bother you on this list. Calixte Denizet wrote: > Hi, > > >> How can I get the location of the script in a variable, so that I can do >> something like this?: >> cpath=get_script_path(); >> graph=load_graph(cpath+'some_graph.graph'); >> > > Maybe cpath=get_absolute_file_path('myscript.sci') could be useful. > > Calixte > > -- Erwan MARTIN / ZeWaren ---------------------------------------------------- IRL: ARPEJ Lgt 453G, 1360 rte de Ste Anne, 29280 PLOUZANE, FRANCE tel: +33(0)9.51.66.58.34 cell: +33(0)6.32.01.15.01 80: http://zewaren.net 25: public at fzwte.net 5222: zewaren at rezid.org 1863: main at fzwte.net ---------------------------------------------------- From mikeoki.oki at googlemail.com Mon Jun 22 16:52:31 2009 From: mikeoki.oki at googlemail.com (Michael Oki) Date: Mon, 22 Jun 2009 15:52:31 +0100 Subject: FUZZY LOGIC TOOLBOX Message-ID: <2dcc658d0906220752p27eb63ffh7d34707dd87b0d3@mail.gmail.com> Dear editor, I have just installed SCILAB 5.1.1 but I couldn't find any toolbox, how can I get a fuzzy logic toolbox, I saw a console on the homepage, against the SCILAB browser window. Pls help I'm using Windows Vista Basic. From Francis.Drossaert at pgs.com Mon Jun 22 17:32:24 2009 From: Francis.Drossaert at pgs.com (Francis Drossaert) Date: Mon, 22 Jun 2009 16:32:24 +0100 Subject: [scilab-Users] FUZZY LOGIC TOOLBOX In-Reply-To: <2dcc658d0906220752p27eb63ffh7d34707dd87b0d3@mail.gmail.com> References: <2dcc658d0906220752p27eb63ffh7d34707dd87b0d3@mail.gmail.com> Message-ID: <6D1269A4C2D21240807B91421B1872550922B8BE@lonms21.onshore.pgs.com> You can download toolboxes including some fuzzy ones from here: http://www.scilab.org/contrib/index_contrib.php?page=download -----Original Message----- From: Michael Oki [mailto:mikeoki.oki at googlemail.com] Sent: 22 June 2009 15:53 To: users at lists.scilab.org Subject: [scilab-Users] FUZZY LOGIC TOOLBOX Dear editor, I have just installed SCILAB 5.1.1 but I couldn't find any toolbox, how can I get a fuzzy logic toolbox, I saw a console on the homepage, against the SCILAB browser window. Pls help I'm using Windows Vista Basic. This e-mail, any attachments and response string may contain proprietary information, which are confidential and may be legally privileged. It is for the intended recipient only and if you are not the intended recipient or transmission error has misdirected this e-mail, please notify the author by return e-mail and delete this message and any attachment immediately. If you are not the intended recipient you must not use, disclose, distribute, forward, copy, print or rely in this e-mail in any way except as permitted by the author. From michael.baudin at scilab.org Tue Jun 23 09:10:23 2009 From: michael.baudin at scilab.org (=?UTF-8?B?TWljaGHDq2wgQmF1ZGlu?=) Date: Tue, 23 Jun 2009 09:10:23 +0200 Subject: [scilab-Users] analogy for Matlab fminunc function In-Reply-To: <4A37C35A.8040909@utc.fr> References: <20090616175306.9d1678c2.vaborg@gmail.com> <4A37C35A.8040909@utc.fr> Message-ID: <4A407FDF.5060608@scilab.org> Hi, It is true that the optim command is designed to provide the same feature. But notice that there are some differences in the numerical algorithms used in fminunc and in optim. The following is a list of the most important differences between the two algorithms. * The optim function manages also bound constraints, while fminunc does not (it is provided by fmincon in Matlab). * The optim function manages also nonsmooth functions (with the "nd" option), while fminunc does not. * The fminunc function manages the sparsity structure of the Hessian, while optim does not. * The fminunc function provides a LargeScale option, where optim provides two distinct algorithms - "qn" for small to medium scale problems, - "gc" for medium to large scale problems. * The fminunc function provides BFGS, DFP and steepest descent methods while optim is based only on the BFGS formula (both in qn and in gc). Notice that the BFGS is known as a better formula over DFP (steepest descent is not recommended for practical problems). * The medium-scale algorithm in fminunc is based on the update of the Hessian matrix with BFGS and on the update of the inverse Hessian matrix with DFP. In optim, the "qn" algorithm is based on the update of the Cholesky factors of the Hessian matrix updated with the BFGS formula. * The large-scale algorithm in fminunc is based on a trust-region algorithm, while the "gc" algorithm in optim is based on a line-search with cubic interpolation. Do you try to translate an existing Matlab script or is it for a fresh development ? Best regards, Micha?l Baudin From vaborg at gmail.com Wed Jun 24 17:18:59 2009 From: vaborg at gmail.com (Ivan Maximov) Date: Wed, 24 Jun 2009 17:18:59 +0200 Subject: using optim function in different versions of Scilab Message-ID: <20090624171859.0dfa9707.vaborg@gmail.com> Hi everyone! I have a question what is confusing me. I use Scilab 4.1.2 under Linux (Fedora 10) and try to set up a optim function in the code below - but always get an error message. However, in Scilab 5.1.1 it works without any messages (the question does it work properly is still open). Could someone, please, explain for me what is a problem in optim application in my code? Thanks a lot in advance. Ivan //----------------------------------------------------------------------------------------------- funcprot(0); function [y1,y2,y3,y4]=prop(x1,x2,x3,x4,ix,iy,sx,sy,dt,A,U,B,PROP,l1) y1 = x1; y2 = x2; y3 = x3; y4 = x4; N=length(x1)+1; for j=2:N HAMo = rand(4,4); B=rand(4,4); U=rand(4,4); function [yN]=fun(x) yN= -(2*real(trace(((expm(-%i*dt*HAMo)'*expm(-%i*dt*(x(1)*ix+x(2)*iy+x (3)*sx+x(4)*sy))- eye(4,4))*A*U*B*A') ))-dt*l1*((x(1)-x1(j-1)).* (x(1)+x1 (j-1)) +(x(2)-x2(j-1)).*(x(2)+x2(j-1))+(x(3)-x3(j-1)).* (x(3)+x3 (j-1)) +(x(4)-x4 (j-1)).* (x(4)+x4(j-1)))); endfunction function [d_yN] =d_fun(x) d_yN=derivative (fun,x); endfunction function [yN,grd,ind]=f(x,ind) yN=fun(x); grd=d_fun(x); endfunction x0= [x1(j-1);x2(j-1);x3(j-1);x4(j-1)]; printf("BEFORE: %f\n",fun(x0)); [fopt,xN]=optim(f,x0); printf("AFTER: %f\n",fun(xN)); y1(j-1) = xN(1); y2(j-1) = xN(2); y3(j-1) = xN(3); y4(j-1) = xN(4); end endfunction x_pauli=[0,0.5;0.5,0]; y_pauli=[0,-0.5*%i;0.5*%i,0]; z_pauli=[0.5,0;0,-0.5]; u_pauli=[1,0;0,1]; J = 140; T = 1/J; N=10; NIT=5; dt=T/N; rf = 100; l1 = 1e-4; //--------------------------------------------------------------------------- ix = x_pauli.*.u_pauli; iy = y_pauli.*.u_pauli; iz = z_pauli.*.u_pauli; sx = u_pauli.*.x_pauli; sy = u_pauli.*.y_pauli; sz = u_pauli.*.z_pauli; //--------------------------------------------------------------------------- Hamilt=2*%pi*J*sz*iz; A=expm(-%i*0.5*dt*Hamilt); U = rand(4,4); B = rand(4,4); PROP=rand(4,4); //--------------------------------------------------------------------------- u1 = rf*rand(1,N-1); u2 = rf*rand(1,N-1); u3 = rf*rand(1,N-1); u4 = rf*rand(1,N-1); [y1,y2,y3,y4]=prop(u1,u2,u3,u4,ix,iy,sx,sy,dt,A,U,B,PROP,l1); From yann.collette at scilab.org Thu Jun 25 10:38:35 2009 From: yann.collette at scilab.org (Yann Collette) Date: Thu, 25 Jun 2009 10:38:35 +0200 Subject: [scilab-Users] using optim function in different versions of Scilab In-Reply-To: <20090624171859.0dfa9707.vaborg@gmail.com> References: <20090624171859.0dfa9707.vaborg@gmail.com> Message-ID: <4A43378B.3000907@scilab.org> Hello, I tested your script and the only problem I saw was: function [yN]=fun(x) yN= -(2*real(trace(((expm(-%i*dt*HAMo)'*expm(-%i*dt*(x(1)*ix+x(2)*iy+x (3)*sx+x(4)*sy))- eye(4,4))*A*U*B*A') ))-dt*l1*((x(1)-x1(j-1)).* (x(1)+x1 (j-1)) +(x(2)-x2(j-1)).*(x(2)+x2(j-1))+(x(3)-x3(j-1)).* (x(3)+x3 (j-1)) +(x(4)-x4 (j-1)).* (x(4)+x4(j-1)))); endfunction Which has been changed into function [yN]=fun(x) yN= -(2*real(trace(((expm(-%i*dt*HAMo)'*expm(-%i*dt*(x(1)*ix+x(2)*iy+x ... (3)*sx+x(4)*sy))- eye(4,4))*A*U*B*A') ))-dt*l1*((x(1)-x1(j-1)).* ... (x(1)+x1 (j-1)) +(x(2)-x2(j-1)).*(x(2)+x2(j-1))+(x(3)-x3(j-1)).* ... (x(3)+x3 (j-1)) +(x(4)-x4 (j-1)).* (x(4)+x4(j-1)))); endfunction There was no warning under scilab master, but I don't know was is the good result: -->exec prop.sce; BEFORE: 0.061004 AFTER: -0.345703 BEFORE: -0.011493 AFTER: -0.476168 BEFORE: -0.045253 AFTER: -0.350020 BEFORE: -0.028446 AFTER: -0.436120 BEFORE: 0.020816 AFTER: -0.116581 BEFORE: -0.051276 AFTER: -0.532219 BEFORE: -0.007288 AFTER: -0.149870 BEFORE: 0.076331 AFTER: -0.340303 BEFORE: 0.016214 AFTER: -0.676543 YC Ivan Maximov a ?crit : > Hi everyone! > > I have a question what is confusing me. I use Scilab 4.1.2 under Linux (Fedora > 10) and try to set up a optim function in the code below - but always get an > error message. However, in Scilab 5.1.1 it works without any messages (the > question does it work properly is still open). Could someone, please, explain > for me what is a problem in optim application in my code? > > Thanks a lot in advance. > Ivan > > //----------------------------------------------------------------------------------------------- > funcprot(0); > > function [y1,y2,y3,y4]=prop(x1,x2,x3,x4,ix,iy,sx,sy,dt,A,U,B,PROP,l1) > > y1 = x1; > y2 = x2; > y3 = x3; > y4 = x4; > > N=length(x1)+1; > > for j=2:N > > HAMo = rand(4,4); > B=rand(4,4); > U=rand(4,4); > > function [yN]=fun(x) > yN= -(2*real(trace(((expm(-%i*dt*HAMo)'*expm(-%i*dt*(x(1)*ix+x(2)*iy+x > (3)*sx+x(4)*sy))- eye(4,4))*A*U*B*A') ))-dt*l1*((x(1)-x1(j-1)).* > (x(1)+x1 (j-1)) +(x(2)-x2(j-1)).*(x(2)+x2(j-1))+(x(3)-x3(j-1)).* > (x(3)+x3 (j-1)) +(x(4)-x4 (j-1)).* (x(4)+x4(j-1)))); > endfunction > function [d_yN] =d_fun(x) > d_yN=derivative (fun,x); > endfunction > > function [yN,grd,ind]=f(x,ind) > yN=fun(x); > grd=d_fun(x); > endfunction > > x0= [x1(j-1);x2(j-1);x3(j-1);x4(j-1)]; > printf("BEFORE: %f\n",fun(x0)); > [fopt,xN]=optim(f,x0); > printf("AFTER: %f\n",fun(xN)); > y1(j-1) = xN(1); > y2(j-1) = xN(2); > y3(j-1) = xN(3); > y4(j-1) = xN(4); > > end > > endfunction > > x_pauli=[0,0.5;0.5,0]; > y_pauli=[0,-0.5*%i;0.5*%i,0]; > z_pauli=[0.5,0;0,-0.5]; > u_pauli=[1,0;0,1]; > > J = 140; > T = 1/J; N=10; NIT=5; > dt=T/N; > rf = 100; > l1 = 1e-4; > > //--------------------------------------------------------------------------- > ix = x_pauli.*.u_pauli; iy = y_pauli.*.u_pauli; iz = z_pauli.*.u_pauli; > sx = u_pauli.*.x_pauli; sy = u_pauli.*.y_pauli; sz = u_pauli.*.z_pauli; > //--------------------------------------------------------------------------- > Hamilt=2*%pi*J*sz*iz; > A=expm(-%i*0.5*dt*Hamilt); > > U = rand(4,4); > B = rand(4,4); > PROP=rand(4,4); > //--------------------------------------------------------------------------- > u1 = rf*rand(1,N-1); u2 = rf*rand(1,N-1); > u3 = rf*rand(1,N-1); u4 = rf*rand(1,N-1); > > [y1,y2,y3,y4]=prop(u1,u2,u3,u4,ix,iy,sx,sy,dt,A,U,B,PROP,l1); > > From michael.baudin at scilab.org Thu Jun 25 10:39:52 2009 From: michael.baudin at scilab.org (=?ISO-8859-1?Q?Micha=EBl_Baudin?=) Date: Thu, 25 Jun 2009 10:39:52 +0200 Subject: [scilab-Users] using optim function in different versions of Scilab In-Reply-To: <20090624171859.0dfa9707.vaborg@gmail.com> References: <20090624171859.0dfa9707.vaborg@gmail.com> Message-ID: <4A4337D8.6070607@scilab.org> Dear Ivan, Thank you for providing that bug report. You probably have the same problem that was associated with bug 3985: http://bugzilla.scilab.org/show_bug.cgi?id=3985 I confirm that the results are not the same, on Windows, with Scilab 4.1.2 and Scilab 5.1.1. (see in PS my results). The rand function produces the same sequence of random numbers everytime Scilab is started. This is because the seed of the algorithm is constant and hard coded in the source code so that the sequence has the same initial point everytime Scilab is started. But it is complicated to tests scripts which are based on randomized inputs. The situation is made more simple when constant matrices are given in the test scripts (even if these matrices have been computed from the rand function): think about it the next time you have these kind of problems, it will make your debug process easier. Even if you are performing a probability analysis of course, separating the sources of problems is often a good idea. I tried various version of your script (see in attachment). * The first thing that I tried was to initialize the seed of the random number generator to the same zero value: I got the same results on both versions of Scilab. * I also tried to set constant random matrices instead of using the rand function, which makes the script easier to debug. Again, I found the same results with both versions of Scilab. * I analysed the numerical issues of this unconstrained optimization problem. From the test-modified3.sce script, you will see that I computed the Hessian matrix at optimum with the following commands [J,H] = derivative (fun,xopt,H_form="blockmat") spec(H) cond(H) The condition number of the Hessian matrix is approximately 5 so that the conditionning of the problem is not very high: the problem is well conditionned. All the eigenvalues are positive, which prooves that the Hessian matrix is positive definite at optimum. The gradient is approximately 1.d-9., which is probably the best you can get with an order 2 formula. The norm of the gradient has reduced from 6 orders of magnitude, since the gradient at x0 is approximately 1.e-3. * The final experiment I made was to increase the order of the numerical difference used in derivative (see in test-order4). The results on both Scilab version are the same. My conclusion is that the numerical derivatives with an order 2 formula are generating differences in the behaviour of the algorithm. These differences are fixed if an order 4 formula is used. The rand function cannot be the cause of the differences, since the sequence is always the same. The cause cannot be the extended precision issue, which is creating differences between Linux and Windows of Scilab 4.1.2 to Scilab 5.x: here the problem appears on Windows, with different versions of Scilab. The cause cannot be a modification of the source code of Scilab, since none of the functions which are implied in this case have been modified between Scilab 4.1.2 and Scilab 5.1.1: some interfaces and architecture have changed, but not the numerical methods connected in Scilab. The cause may be the compilation process of Scilab, which may cause differences in the order of the execution of the instructions. Notice that, if you perform complicated statistics computations, I recommend that you use the grand instead of rand. The rand function should behave smoothly if the central behaviour is to analyse. But, if you analyse rare events, the grand random number generators are far better, mainly because they are associated with much larger cycles (their statistical properties is also better). Best regards, Micha?l Baudin PS Windows, Scilab 5.1.1: BEFORE: 0.061004 AFTER: -0.345703 BEFORE: -0.011493 AFTER: -0.476168 BEFORE: -0.045253 AFTER: -0.350020 BEFORE: -0.028446 AFTER: -0.436120 BEFORE: 0.020816 AFTER: -0.116581 BEFORE: -0.051276 AFTER: -0.532219 BEFORE: -0.007288 AFTER: -0.149870 BEFORE: 0.076331 AFTER: -0.340303 BEFORE: 0.016214 AFTER: -0.676543 Windows, Scilab 4.1.2 BEFORE: -0.004118 AFTER: -0.013940 BEFORE: 0.031497 AFTER: -0.031452 BEFORE: 0.006074 AFTER: -0.044554 BEFORE: -0.004575 AFTER: -0.132000 BEFORE: 0.058924 AFTER: -0.268444 BEFORE: 0.008280 AFTER: -0.066517 BEFORE: -0.008389 AFTER: -0.341465 BEFORE: 0.068112 AFTER: -1.044189 BEFORE: -0.059928 AFTER: -0.290209 -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: test-order4.sce URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: test-modified3.sce URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: test-modified.sce URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: test-modified2.sce URL: From michael.baudin at scilab.org Thu Jun 25 11:54:02 2009 From: michael.baudin at scilab.org (=?ISO-8859-1?Q?Micha=EBl_Baudin?=) Date: Thu, 25 Jun 2009 11:54:02 +0200 Subject: [scilab-Users] using optim function in different versions of Scilab In-Reply-To: <4A4337D8.6070607@scilab.org> References: <20090624171859.0dfa9707.vaborg@gmail.com> <4A4337D8.6070607@scilab.org> Message-ID: <4A43493A.7040407@scilab.org> Dear Ivan, Sorry for my verbose message, but I did a mistake when running your test script. Because of the call to the rand function, I analysed the result of the script after running the script twice instead of one. The conclusion is that, under Windows, the result is the same for Scilab 4.1.2 and 5.1.1. What is your error message ? Does the order 4 formula fixes the problem ? Best regards, Micha?l Baudin From michael.baudin at scilab.org Thu Jun 25 13:20:22 2009 From: michael.baudin at scilab.org (Michael BAUDIN) Date: Thu, 25 Jun 2009 13:20:22 +0200 Subject: [scilab-Users] using optim function in different versions of Scilab In-Reply-To: <4A43493A.7040407@scilab.org> References: <20090624171859.0dfa9707.vaborg@gmail.com> <4A4337D8.6070607@scilab.org> <4A43493A.7040407@scilab.org> Message-ID: <4A435D76.3050908@scilab.org> It seems that there is a bug with the trace function with Scilab 4.1.2. -->[y1,y2,y3,y4]=prop(u1,u2,u3,u4,ix,iy,sx,sy,dt,A,U,B,PROP,l1); !--error 4 undefined variable : trace at line 2 of function fun called by : line 12 of function prop called by : [y1,y2,y3,y4]=prop(u1,u2,u3,u4,ix,iy,sx,sy,dt,A,U,B,PROP,l1); The problem is solved for Scilab 5.1.1 Best regards, Michal Baudin From vaborg at gmail.com Thu Jun 25 16:37:24 2009 From: vaborg at gmail.com (Ivan Maximov) Date: Thu, 25 Jun 2009 16:37:24 +0200 Subject: [scilab-Users] using optim function in different versions of Scilab Message-ID: <20090625163724.b58e7c2b.vaborg@gmail.com> Hi guys, thanks a lot for the time which you spent for the solution. Sorry that I missed original error message. My message in Scilab 4.1.2 is: !--error 4 undefined variable : grd at line 4 of function f called by : line 30 of function prop called by : [y1,y2,y3,y4]=prop(u1,u2,u3,u4,ix,iy,sx,sy,dt,A,U,B,PROP,l1); line 65 of exec file called by : exec("/home/vaborg/scilab/test/optim_question.sce"); in execstr instruction called by : and I thought that you all get the same message as well. The last Michal post is much close to my error I guess. The problem in 5.1.1 there is no debuger. And it it difficult to control a process. Do you have any idea what to do in 4.1.2? thanks a lot in advance. --------- best regards, Ivan From rsenthil_signalprocess at in.com Mon Jun 29 02:50:14 2009 From: rsenthil_signalprocess at in.com (Rajarathanam Senthilkumar) Date: Mon, 29 Jun 2009 06:20:14 +0530 Subject: =?UTF-8?B?UmVxdWlzaXRpb24gZm9yIGZyZWUgQ0QncyB3aXRoIFNjaWxhYiBsb2dvLSByZWc=?= Message-ID: <1246236614.4e38d30e656da5ae9d3a425109ce9e04@mail.in.com> Dear sir/madamI and My students are regular users of Scilab 5. Our Institution uses Scilab for teaching (1)Digital Signal Processing Lab and (2)Signals and systems Lab.We are going to condcut a "Two Days Workshop on Open Source Signal Processing Softwares". The engineering colleges in and around our college are not aware of Scilab 5.I already downloaded your software and used it in My Digital Signal Processing Lab.?What I need is,? in order to Make Scilab 5 more popular in INDIA ?I need Scilab 5 software in CD format with your Scilab 5 logo.Total Number of Participants : ?30Enclosure: Workshop Brochure in PDF formatAddress for communication:R.SENTHILKUMAR,LECTURER,DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING,INSTITUTE OF ROAD AND TRANSPORT TECHNOLOGY,172/A3, KAMARAJ NAGAR,SRI SANGAMESWARA NURSERY SCHOOL STREET,BHAVANI 638301.TAMILNADU, INDIA.MOBILE NUMBER: 91 9940882605Dear users! Get Yourself a cool, short @in.com Email ID now! -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Workshop_On_OpenSource.pdf Type: application/pdf Size: 129992 bytes Desc: not available URL: From jochen.kaempf at flinders.edu.au Tue Jun 30 04:09:53 2009 From: jochen.kaempf at flinders.edu.au (Jochen Kaempf) Date: Tue, 30 Jun 2009 11:39:53 +0930 Subject: xs2gif problems when using pixmap Message-ID: <4A4973F1.7010905@flinders.edu.au> Hi there In simple animations using the pixmap buffer, xs2gif (or any other conversion) produces only empty picture frames with version 5.1.1. It worked in version 4 on Windows NT. Now I use Vista but I am aware of Scilab changes from versions 4 to 5 (e.g. xset is obsolete). I still have some xset commands in my scripts, but I am not sure whether this the the problem. Can any one out there help? Best wishes, Jochen -- Dr Jochen Kaempf Senior Lecturer of Oceanography SoCPES (School of Chemistry, Physics and Earth Sciences) Room 312, Earth Sciences Building Flinders University GPO Box 2100, Adelaide, SA 5001, Australia Phone: +61-8-8201-2214 Fax: +61-8-8201-2676 Email: Jochen.Kaempf at flinders.edu.au Web: http://www.scieng.flinders.edu.au/cpes/people/kaempf_j/index.html From teresitafranco at alice.it Tue Jun 30 18:07:15 2009 From: teresitafranco at alice.it (Franco Graziano) Date: Tue, 30 Jun 2009 18:07:15 +0200 Subject: [scilab-Users] xs2gif problems when using pixmap References: <4A4973F1.7010905@flinders.edu.au> Message-ID: <3778ADD5276E4D32B8FC807648A3FDC9@Graziano> Hi, i had similar problems, solved setting pixmap "off" before saving graphic file f= figure() f.pixmap = 'on' ... drawing graph ... f.pixmap = 'off' xs2gif(f.figure_id,GraphFileName) f.pixmap = 'on' please let me know what happens regards Franco Graziano via Radini Tedeschi, 24D/18 24120 Bergamo - Italy teresitafranco at alice.it