From arctica1963 at gmail.com Thu Jun 2 10:17:59 2022 From: arctica1963 at gmail.com (Lester Anderson) Date: Thu, 2 Jun 2022 09:17:59 +0100 Subject: [Scilab-users] Extract closest value Message-ID: Hi all, Is it possible to use one vector to find only those closest values in another vector with a tolerance limit? A=[2 3 4 5 6]; // source array B=[0.25 1.2 2.01 5.2 7.4 9.3 10.6 ]; // target array to find closest values to A So in the example above, the closest values would be 2.01 and 5.2 in B, all other values excluded. Arrays are not going to be the same size! Hopefully I have explained it well enough. Thanks Lester -------------- next part -------------- An HTML attachment was scrubbed... URL: From arctica1963 at gmail.com Thu Jun 2 12:53:30 2022 From: arctica1963 at gmail.com (Lester Anderson) Date: Thu, 2 Jun 2022 11:53:30 +0100 Subject: [Scilab-users] Extract closest value In-Reply-To: <0560024b-e8de-25e2-841b-b81d179418b9@laposte.net> References: <0560024b-e8de-25e2-841b-b81d179418b9@laposte.net> Message-ID: Hi Serge, Thanks for the suggestion. I did find another method that also works via a for-loop: e.g. x=[1 2 3 4 5];y=[0 1.1 1.5 1.6 2.4 4.1 4.7 5 5.7];for k=1:length(x) [val,idx]=min(abs(y-x(k))); xx(k)=y(idx);end Lester On Thu, 2 Jun 2022 at 11:37, Steer Serge wrote: > If A and B are not too big you can proceed as follow: > E=abs(ones(B')*A-B'*ones(A)) > > [i,j]=ind2sub(find(E<=0.3),size(E)); > Serge > > Le 02/06/2022 ? 10:17, Lester Anderson a ?crit : > > Hi all, > > Is it possible to use one vector to find only those closest values in > another vector with a tolerance limit? > > A=[2 3 4 5 6]; // source array > B=[0.25 1.2 2.01 5.2 7.4 9.3 10.6 ]; // target array to find closest > values to A > > So in the example above, the closest values would be 2.01 and 5.2 in B, > all other values excluded. Arrays are not going to be the same size! > Hopefully I have explained it well enough. > > Thanks > Lester > > > _______________________________________________ > users mailing listusers at lists.scilab.orghttp://lists.scilab.org/mailman/listinfo/users > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From denis.crete at thalesgroup.com Tue Jun 7 11:08:56 2022 From: denis.crete at thalesgroup.com (CRETE Denis) Date: Tue, 7 Jun 2022 09:08:56 +0000 Subject: [Scilab-users] Graphics: Highlighted Entity Message-ID: <43233285f3404fd3ac7138e9c00b0f0a@thalesgroup.com> Hello, In several occasions, I considered that it would be useful to get a handle on a highlighted entity. Does a function which might be called ?get_hilited_entity? exist ? I did not find either in the properties of basic entities like ?Polyline? something related to the highlighted state of a polyline? Thank you in advance for any help, Denis -------------- next part -------------- An HTML attachment was scrubbed... URL: From denis.crete at thalesgroup.com Tue Jun 7 11:39:28 2022 From: denis.crete at thalesgroup.com (CRETE Denis) Date: Tue, 7 Jun 2022 09:39:28 +0000 Subject: [Scilab-users] Graphics: Current figure and current entity Message-ID: Hello, I have several graphic windows and in some of them, there are several ?Axes? (and several curves for each ?Axes?). I can?t find in ?Scilab Help? if the ?current axes? is always in the hierarchy of the ?current entity?, and similarly if the ?current figure? is always in the hierarchy of the ?current axes?. If this was true, I suggest to mention it in the ?Graphics Entities? section. If not, is there a simple way to obtain the handle of the figure where the ?current entity? is ? I tried the following, which seems to work : G_f=gce().parent; while get(G_f,?type?)~=?Figure?, G_f= G_f.parent; end; Did I reinvent the wheel ?-) Thank you in advance Denis -------------- next part -------------- An HTML attachment was scrubbed... URL: From Clement.David at esi-group.com Tue Jun 7 12:54:08 2022 From: Clement.David at esi-group.com (=?utf-8?B?Q2zDqW1lbnQgRGF2aWQ=?=) Date: Tue, 7 Jun 2022 10:54:08 +0000 Subject: [Scilab-users] Graphics: Current figure and current entity In-Reply-To: References: Message-ID: Hello Denis, I don?t think Scilab provide a function to retrieve the parent figure of an entity ; could you open a bug with this wish ? Note: internally, there is already a non-iterative O(1) way to retrieve it. Regards, Cl?ment From: users On Behalf Of CRETE Denis Sent: Tuesday, June 7, 2022 11:39 AM To: Users mailing list for Scilab Subject: [Scilab-users] Graphics: Current figure and current entity Hello, I have several graphic windows and in some of them, there are several ?Axes? (and several curves for each ?Axes?). I can?t find in ?Scilab Help? if the ?current axes? is always in the hierarchy of the ?current entity?, and similarly if the ?current figure? is always in the hierarchy of the ?current axes?. If this was true, I suggest to mention it in the ?Graphics Entities? section. If not, is there a simple way to obtain the handle of the figure where the ?current entity? is ? I tried the following, which seems to work : G_f=gce().parent; while get(G_f,?type?)~=?Figure?, G_f= G_f.parent; end; Did I reinvent the wheel ?-) Thank you in advance Denis -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephane.mottelet at utc.fr Tue Jun 7 15:56:48 2022 From: stephane.mottelet at utc.fr (=?UTF-8?Q?St=c3=a9phane_Mottelet?=) Date: Tue, 7 Jun 2022 15:56:48 +0200 Subject: [Scilab-users] Native file and directory chooser under macOS Message-ID: <18368491-85ac-c701-99a6-435241ad438c@utc.fr> Hi, I think that macOS have been bothered by the Swing file/directory chooser since Java is used in Scilab. Under Windows or Linux these widgets are native (or almost native) and allow to simply select a disk, go to home directory, ... I have been working on this problem and found a solution which took some time to be applied to every places where it may be applicable (Scinotes, Xcos, graphical export, ...). You can experiment this new feature by downloading the new build, available at the usual macOS Scilab page: https://www.utc.fr/~mottelet/scilab/download/branch-6.1/scilab-branch-6.1-x86_64-nativeFileChooser.dmg Enjoy ! -- St?phane Mottelet Ing?nieur de recherche EA 4297 Transformations Int?gr?es de la Mati?re Renouvelable D?partement G?nie des Proc?d?s Industriels Sorbonne Universit?s - Universit? de Technologie de Compi?gne CS 60319, 60203 Compi?gne cedex Tel : +33(0)344234688 http://www.utc.fr/~mottelet From sgougeon at free.fr Tue Jun 7 21:06:31 2022 From: sgougeon at free.fr (Samuel Gougeon) Date: Tue, 7 Jun 2022 21:06:31 +0200 Subject: [Scilab-users] Graphics: Current figure and current entity In-Reply-To: References: Message-ID: <6bec8491-fd02-3f74-4fe6-3cccc3786a96@free.fr> Le 07/06/2022 ? 11:39, CRETE Denis a ?crit?: > > Hello, > > I have several graphic windows and in some of them, there are several > ?Axes? (and several curves for each ?Axes?). > > I can?t find in ?Scilab Help? if the ?current axes? is always in the > hierarchy of the ?current entity?, and similarly if the ?current > figure? is always in the hierarchy of the ?current axes?. > Good question. Let's test it : 1. sca(ax) sets the current figure to the one homing the ax axes: --> scf(0); plot(1:10); e0 = gce(); ax0 = gca(); --> scf(1); plot(1:10); e1 = gce(); ax1 = gca(); --> sca(ax0); --> gcf().figure_id ?ans? = ?? 0. --> sca(ax1); --> gcf().figure_id ?ans? = ?? 1. 2. set("current_entity", h) does NOT set the current figure to the one homing the targeted entity: --> scf(0); plot(1:10); e0 = gce(); ax0 = gca(); --> scf(1); plot(1:10); e1 = gce(); ax1 = gca(); --> set("current_entity", e0); --> gcf().figure_id ?ans? = ?? 1. --> gca().parent.figure_id ?ans? = ?? 1. So now we can answer to your questions: > I can?t find in ?Scilab Help? if the ?current axes? is always in the > hierarchy of the ?current entity?, Almost never. > and similarly if the ?current figure? is always in the hierarchy of > the ?current axes?. Yes it is. > If this was true, I suggest to mention it in the ?Graphics Entities? > section. > Right, the sca() and set() pages could be clarified about this. > If not, is there a simple way to obtain the handle of the figure where > the ?current entity? is ? > I tried the following, which seems to work : > > G_f = gce().parent; > > while get(G_f,?type?)~=?Figure?, > > ????????? G_f =? G_f.parent; > > end; > Yes, in short: G_f = gce(); while G_f.type ~= ?Figure?, ? G_f =? G_f.parent; end that will work even when the initial G_f is already a figure. Samuel -------------- next part -------------- An HTML attachment was scrubbed... URL: From sgougeon at free.fr Tue Jun 7 21:18:31 2022 From: sgougeon at free.fr (Samuel Gougeon) Date: Tue, 7 Jun 2022 21:18:31 +0200 Subject: [Scilab-users] Graphics: Highlighted Entity In-Reply-To: <43233285f3404fd3ac7138e9c00b0f0a@thalesgroup.com> References: <43233285f3404fd3ac7138e9c00b0f0a@thalesgroup.com> Message-ID: Le 07/06/2022 ? 11:08, CRETE Denis a ?crit?: > > Hello, > > In several occasions, I considered that it would be useful to get a > handle on a highlighted entity. > > Does a function which might be called ?get_hilited_entity? exist ? I > did not find either in the properties of basic entities like > ?Polyline? something related to the highlighted state of a polyline? > It depends on what /highlighted/ means to you. There is the Scilab's meaning -- as the current axes or figure are the default targets for forthcoming plots -- ; and the java meaning -- as the elements that have the java focus, as when we click on a figure, or in an axes, on a curve, etc. Both meanings do not match: * just clicking an an axes does not make it as the new default target for plotting * making a figure or axes the active ones for Scilab does not move and put the mouse's pointer on them. For the Scilab meaning, gce() is made for your request. twinkle() helps a lot to visually identify the current active entity gce(). Regards -------------- next part -------------- An HTML attachment was scrubbed... URL: From denis.crete at thalesgroup.com Thu Jun 9 11:29:13 2022 From: denis.crete at thalesgroup.com (CRETE Denis) Date: Thu, 9 Jun 2022 09:29:13 +0000 Subject: [Scilab-users] Graphics: Highlighted Entity In-Reply-To: References: <43233285f3404fd3ac7138e9c00b0f0a@thalesgroup.com> Message-ID: <6bd9118d908c4d4da7d4dcaf0a40eaa3@thalesgroup.com> Thank you for your answer. Actually I was essentially interested in clicking on a polyline (or may be other graphic elements like Arcs, Rectangles, etc? rather than Axes), which makes it change its color (for grey in my Scilab 6.1.0 on Ubuntu 20.04). I understand that this concerns the java engine rather than the Scilab one. Once you have one such highlighted object, (and if this has been obtained in a ?pause? mode, after typing ?resume? on the console), I would like the subsequent code to identify which of the object has been highlighted by the click. Best regards Denis De : users De la part de Samuel Gougeon Envoy? : mardi 7 juin 2022 21:19 ? : users at lists.scilab.org Objet : Re: [Scilab-users] Graphics: Highlighted Entity Le 07/06/2022 ? 11:08, CRETE Denis a ?crit : Hello, In several occasions, I considered that it would be useful to get a handle on a highlighted entity. Does a function which might be called ?get_hilited_entity? exist ? I did not find either in the properties of basic entities like ?Polyline? something related to the highlighted state of a polyline? It depends on what highlighted means to you. There is the Scilab's meaning -- as the current axes or figure are the default targets for forthcoming plots -- ; and the java meaning -- as the elements that have the java focus, as when we click on a figure, or in an axes, on a curve, etc. Both meanings do not match: * just clicking an an axes does not make it as the new default target for plotting * making a figure or axes the active ones for Scilab does not move and put the mouse's pointer on them. For the Scilab meaning, gce() is made for your request. twinkle() helps a lot to visually identify the current active entity gce(). Regards -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephane.mottelet at utc.fr Tue Jun 14 17:28:53 2022 From: stephane.mottelet at utc.fr (=?UTF-8?Q?St=c3=a9phane_Mottelet?=) Date: Tue, 14 Jun 2022 17:28:53 +0200 Subject: [Scilab-users] Native file and directory chooser under macOS In-Reply-To: <18368491-85ac-c701-99a6-435241ad438c@utc.fr> References: <18368491-85ac-c701-99a6-435241ad438c@utc.fr> Message-ID: <079382f6-f8bf-377a-afa0-43c2abb54386@utc.fr> Hello, macOS Scilab users, did you all die from the COVID ? S. Le 07/06/2022 ? 15:56, St?phane Mottelet a ?crit?: > Hi, > > I think that macOS have been bothered by the Swing file/directory > chooser since Java is used in Scilab. Under Windows or Linux these > widgets are native (or almost native) and allow to simply select a > disk, go to home directory, ... I have been working on this problem > and found a solution which took some time to be applied to every > places where it may be applicable (Scinotes, Xcos, graphical export, > ...). You can experiment this new feature by downloading the new > build, available at the usual macOS Scilab page: > > https://www.utc.fr/~mottelet/scilab/download/branch-6.1/scilab-branch-6.1-x86_64-nativeFileChooser.dmg > > > Enjoy ! > -- St?phane Mottelet Ing?nieur de recherche EA 4297 Transformations Int?gr?es de la Mati?re Renouvelable D?partement G?nie des Proc?d?s Industriels Sorbonne Universit?s - Universit? de Technologie de Compi?gne CS 60319, 60203 Compi?gne cedex Tel : +33(0)344234688 http://www.utc.fr/~mottelet From heinznabielek at me.com Tue Jun 14 17:50:27 2022 From: heinznabielek at me.com (Heinz Nabielek) Date: Tue, 14 Jun 2022 17:50:27 +0200 Subject: [Scilab-users] Native file and directory chooser under macOS In-Reply-To: <079382f6-f8bf-377a-afa0-43c2abb54386@utc.fr> References: <18368491-85ac-c701-99a6-435241ad438c@utc.fr> <079382f6-f8bf-377a-afa0-43c2abb54386@utc.fr> Message-ID: I am using SciLab for mathematical modelling etc. every day and it is perfect as it is for me. Sometimes are help functions and explanations too complex for me (experimental physicist). Thanks to you all who work on further development. Heinz ______________ Dr Heinz Nabielek Sch?ttelstrasse 77A/11 A-1020 Wien, ?sterreich Tel +43 1 276 56 13 cell +43 677 616 349 22 heinznabielek at me.com > On 14.06.2022, at 17:28, St?phane Mottelet wrote: > > Hello, > > macOS Scilab users, did you all die from the COVID ? > > S. > > Le 07/06/2022 ? 15:56, St?phane Mottelet a ?crit : >> Hi, >> >> I think that macOS have been bothered by the Swing file/directory chooser since Java is used in Scilab. Under Windows or Linux these widgets are native (or almost native) and allow to simply select a disk, go to home directory, ... I have been working on this problem and found a solution which took some time to be applied to every places where it may be applicable (Scinotes, Xcos, graphical export, ...). You can experiment this new feature by downloading the new build, available at the usual macOS Scilab page: >> >> https://www.utc.fr/~mottelet/scilab/download/branch-6.1/scilab-branch-6.1-x86_64-nativeFileChooser.dmg >> >> Enjoy ! >> > -- > St?phane Mottelet > Ing?nieur de recherche > EA 4297 Transformations Int?gr?es de la Mati?re Renouvelable > D?partement G?nie des Proc?d?s Industriels > Sorbonne Universit?s - Universit? de Technologie de Compi?gne > CS 60319, 60203 Compi?gne cedex > Tel : +33(0)344234688 > http://www.utc.fr/~mottelet > > _______________________________________________ > users mailing list > users at lists.scilab.org > http://lists.scilab.org/mailman/listinfo/users From Jean-Yves.Baudais at insa-rennes.fr Thu Jun 16 10:38:14 2022 From: Jean-Yves.Baudais at insa-rennes.fr (Jean-Yves Baudais) Date: Thu, 16 Jun 2022 10:38:14 +0200 Subject: [Scilab-users] output buffer Message-ID: Hello, How can we manage the output buffer when we write to a file? It seems that this buffer size is 4096. Thanks, Jean-Yves From Jean-Yves.Baudais at insa-rennes.fr Thu Jun 16 10:39:45 2022 From: Jean-Yves.Baudais at insa-rennes.fr (Jean-Yves Baudais) Date: Thu, 16 Jun 2022 10:39:45 +0200 Subject: [Scilab-users] output buffer In-Reply-To: References: Message-ID: <08feaf60-91e8-fd81-8795-b95e4b684d99@insa-rennes.fr> How to manage *the size*. Sorry. Jean-Yves Le 16/06/2022 ? 10:38, Jean-Yves Baudais a ?crit?: > Hello, > > How can we manage the output buffer when we write to a file? It seems > that this buffer size is 4096. > > Thanks, > > Jean-Yves From heinznabielek at me.com Thu Jun 16 20:47:07 2022 From: heinznabielek at me.com (Heinz Nabielek) Date: Thu, 16 Jun 2022 20:47:07 +0200 Subject: [Scilab-users] Undefined variable: vers? Message-ID: Win10 Scilab does not run some Demonstrations. What happened? Heinz Startup execution: loading initial environment --> ver ans = column 1 "Scilab Version: " "Operating System: " "Java version: " "Java runtime information: " "Java Virtual Machine information: " "Vendor specification: " column 2 "6.1.1.1626343451" "Windows 10 10.0" "1.8.0_292" "OpenJDK Runtime Environment (build 1.8.0_292-b10)" "OpenJDK 64-Bit Server VM (build 25.292-b10, mixed mode)" "Oracle Corporation" at line 38 of function getVsWhereInformation ( C:\Program Files\scilab-6.1.1\modules\dynamic_link\macros\windows\getVsWhereInformation.sci line 38 ) at line 3 of function dlwIsVc141Express ( C:\Program Files\scilab-6.1.1\modules\dynamic_link\macros\windows\dlwIsVc141Express.sci line 16 ) at line 31 of function dlwFindMsVcCompiler ( C:\Program Files\scilab-6.1.1\modules\dynamic_link\macros\windows\dlwFindMsVcCompiler.sci line 45 ) at line 12 of function findmsvccompiler ( C:\Program Files\scilab-6.1.1\modules\dynamic_link\macros\findmsvccompiler.sci line 26 ) at line 2 of function dlwHaveCompiler ( C:\Program Files\scilab-6.1.1\modules\dynamic_link\macros\windows\dlwHaveCompiler.sci line 15 ) at line 7 of function haveacompiler ( C:\Program Files\scilab-6.1.1\modules\dynamic_link\macros\haveacompiler.sci line 20 ) at line 109 of function demo_pendulum ( C:\Program Files\scilab-6.1.1\modules\differential_equations\demos\n_pendulum\n_pendulum.sci line 117 ) at line 11 of executed file C:\Program Files\scilab-6.1.1\modules\differential_equations\demos\n_pendulum\n_pendulum.dem.sce Undefined variable: vers at line 38 of function getVsWhereInformation ( C:\Program Files\scilab-6.1.1\modules\dynamic_link\macros\windows\getVsWhereInformation.sci line 38 ) at line 3 of function dlwIsVc141Express ( C:\Program Files\scilab-6.1.1\modules\dynamic_link\macros\windows\dlwIsVc141Express.sci line 16 ) at line 31 of function dlwFindMsVcCompiler ( C:\Program Files\scilab-6.1.1\modules\dynamic_link\macros\windows\dlwFindMsVcCompiler.sci line 45 ) at line 12 of function findmsvccompiler ( C:\Program Files\scilab-6.1.1\modules\dynamic_link\macros\findmsvccompiler.sci line 26 ) at line 2 of function dlwHaveCompiler ( C:\Program Files\scilab-6.1.1\modules\dynamic_link\macros\windows\dlwHaveCompiler.sci line 15 ) at line 7 of function haveacompiler ( C:\Program Files\scilab-6.1.1\modules\dynamic_link\macros\haveacompiler.sci line 20 ) at line 10 of function demo_wheel2 ( C:\Program Files\scilab-6.1.1\modules\differential_equations\demos\wheel\wheel2.dem.sce line 18 ) at line 73 of executed file C:\Program Files\scilab-6.1.1\modules\differential_equations\demos\wheel\wheel2.dem.sce Undefined variable: vers From stephane.mottelet at utc.fr Fri Jun 17 08:39:46 2022 From: stephane.mottelet at utc.fr (=?UTF-8?Q?St=c3=a9phane_Mottelet?=) Date: Fri, 17 Jun 2022 08:39:46 +0200 Subject: [Scilab-users] Undefined variable: vers? In-Reply-To: References: Message-ID: <755dae08-a431-85ee-3cda-a438ef97c2a6@utc.fr> Hi Heinz, You need a compiler. Either Visual Studio or MinGW should do it. S. Le 16/06/2022 ? 20:47, Heinz Nabielek a ?crit?: > Win10 Scilab does not run some Demonstrations. > What happened? > Heinz > > > > Startup execution: > loading initial environment > > --> ver > ans = > > column 1 > > "Scilab Version: " > "Operating System: " > "Java version: " > "Java runtime information: " > "Java Virtual Machine information: " > "Vendor specification: " > > column 2 > > "6.1.1.1626343451" > "Windows 10 10.0" > "1.8.0_292" > "OpenJDK Runtime Environment (build 1.8.0_292-b10)" > "OpenJDK 64-Bit Server VM (build 25.292-b10, mixed mode)" > "Oracle Corporation" > at line 38 of function getVsWhereInformation ( C:\Program Files\scilab-6.1.1\modules\dynamic_link\macros\windows\getVsWhereInformation.sci line 38 ) > at line 3 of function dlwIsVc141Express ( C:\Program Files\scilab-6.1.1\modules\dynamic_link\macros\windows\dlwIsVc141Express.sci line 16 ) > at line 31 of function dlwFindMsVcCompiler ( C:\Program Files\scilab-6.1.1\modules\dynamic_link\macros\windows\dlwFindMsVcCompiler.sci line 45 ) > at line 12 of function findmsvccompiler ( C:\Program Files\scilab-6.1.1\modules\dynamic_link\macros\findmsvccompiler.sci line 26 ) > at line 2 of function dlwHaveCompiler ( C:\Program Files\scilab-6.1.1\modules\dynamic_link\macros\windows\dlwHaveCompiler.sci line 15 ) > at line 7 of function haveacompiler ( C:\Program Files\scilab-6.1.1\modules\dynamic_link\macros\haveacompiler.sci line 20 ) > at line 109 of function demo_pendulum ( C:\Program Files\scilab-6.1.1\modules\differential_equations\demos\n_pendulum\n_pendulum.sci line 117 ) > at line 11 of executed file C:\Program Files\scilab-6.1.1\modules\differential_equations\demos\n_pendulum\n_pendulum.dem.sce > > Undefined variable: vers > at line 38 of function getVsWhereInformation ( C:\Program Files\scilab-6.1.1\modules\dynamic_link\macros\windows\getVsWhereInformation.sci line 38 ) > at line 3 of function dlwIsVc141Express ( C:\Program Files\scilab-6.1.1\modules\dynamic_link\macros\windows\dlwIsVc141Express.sci line 16 ) > at line 31 of function dlwFindMsVcCompiler ( C:\Program Files\scilab-6.1.1\modules\dynamic_link\macros\windows\dlwFindMsVcCompiler.sci line 45 ) > at line 12 of function findmsvccompiler ( C:\Program Files\scilab-6.1.1\modules\dynamic_link\macros\findmsvccompiler.sci line 26 ) > at line 2 of function dlwHaveCompiler ( C:\Program Files\scilab-6.1.1\modules\dynamic_link\macros\windows\dlwHaveCompiler.sci line 15 ) > at line 7 of function haveacompiler ( C:\Program Files\scilab-6.1.1\modules\dynamic_link\macros\haveacompiler.sci line 20 ) > at line 10 of function demo_wheel2 ( C:\Program Files\scilab-6.1.1\modules\differential_equations\demos\wheel\wheel2.dem.sce line 18 ) > at line 73 of executed file C:\Program Files\scilab-6.1.1\modules\differential_equations\demos\wheel\wheel2.dem.sce > > Undefined variable: vers > _______________________________________________ > users mailing list > users at lists.scilab.org > http://lists.scilab.org/mailman/listinfo/users -- St?phane Mottelet Ing?nieur de recherche EA 4297 Transformations Int?gr?es de la Mati?re Renouvelable D?partement G?nie des Proc?d?s Industriels Sorbonne Universit?s - Universit? de Technologie de Compi?gne CS 60319, 60203 Compi?gne cedex Tel : +33(0)344234688 http://www.utc.fr/~mottelet From sgougeon at free.fr Fri Jun 17 14:29:36 2022 From: sgougeon at free.fr (Samuel Gougeon) Date: Fri, 17 Jun 2022 14:29:36 +0200 Subject: [Scilab-users] Undefined variable: vers? In-Reply-To: References: Message-ID: <14415062-a02b-31d8-fbd7-03e948205797@free.fr> Hello Heinz, The call stack shows that the error occurs when calling haveacompiler() to see if a compiler is installed, and then run the actual demo or skip it. If there is no compiler, haveacompiler() should return %F without yielding any error. So it's a bug. It is not yet reported on scilab's bugzilla. You may do it, and then provide the more information you can about the actual status of your computer in term of actually installed compiler(s). Samuel Le 16/06/2022 ? 20:47, Heinz Nabielek a ?crit?: > Win10 Scilab does not run some Demonstrations. > What happened? > Heinz > > > > Startup execution: > loading initial environment > > --> ver > ans = > > column 1 > > "Scilab Version: " > "Operating System: " > "Java version: " > "Java runtime information: " > "Java Virtual Machine information: " > "Vendor specification: " > > column 2 > > "6.1.1.1626343451" > "Windows 10 10.0" > "1.8.0_292" > "OpenJDK Runtime Environment (build 1.8.0_292-b10)" > "OpenJDK 64-Bit Server VM (build 25.292-b10, mixed mode)" > "Oracle Corporation" > at line 38 of function getVsWhereInformation ( C:\Program Files\scilab-6.1.1\modules\dynamic_link\macros\windows\getVsWhereInformation.sci line 38 ) > at line 3 of function dlwIsVc141Express ( C:\Program Files\scilab-6.1.1\modules\dynamic_link\macros\windows\dlwIsVc141Express.sci line 16 ) > at line 31 of function dlwFindMsVcCompiler ( C:\Program Files\scilab-6.1.1\modules\dynamic_link\macros\windows\dlwFindMsVcCompiler.sci line 45 ) > at line 12 of function findmsvccompiler ( C:\Program Files\scilab-6.1.1\modules\dynamic_link\macros\findmsvccompiler.sci line 26 ) > at line 2 of function dlwHaveCompiler ( C:\Program Files\scilab-6.1.1\modules\dynamic_link\macros\windows\dlwHaveCompiler.sci line 15 ) > at line 7 of function haveacompiler ( C:\Program Files\scilab-6.1.1\modules\dynamic_link\macros\haveacompiler.sci line 20 ) > at line 109 of function demo_pendulum ( C:\Program Files\scilab-6.1.1\modules\differential_equations\demos\n_pendulum\n_pendulum.sci line 117 ) > at line 11 of executed file C:\Program Files\scilab-6.1.1\modules\differential_equations\demos\n_pendulum\n_pendulum.dem.sce > > Undefined variable: vers > at line 38 of function getVsWhereInformation ( C:\Program Files\scilab-6.1.1\modules\dynamic_link\macros\windows\getVsWhereInformation.sci line 38 ) > at line 3 of function dlwIsVc141Express ( C:\Program Files\scilab-6.1.1\modules\dynamic_link\macros\windows\dlwIsVc141Express.sci line 16 ) > at line 31 of function dlwFindMsVcCompiler ( C:\Program Files\scilab-6.1.1\modules\dynamic_link\macros\windows\dlwFindMsVcCompiler.sci line 45 ) > at line 12 of function findmsvccompiler ( C:\Program Files\scilab-6.1.1\modules\dynamic_link\macros\findmsvccompiler.sci line 26 ) > at line 2 of function dlwHaveCompiler ( C:\Program Files\scilab-6.1.1\modules\dynamic_link\macros\windows\dlwHaveCompiler.sci line 15 ) > at line 7 of function haveacompiler ( C:\Program Files\scilab-6.1.1\modules\dynamic_link\macros\haveacompiler.sci line 20 ) > at line 10 of function demo_wheel2 ( C:\Program Files\scilab-6.1.1\modules\differential_equations\demos\wheel\wheel2.dem.sce line 18 ) > at line 73 of executed file C:\Program Files\scilab-6.1.1\modules\differential_equations\demos\wheel\wheel2.dem.sce > > Undefined variable: vers > _______________________________________________ > users mailing list > users at lists.scilab.org > http://lists.scilab.org/mailman/listinfo/users From Jean-Yves.Baudais at insa-rennes.fr Fri Jun 17 14:41:12 2022 From: Jean-Yves.Baudais at insa-rennes.fr (Jean-Yves Baudais) Date: Fri, 17 Jun 2022 14:41:12 +0200 Subject: [Scilab-users] output buffer In-Reply-To: <08feaf60-91e8-fd81-8795-b95e4b684d99@insa-rennes.fr> References: <08feaf60-91e8-fd81-8795-b95e4b684d99@insa-rennes.fr> Message-ID: <0817e4fe-880f-6b4f-9ceb-e93289a02e03@insa-rennes.fr> Hello, In other words, how to use "setvbuf" in Scilab? Is there an equivalent function that works with the mfprintf scilab function? Thanks, --Jean-Yves Le 16/06/2022 ? 10:39, Jean-Yves Baudais a ?crit?: > How to manage *the size*. Sorry. > > Jean-Yves > > Le 16/06/2022 ? 10:38, Jean-Yves Baudais a ?crit?: >> Hello, >> >> How can we manage the output buffer when we write to a file? It seems >> that this buffer size is 4096. >> >> Thanks, >> >> Jean-Yves > _______________________________________________ > users mailing list > users at lists.scilab.org > http://lists.scilab.org/mailman/listinfo/users From stephane.mottelet at utc.fr Fri Jun 17 23:45:01 2022 From: stephane.mottelet at utc.fr (Stephane Mottelet) Date: Fri, 17 Jun 2022 23:45:01 +0200 Subject: [Scilab-users] output buffer In-Reply-To: <0817e4fe-880f-6b4f-9ceb-e93289a02e03@insa-rennes.fr> References: <08feaf60-91e8-fd81-8795-b95e4b684d99@insa-rennes.fr> <0817e4fe-880f-6b4f-9ceb-e93289a02e03@insa-rennes.fr> Message-ID: <762a4543f6859f24c887884489591c4c@utc.fr> Hello, The buffer size is not set by Scilab and hence is always the default for a given platform (it can be different for macOS, Linux, Windows). I suppose you need to increase or decrease it for a given application ? S. --- Stephane Mottelet Le 2022-06-17 14:41, Jean-Yves Baudais a ?crit?: > Hello, > > In other words, how to use "setvbuf" in Scilab? Is there an equivalent > function that works with the mfprintf scilab function? > > Thanks, > > --Jean-Yves > > > Le 16/06/2022 ? 10:39, Jean-Yves Baudais a ?crit?: >> How to manage *the size*. Sorry. >> >> Jean-Yves >> >> Le 16/06/2022 ? 10:38, Jean-Yves Baudais a ?crit?: >>> Hello, >>> >>> How can we manage the output buffer when we write to a file? It seems >>> that this buffer size is 4096. >>> >>> Thanks, >>> >>> Jean-Yves >> _______________________________________________ >> users mailing list >> users at lists.scilab.org >> https://antispam.utc.fr/proxy/v3?i=SXVFem5DOGVpUU1rNjdmQuxbAYzjRE578NJDXO0bRW0&r=bWt1djZ5QzcyUms5R1Nzas4Pz4hn3S9_MEd_XcyeYzHsyKCVRtQ67N89rCt3q6Xy&f=Q3ZQNmU2SnpsRFlRbUF3dm35RmWaJxuoBVu42ymMGAK3JGu3n6Y8Xa7RPvcRg_db&u=http%3A//lists.scilab.org/mailman/listinfo/users&k=syJL > _______________________________________________ > users mailing list > users at lists.scilab.org > https://antispam.utc.fr/proxy/v3?i=SXVFem5DOGVpUU1rNjdmQuxbAYzjRE578NJDXO0bRW0&r=bWt1djZ5QzcyUms5R1Nzas4Pz4hn3S9_MEd_XcyeYzHsyKCVRtQ67N89rCt3q6Xy&f=Q3ZQNmU2SnpsRFlRbUF3dm35RmWaJxuoBVu42ymMGAK3JGu3n6Y8Xa7RPvcRg_db&u=http%3A//lists.scilab.org/mailman/listinfo/users&k=syJL From antoine.elias at scilab-enterprises.com Sat Jun 18 07:44:56 2022 From: antoine.elias at scilab-enterprises.com (antoine.elias at scilab-enterprises.com) Date: Sat, 18 Jun 2022 07:44:56 +0200 Subject: [Scilab-users] output buffer In-Reply-To: <0817e4fe-880f-6b4f-9ceb-e93289a02e03@insa-rennes.fr> References: <08feaf60-91e8-fd81-8795-b95e4b684d99@insa-rennes.fr> <0817e4fe-880f-6b4f-9ceb-e93289a02e03@insa-rennes.fr> Message-ID: Hello Jean-Yves, I tried to reproduce the problem but without success. Could you give us an example ? With mine, I generate a file with 8192 lines of 26624 characters. a = "a":"z"; for i = 1:10, a = a + a;end length(a) //26624 form = "%s\n"; for i = 1:13, form = form+form;end length(form) /4 //8192 times "%s\n" args = list(); args(8192) = a; //alloc list for i = 1:8191, args(i) = a;end fd = mopen(fullfile(TMPDIR, "mfprintf.txt"), "wt"); try tic(); mfprintf(fd, form, args(:)); toc() catch end mclose(fd); Regards, Antoine Le 2022-06-17 14:41, Jean-Yves Baudais a ?crit?: > Hello, > > In other words, how to use "setvbuf" in Scilab? Is there an equivalent > function that works with the mfprintf scilab function? > > Thanks, > > --Jean-Yves > > > Le 16/06/2022 ? 10:39, Jean-Yves Baudais a ?crit?: >> How to manage *the size*. Sorry. >> >> Jean-Yves >> >> Le 16/06/2022 ? 10:38, Jean-Yves Baudais a ?crit?: >>> Hello, >>> >>> How can we manage the output buffer when we write to a file? It seems >>> that this buffer size is 4096. >>> >>> Thanks, >>> >>> Jean-Yves >> _______________________________________________ >> users mailing list >> users at lists.scilab.org >> http://lists.scilab.org/mailman/listinfo/users > _______________________________________________ > users mailing list > users at lists.scilab.org > http://lists.scilab.org/mailman/listinfo/users From Jean-Yves.Baudais at insa-rennes.fr Mon Jun 20 12:04:20 2022 From: Jean-Yves.Baudais at insa-rennes.fr (Jean-Yves Baudais) Date: Mon, 20 Jun 2022 12:04:20 +0200 Subject: [Scilab-users] output buffer In-Reply-To: <762a4543f6859f24c887884489591c4c@utc.fr> References: <08feaf60-91e8-fd81-8795-b95e4b684d99@insa-rennes.fr> <0817e4fe-880f-6b4f-9ceb-e93289a02e03@insa-rennes.fr> <762a4543f6859f24c887884489591c4c@utc.fr> Message-ID: <731017ab-2f85-e82c-b3fa-8fecddd299ad@insa-rennes.fr> Hello, Le 17/06/2022 ? 23:45, Stephane Mottelet a ?crit?: > The buffer size is not set by Scilab and hence is always the default for > a given platform (it can be different for macOS, Linux, Windows). I > suppose you need to increase or decrease it for a given application? It is just for convenience. Here a better explanation. During simulation, I write some variables on file (used latter for statistical analysis) and I use to prepare and test the post-processing using the partial output data. Scilab does not write the data one by one, but by block of size 4096. The following code shows this behaviour. --> function stupidWrite(fd,n,a) --> for i=1:n mfprintf(fd,"%d",a); end --> endfunction --> fd=mopen("test.am","a"); --> stupidWrite(fd,4096,1); --> unix_g("cat test.am | wc "); ans = " 0 0 0" --> stupidWrite(fd,1,2); --> unix_g("cat test.am | wc "); ans = " 0 1 4096" --> mclose(fd) --> unix_g("cat test.am |wc ") ans = " 0 1 4097" With the C language, the size of the output buffer is managed using setvbuf. It seems that there is no interface for C-coded version of setvbuf (contrary to many input/output C function). So my question is: "is it possible to manage the size of the output buffer in Scilab?" The solution I found is to mopen and mclose the file each time I want to write something. Is there another solution? Thanks, --Jean-Yves From sgougeon at free.fr Mon Jun 20 14:57:49 2022 From: sgougeon at free.fr (Samuel Gougeon) Date: Mon, 20 Jun 2022 14:57:49 +0200 Subject: [Scilab-users] output buffer In-Reply-To: <731017ab-2f85-e82c-b3fa-8fecddd299ad@insa-rennes.fr> References: <08feaf60-91e8-fd81-8795-b95e4b684d99@insa-rennes.fr> <0817e4fe-880f-6b4f-9ceb-e93289a02e03@insa-rennes.fr> <762a4543f6859f24c887884489591c4c@utc.fr> <731017ab-2f85-e82c-b3fa-8fecddd299ad@insa-rennes.fr> Message-ID: <55381581-92c4-fecd-581d-b0afb69802d7@free.fr> Le 20/06/2022 ? 12:04, Jean-Yves Baudais a ?crit?: > Hello, > > > Le 17/06/2022 ? 23:45, Stephane Mottelet a ?crit?: >> The buffer size is not set by Scilab and hence is always the default >> for a given platform (it can be different for macOS, Linux, Windows). >> I suppose you need to increase or decrease it for a given application? > > > It is just for convenience. Here a better explanation. During > simulation, I write some variables on file (used latter for > statistical analysis) and I use to prepare and test the > post-processing using the partial output data. Scilab does not write > the data one by one, but by block of size 4096. The following code > shows this behaviour. > > > --> function stupidWrite(fd,n,a) > --> for i=1:n mfprintf(fd,"%d",a); end > --> endfunction > --> fd=mopen("test.am","a"); > --> stupidWrite(fd,4096,1); > --> unix_g("cat test.am | wc "); > ?ans? = > ? "????? 0?????? 0?????? 0" > --> stupidWrite(fd,1,2); > --> unix_g("cat test.am | wc "); > ?ans? = > ? "????? 0?????? 1??? 4096" > --> mclose(fd) > --> unix_g("cat test.am |wc ") > ?ans? = > ? "????? 0?????? 1??? 4097" > > > With the C language, the size of the output buffer is managed using > setvbuf. It seems that there is no interface for C-coded version of > setvbuf (contrary to many input/output C function). > > So my question is: "is it possible to manage the size of the output > buffer in Scilab?" > > The solution I found is to mopen and mclose the file each time I want > to write something. Is there another solution? To me, here the issue looks not so much about the size of the internal buffer, but about the inability to flush buffered data on request, whatever is the buffer size. For instance, we could simply hope that, for a text file, sending an ascii(12) form feed alone (*) would trigger flushing the buffer, in a trivial, documented, and straightforward way. By the way, the current default buffering and buffer size of mfprintf() would deserve being documented. My two cents Samuel (*) easy to detect by the receiver: 1 byte, equal to ascii(12) => flush instead of writing.