From perrichon.pierre at wanadoo.fr Sun Feb 2 17:13:52 2020 From: perrichon.pierre at wanadoo.fr (Perrichon) Date: Sun, 2 Feb 2020 17:13:52 +0100 Subject: [Scilab-users] Scilab Nigthly build - bugzilla 16308 In-Reply-To: References: Message-ID: Hello Samuel I?ve download two times with full success scilab 5.5.2 and 6.0.2 and reinstall on my computer without any problem. I maintain that I can?t download the scilab nightly build, after more than fifteen trys. So I cannot test your proposal concerning bugzilla #16308 Best regards De : users De la part de Samuel Gougeon Envoy? : vendredi 31 janvier 2020 12:15 ? : 'Users mailing list for Scilab' Objet : Re: [Scilab-users] Scilab Nigthly build - bugzilla 16308 Hello Pierre, Le 31/01/2020 ? 08:28, Perrichon a ?crit : Hello Samuel Is there a way to load nigthly build version, as it existed in the past : apparently not available on the new download site Nighly build are replaced with the Continuous Build, that can change several times a day according to the activity on the main Scilab forge. As answered in Bugzilla, currently the Continuous Build version is the master one. It can be found and downloaded there: Overview: https://build.scilab.org/view/Scilab%20binaries/ Windows: https://build.scilab.org/view/Scilab%20binaries/job/scilab-master-windows-64 /lastSuccessfulBuild/artifact/scilab-branch-master_x64.exe Linux: https://build.scilab.org/view/Scilab%20binaries/job/scilab-master-linux-64/l astSuccessfulBuild/artifact/scilab-branch-master-linux-x86_64.tar.gz The issue with the anti-virus software on your computer is independent from the access to Continuous Build binaries. Regards Samuel -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image002.jpg Type: image/jpeg Size: 10408 bytes Desc: not available URL: From sgougeon at free.fr Sun Feb 2 18:09:15 2020 From: sgougeon at free.fr (Samuel Gougeon) Date: Sun, 2 Feb 2020 18:09:15 +0100 Subject: [Scilab-users] Scilab Nigthly build - bugzilla 16308 In-Reply-To: References: Message-ID: <388b6879-c3a5-8feb-8f84-bbe791744973@free.fr> Le 02/02/2020 ? 17:13, Perrichon a ?crit?: > > Hello Samuel > > I?ve download two times with full success scilab 5.5.2 and 6.0.2 and > reinstall on my computer without any problem. > > I maintain that I can?t download the scilab nightly build, after more > than fifteen trys. > > So I cannot test your proposal concerning bugzilla #16308 > Yes, sometimes the download is interrupted. I guess that the server delivering the Continuous build is less powerful than the one for downloading the official releases. But then it has been always possible (on Windows 7, with Firefox, Chrome or Opera) to resume the download, to complete it, without restarting it from scratch. Regards Samuel -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image002.jpg Type: image/jpeg Size: 10408 bytes Desc: not available URL: From perrichon.pierre at wanadoo.fr Sun Feb 2 18:18:11 2020 From: perrichon.pierre at wanadoo.fr (Perrichon) Date: Sun, 2 Feb 2020 18:18:11 +0100 Subject: [Scilab-users] Scilab Nigthly build - bugzilla 16308 In-Reply-To: <388b6879-c3a5-8feb-8f84-bbe791744973@free.fr> References: <388b6879-c3a5-8feb-8f84-bbe791744973@free.fr> Message-ID: I use Mozilla Firefox and Window 10 B.R De : Samuel Gougeon Envoy? : dimanche 2 f?vrier 2020 18:09 ? : Perrichon ; 'Users mailing list for Scilab' Objet : Re: [Scilab-users] Scilab Nigthly build - bugzilla 16308 Le 02/02/2020 ? 17:13, Perrichon a ?crit : Hello Samuel I?ve download two times with full success scilab 5.5.2 and 6.0.2 and reinstall on my computer without any problem. I maintain that I can?t download the scilab nightly build, after more than fifteen trys. So I cannot test your proposal concerning bugzilla #16308 Yes, sometimes the download is interrupted. I guess that the server delivering the Continuous build is less powerful than the one for downloading the official releases. But then it has been always possible (on Windows 7, with Firefox, Chrome or Opera) to resume the download, to complete it, without restarting it from scratch. Regards Samuel -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image002.jpg Type: image/jpeg Size: 9642 bytes Desc: not available URL: From amonmayr at laas.fr Mon Feb 3 07:50:23 2020 From: amonmayr at laas.fr (Antoine Monmayrant) Date: Mon, 03 Feb 2020 07:50:23 +0100 Subject: [Scilab-users] =?utf-8?b?Pz09P3V0Zi04P3E/ICBTY2lsYWIgTmlndGhseSBi?= =?utf-8?q?uild_-_bugzilla_16308?= In-Reply-To: Message-ID: <507d-5e37c280-7-33bfef00@191936801> Hi all, No problem for me to download https://build.scilab.org/view/Scilab%20binaries/job/scilab-master-linux-64/lastSuccessfulBuild/artifact/scilab-branch-master-linux-x86_64.tar.gz from firefox (from ubuntu 19.04). Antoine Le Dimanche, F?vrier 02, 2020 18:18 CET, "Perrichon" a ?crit: > I use Mozilla Firefox and Window 10 > > B.R > > > > > > De : Samuel Gougeon > Envoy? : dimanche 2 f?vrier 2020 18:09 > ? : Perrichon ; 'Users mailing list for Scilab' > > Objet : Re: [Scilab-users] Scilab Nigthly build - bugzilla 16308 > > > > Le 02/02/2020 ? 17:13, Perrichon a ?crit : > > Hello Samuel > > I?ve download two times with full success scilab 5.5.2 and 6.0.2 and > reinstall on my computer without any problem. > > I maintain that I can?t download the scilab nightly build, after more than > fifteen trys. > > So I cannot test your proposal concerning bugzilla #16308 > > > > > > > > Yes, sometimes the download is interrupted. I guess that the server > delivering the Continuous build is less powerful than the one for > downloading the official releases. But then it has been always possible (on > Windows 7, with Firefox, Chrome or Opera) to resume the download, to > complete it, without restarting it from scratch. > > Regards > Samuel > From fmiyara at fceia.unr.edu.ar Wed Feb 5 03:42:01 2020 From: fmiyara at fceia.unr.edu.ar (Federico Miyara) Date: Tue, 4 Feb 2020 23:42:01 -0300 Subject: [Scilab-users] Sine integral Message-ID: Dear All, Is there a primitive implementing the sine(x)/x indefinite integral (called sine integral, Si)? I couldn't find it either among the special functions or trigonometric functions collections. It is an important function in signal processing (for instance a non-aliased rectangular pulse requires Si). I know it would be possible to find the value for given x using integrate or intg, but I'm sure it would be much more efficient to use an approximation such as a Taylor series combined perhaps with an asymptotic approximation, than to massively compute a definite integral for each single value. Regards, Federico Miyara -------------- next part -------------- An HTML attachment was scrubbed... URL: From fmiyara at fceia.unr.edu.ar Wed Feb 5 03:50:14 2020 From: fmiyara at fceia.unr.edu.ar (Federico Miyara) Date: Tue, 4 Feb 2020 23:50:14 -0300 Subject: [Scilab-users] Sine integral In-Reply-To: References: Message-ID: <4c78cad1-6d6e-f520-daba-756d488cc1ef@fceia.unr.edu.ar> Sorry for the typo, I meant sin(x)/x, i.e., the sinc function. On 04/02/2020 23:42, Federico Miyara wrote: > > Dear All, > > Is there a primitive implementing the sine(x)/x indefinite integral > (called sine integral, Si)? > > I couldn't find it either among the special functions or trigonometric > functions collections. It is an important function in signal > processing (for instance a non-aliased rectangular pulse requires Si). > > I know it would be possible to find the value for given x using > integrate or intg, but I'm sure it would be much more efficient to use > an approximation such as a Taylor series combined perhaps with an > asymptotic approximation, than to massively compute a definite > integral for each single value. > > Regards, > > Federico Miyara > > _______________________________________________ > users mailing list > users at lists.scilab.org > http://lists.scilab.org/mailman/listinfo/users -------------- next part -------------- An HTML attachment was scrubbed... URL: From fmiyara at fceia.unr.edu.ar Thu Feb 6 08:30:57 2020 From: fmiyara at fceia.unr.edu.ar (Federico Miyara) Date: Thu, 6 Feb 2020 04:30:57 -0300 Subject: [Scilab-users] Certain operations are not expressed as floating point Message-ID: <75983741-0e07-d325-a439-43f803c835b8@fceia.unr.edu.ar> Dear all, Trying to implement sine integral from the series, my first attempt ??????? y = 0 ??????? N = 30; ??????? for n=0:N ??????????? y = y + (-1)^n * x.^(2*n+1)./(2*n+1)./factorial(2*n+1); ??????? end works fine for x<20. Now I want to vectorize it so the plan is to create a polynomial and then apply horner. The coefficients are coe = (-1).^(0:N)./(1:2:2*N+1)./factorial(1:2:2*N+1) I get coe? = ???????? column 1 to 6 ?? 1.? -0.055555555556?? 0.001666666667? -0.000028344671 0.000000306192? -0.000000002277 ???????? column 7 to 19 ?? 0.000000000012? -5.09810915D-14?? 1.65379838D-16?? 0.?? 0.?? 0. 0.?? 0.?? 0.?? 0.?? 0.?? 0.?? 0. ???????? column 20 to 31 ?? 0.?? 0.?? 0.?? 0.?? 0.?? 0.?? 0.?? 0.?? 0.?? 0.?? 0.?? 0. From the 10-th coefficient on, the value seems to be 0. However, coe(10) yields? 9.32044813D-22 Actually this is a documented behavior (it is described in hhe format help page). But I wonder if it is advisable, since it may be confusing. Indeed, it took me some time to discover that the coefficients were stored as floating point. At the beginning I "believed" what I saw and started to think which would be the best order of the operations to avoid too small intermediate values. Is there a reason for that behavior that outweighs the inconvenience I've mentioned? Regards, Federico Miyra -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephane.mottelet at utc.fr Thu Feb 6 08:45:00 2020 From: stephane.mottelet at utc.fr (=?UTF-8?Q?St=c3=a9phane_Mottelet?=) Date: Thu, 6 Feb 2020 08:45:00 +0100 Subject: [Scilab-users] Certain operations are not expressed as floating point In-Reply-To: <75983741-0e07-d325-a439-43f803c835b8@fceia.unr.edu.ar> References: <75983741-0e07-d325-a439-43f803c835b8@fceia.unr.edu.ar> Message-ID: <4cb44190-944f-a81e-3015-27248769f656@utc.fr> Hello, This problem is fixed in Scilab 6.1 S. Le 06/02/2020 ? 08:30, Federico Miyara a ?crit?: > > Dear all, > > Trying to implement sine integral from the series, my first attempt > > ??????? y = 0 > ??????? N = 30; > ??????? for n=0:N > ??????????? y = y + (-1)^n * x.^(2*n+1)./(2*n+1)./factorial(2*n+1); > ??????? end > > works fine for x<20. Now I want to vectorize it so the plan is to > create a polynomial and then apply horner. The coefficients are > > coe = (-1).^(0:N)./(1:2:2*N+1)./factorial(1:2:2*N+1) > > I get > > coe? = > > ???????? column 1 to 6 > > ?? 1.? -0.055555555556?? 0.001666666667? -0.000028344671 > 0.000000306192? -0.000000002277 > > ???????? column 7 to 19 > > ?? 0.000000000012? -5.09810915D-14?? 1.65379838D-16?? 0.?? 0. 0.?? > 0.?? 0.?? 0.?? 0.?? 0.?? 0.?? 0. > > ???????? column 20 to 31 > > ?? 0.?? 0.?? 0.?? 0.?? 0.?? 0.?? 0.?? 0.?? 0.?? 0.?? 0.?? 0. > > From the 10-th coefficient on, the value seems to be 0. However, > coe(10) yields? 9.32044813D-22 > > Actually this is a documented behavior (it is described in hhe format > help page). But I wonder if it is advisable, since it may be confusing. > > Indeed, it took me some time to discover that the coefficients were > stored as floating point. At the beginning I "believed" what I saw and > started to think which would be the best order of the operations to > avoid too small intermediate values. > > Is there a reason for that behavior that outweighs the inconvenience > I've mentioned? > > Regards, > > Federico Miyra > > > > _______________________________________________ > users mailing list > users at lists.scilab.org > https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From fmiyara at fceia.unr.edu.ar Thu Feb 6 10:41:20 2020 From: fmiyara at fceia.unr.edu.ar (Federico Miyara) Date: Thu, 6 Feb 2020 06:41:20 -0300 Subject: [Scilab-users] Si function Message-ID: Dear All, Just in case somebody is interested, find attached a Scilab function to compute the sine integral function Si (the integral from 0 to x of the sinc function), which cannot be expressed in closed form with elementary functions. /It is preliminary, it doesn't test for appropriate input argument. It works for real or complex matrices or N-D arrays. It can be easily modified to get the cosine integral function. Regards, Fderico Miyara / -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- function y = Si(x) // This function computes the sine integral function, i.e., // the integral from 0 to x of the sinc function sin(x)/x // Usage: // y = Si(x) // where // x: Any real or complex scalar, vector, matrix // or N-D aray // y: The result of applying the sine integral to // each component. Its size is equal to size(x) // // Reference: // Abramowitz, M. and Stegun, I. (eds.) "Handbook of // Mathematical Functions". Dover. New York, 1972. // --------------------------- // Author: Federico Miyara // Date: 2020-02-06 siz = size(x); // Indexes to values of the argument with absolute // value not greater than 20 I = find(abs(x)<=20); // Indexes to values of the argument greater than 20 // and non-negative J = find(abs(x)>20 & x<>-abs(x)); // Indexes to values of the argument smaller than 20 // and negative K = find(abs(x)>20 & x==-abs(x)); // Apply algorithm based on Taylor series y_small = Si_small(x(I)); // Apply algorithm based on asymptotic approximation // This approximation is not valid for negative arguments, // but as Si is an odd function this is easy to fix y_large_pos = Si_large(x(J)); y_large_neg = -Si_large(-x(K)); // Put all together y = zeros(x); y(I) = y_small; y(J) = y_large_pos; y(K) = y_large_neg; endfunction function y = Si_small(x) N = 30 coe = (-1).^(0:N)./(1:2:2*N+1)./factorial(1:2:2*N+1); Sipoly = poly(coe, "u", "c"); y = x.*horner(Sipoly, x.^2); endfunction function y = Si_large(x) M = 15 // Coefficients of the Laurent series of the auxilary // functions for the asymptotic approximation sig = (-1).^(0:M); cf = factorial(0:2:2*M).*sig; cg = factorial(1:2:2*M+1).*sig; // Polynomials with the preceding coefficients pf = poly(cf,"u","c"); pg = poly(cg,"u","c"); // Computation of the auxiliary functions f = horner(pf, 1./x.^2)./x g = horner(pg, 1./x.^2)./x.^2 // Computation of tha asymptotic approximation // fo large arguments y = %pi/2 - f.*cos(x) - g.*sin(x) endfunction From oferpade at 013net.net Thu Feb 6 10:27:04 2020 From: oferpade at 013net.net (Offer Pade) Date: Thu, 06 Feb 2020 11:27:04 +0200 Subject: [Scilab-users] xfrect Message-ID: <000c01d5dccf$98486540$c8d92fc0$@013net.net> How do you color the background using xfrect. According to the manual you have to use xset or gcs().foregraound. Neither works for me. I am using scilab 6.02 -------------- next part -------------- An HTML attachment was scrubbed... URL: From fmiyara at fceia.unr.edu.ar Thu Feb 6 10:42:42 2020 From: fmiyara at fceia.unr.edu.ar (Federico Miyara) Date: Thu, 6 Feb 2020 06:42:42 -0300 Subject: [Scilab-users] Certain operations are not expressed as floating point In-Reply-To: <4cb44190-944f-a81e-3015-27248769f656@utc.fr> References: <75983741-0e07-d325-a439-43f803c835b8@fceia.unr.edu.ar> <4cb44190-944f-a81e-3015-27248769f656@utc.fr> Message-ID: <8d035bd1-b71d-716c-4c6e-edfcfcfe686d@fceia.unr.edu.ar> St?phane, Thanks! Federico Miyara On 06/02/2020 04:45, St?phane Mottelet wrote: > > Hello, > > This problem is fixed in Scilab 6.1 > > S. > > Le 06/02/2020 ? 08:30, Federico Miyara a ?crit?: >> >> Dear all, >> >> Trying to implement sine integral from the series, my first attempt >> >> ??????? y = 0 >> ??????? N = 30; >> ??????? for n=0:N >> ??????????? y = y + (-1)^n * x.^(2*n+1)./(2*n+1)./factorial(2*n+1); >> ??????? end >> >> works fine for x<20. Now I want to vectorize it so the plan is to >> create a polynomial and then apply horner. The coefficients are >> >> coe = (-1).^(0:N)./(1:2:2*N+1)./factorial(1:2:2*N+1) >> >> I get >> >> coe? = >> >> ???????? column 1 to 6 >> >> ?? 1.? -0.055555555556?? 0.001666666667? -0.000028344671 >> 0.000000306192? -0.000000002277 >> >> ???????? column 7 to 19 >> >> ?? 0.000000000012? -5.09810915D-14?? 1.65379838D-16?? 0.?? 0. 0.?? >> 0.?? 0.?? 0.?? 0.?? 0.?? 0.?? 0. >> >> ???????? column 20 to 31 >> >> ?? 0.?? 0.?? 0.?? 0.?? 0.?? 0.?? 0.?? 0.?? 0.?? 0.?? 0.?? 0. >> >> From the 10-th coefficient on, the value seems to be 0. However, >> coe(10) yields? 9.32044813D-22 >> >> Actually this is a documented behavior (it is described in hhe format >> help page). But I wonder if it is advisable, since it may be confusing. >> >> Indeed, it took me some time to discover that the coefficients were >> stored as floating point. At the beginning I "believed" what I saw >> and started to think which would be the best order of the operations >> to avoid too small intermediate values. >> >> Is there a reason for that behavior that outweighs the inconvenience >> I've mentioned? >> >> Regards, >> >> Federico Miyra >> >> >> >> _______________________________________________ >> users mailing list >> users at lists.scilab.org >> https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/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 > > _______________________________________________ > users mailing list > users at lists.scilab.org > http://lists.scilab.org/mailman/listinfo/users -------------- next part -------------- An HTML attachment was scrubbed... URL: From fmiyara at fceia.unr.edu.ar Thu Feb 6 22:04:25 2020 From: fmiyara at fceia.unr.edu.ar (Federico Miyara) Date: Thu, 6 Feb 2020 18:04:25 -0300 Subject: [Scilab-users] Awkward behavior of error handling Message-ID: <14dffcee-2416-90f8-9d75-8184ededd60b@fceia.unr.edu.ar> Dear All, I'm trying to cast an error message for a function The test and message are if argn(2)<>1 ?? t1 = "%s: Wrong number of input arguments: %d expected.\n" ?? t2 = "Si" ?? error(msprintf(gettext(t1),t2,1)); end The function has only one argument, so if invoked with 0 or more than one argument, the message should be the same. With 0 arguments I get: --> y = Si() ?? 0. at line??? 26 of function Si ( D:\work_scilab\Si.sci line 26 ) Si: Wrong number of input arguments: 1 expected. This is the correct and expected message. However, with 2 arguments I get --> y = Si(1,2) Wrong number of input arguments. This error seems to have been trapped before my test, the execution is halted and my message doesn't show. I've also tested the function wavwrite, which requires 2 or 3 arguments. With 0 or 1 the message is the expected one, but with 4 or more arguments, I get the same result as in my example. Seems as if less arguments are handled by the custom error handler, but more than required is handled by sort of a parser. I think this behavior contradicts the facility of customizing error messages. Regards, Federico Miyara -------------- next part -------------- An HTML attachment was scrubbed... URL: From sgougeon at free.fr Thu Feb 6 22:35:16 2020 From: sgougeon at free.fr (Samuel Gougeon) Date: Thu, 6 Feb 2020 22:35:16 +0100 Subject: [Scilab-users] Awkward behavior of error handling <= for a too big number of inputs In-Reply-To: <14dffcee-2416-90f8-9d75-8184ededd60b@fceia.unr.edu.ar> References: <14dffcee-2416-90f8-9d75-8184ededd60b@fceia.unr.edu.ar> Message-ID: <8e6bac18-ca57-a1a9-e018-c7c16d0d9a30@free.fr> Hello Federico, Le 06/02/2020 ? 22:04, Federico Miyara a ?crit?: > > Dear All, > > I'm trying to cast an error message for a function > > The test and message are > > if argn(2)<>1 > ?? t1 = "%s: Wrong number of input arguments: %d expected.\n" > ?? t2 = "Si" > ?? error(msprintf(gettext(t1),t2,1)); > end Please pay attention to avoid separating the gettext() call from its first literal argument. The reason is described with details in the gettext() page. So, to abstract, writting both the following is not fully equivalent: t1 = "%s: Wrong number of input arguments: %d expected.\n" gettext(t1) and gettext("%s: Wrong number of input arguments: %d expected.\n") Here, this separation has no consequence, because you are using a standard message that already has a translation in Scilab. But for custom messages as in a toolbox, gettext() could here fail finding the translation. > > The function has only one argument, so if invoked with 0 or more than > one argument, the message should be the same. With 0 arguments I get: > > > --> y = Si() > > ?? 0. > at line??? 26 of function Si ( D:\work_scilab\Si.sci line 26 ) > > Si: Wrong number of input arguments: 1 expected. > > > This is the correct and expected message. However, with 2 arguments I get > > > --> y = Si(1,2) > > Wrong number of input arguments. > > > This error seems to have been trapped before my test, Yes, this is the case. This is a general features for all macros. The detection of a number of input arguments greater than the max acceptable by the macro is hard-coded, and stops the execution BEFORE "really" calling and entering the macro. This is the very first step that must be passed. Afterward, things actually "occur" in the macro. > the execution is halted and my message doesn't show. I've also tested > the function wavwrite, which requires 2 or 3 arguments. With 0 or 1 > the message is the expected one, but with 4 or more arguments, I get > the same result as in my example. > > Seems as if less arguments are handled by the custom error handler, > but more than required is handled by sort of a parser. > > I think this behavior contradicts the facility of customizing error > messages. Not really. Only this one, related to an excessive number of inputs. Since the number of possible distinct errors is infinite, it's cool. Our freedom to customize all other messages is also infinite :-)) Regards Samuel -------------- next part -------------- An HTML attachment was scrubbed... URL: From fmiyara at fceia.unr.edu.ar Thu Feb 6 22:55:25 2020 From: fmiyara at fceia.unr.edu.ar (Federico Miyara) Date: Thu, 6 Feb 2020 18:55:25 -0300 Subject: [Scilab-users] imprecise error messages Message-ID: <91e07b07-be0b-66bc-25a8-8264c8b3fe43@fceia.unr.edu.ar> Dear All, I'm trying to use the error messages available at https://help.scilab.org/docs/6.0.2/en_US/error_table.html However, I cannot find one that describes precisely what is wrong. My argument is any scalar, vector, matrix or N-D array of real or complex numbers. If I use ?? "%s: Argument #%d: Decimal or complex number expected.\n" it may convey the idea that only scalars are admissible. I think the word "number" jeopardizes the message. It would be better if the word "type" were clearly mentioned, for instance "Wrong input type: %d expected.\n" If I use ?? "%s: Argument #%d: Hypermatrix expected.\n" it may be interpreted as if, for instance, a polynomial hypermatrix would be acceptable. Testing abs() on a string yields ?? --> abs("hello") ?? in builtin??????????????? abs ?? Function not defined for given argument type(s), ???? check arguments or define function %c_abs for overloading. This gives a hint where is the problem, but does not indicate what type is expected, which would be more useful. Regards, Federico Miyara -------------- next part -------------- An HTML attachment was scrubbed... URL: From sgougeon at free.fr Thu Feb 6 23:17:37 2020 From: sgougeon at free.fr (Samuel Gougeon) Date: Thu, 6 Feb 2020 23:17:37 +0100 Subject: [Scilab-users] imprecise error messages In-Reply-To: <91e07b07-be0b-66bc-25a8-8264c8b3fe43@fceia.unr.edu.ar> References: <91e07b07-be0b-66bc-25a8-8264c8b3fe43@fceia.unr.edu.ar> Message-ID: Le 06/02/2020 ? 22:55, Federico Miyara a ?crit?: > > Dear All, > > I'm trying to use the error messages available at > https://help.scilab.org/docs/6.0.2/en_US/error_table.html > > However, I cannot find one that describes precisely what is wrong. > > My argument is any scalar, vector, matrix or N-D array of real or > complex numbers. > > If I use > > ?? "%s: Argument #%d: Decimal or complex number expected.\n" > > it may convey the idea that only scalars are admissible. I think the > word "number" jeopardizes the message. It would be better if the word > "type" were clearly mentioned, for instance "Wrong input type: %d > expected.\n" Yes, but to me, "input" is useless, since only input types are testable. In addition, the argument's number must appear. So yes, something like "%s: Argument #%d: Decimal or complex type expected.\n" would be better. A still more open message is possible and already listed: "%s: Argument #%d: %s expected.\n" > > If I use > > ?? "%s: Argument #%d: Hypermatrix expected.\n" > > it may be interpreted as if, for instance, a polynomial hypermatrix > would be acceptable. Yes, or of any other type, since this message only informs about the size / format, not about the data type. It is is in the same messages section "Checking container's dimension and sizes" than other messages about the shape / array size. > > Testing abs() on a string yields > > ?? --> abs("hello") > ?? in builtin??????????????? abs > > ?? Function not defined for given argument type(s), > ???? check arguments or define function %c_abs for overloading. > > This gives a hint where is the problem, but does not indicate what > type is expected, which would be more useful. But impossible. An error message is not aimed to replace the help page. There may be many possibilities. If in the function that you write you want to display the documented list of available syntaxes for this function, just before the proper error message, then disp_usage() is made for you, available in the uman package: https://atoms.scilab.org/toolboxes/uman atomsInstall uman Samuel -------------- next part -------------- An HTML attachment was scrubbed... URL: From sgougeon at free.fr Fri Feb 7 00:02:53 2020 From: sgougeon at free.fr (Samuel Gougeon) Date: Fri, 7 Feb 2020 00:02:53 +0100 Subject: [Scilab-users] Si function In-Reply-To: References: Message-ID: <37aed125-0a95-f061-ef67-7e8e7751c0a3@free.fr> Le 06/02/2020 ? 10:41, Federico Miyara a ?crit?: > > Dear All, > > Just in case somebody is interested, find attached a Scilab function > to compute the sine integral function Si (the integral from 0 to x of > the sinc function), which cannot be expressed in closed form with > elementary functions. > > /It is preliminary, it doesn't test for appropriate input argument. > > It works for real or complex matrices or N-D arrays. > > It can be easily modified to get the cosine integral function. > / Great work, Federico! Just a comment: IMHO, so short functions names should really be avoided. The shorter the name, the more probable are collisions with other users common variables. By the way, i am wondering about a similar expint() function = integral of dt*exp(t)/t. From there, the linearity of the integration operator and the Euler formula would yield in a trivial way sinint(a) and cosint(a), with a (almost) one-line definition using expint([-a a]*%i). Wouldn't they? Best regards Samuel -------------- next part -------------- An HTML attachment was scrubbed... URL: From sgougeon at free.fr Fri Feb 7 02:07:29 2020 From: sgougeon at free.fr (Samuel Gougeon) Date: Fri, 7 Feb 2020 02:07:29 +0100 Subject: [Scilab-users] Si function => expint() In-Reply-To: <37aed125-0a95-f061-ef67-7e8e7751c0a3@free.fr> References: <37aed125-0a95-f061-ef67-7e8e7751c0a3@free.fr> Message-ID: <09a2465a-8d03-7312-6590-4c0a17ca7feb@free.fr> Le 07/02/2020 ? 00:02, Samuel Gougeon a ?crit?: > Le 06/02/2020 ? 10:41, Federico Miyara a ?crit?: >> >> Dear All, >> >> Just in case somebody is interested, find attached a Scilab function >> to compute the sine integral function Si (the integral from 0 to x of >> the sinc function), which cannot be expressed in closed form with >> elementary functions. >> >> /It is preliminary, it doesn't test for appropriate input argument. >> >> It works for real or complex matrices or N-D arrays. >> >> It can be easily modified to get the cosine integral function. >> / > > Great work, Federico! Just a comment: IMHO, so short functions names > should really be avoided. > The shorter the name, the more probable are collisions with other > users common variables. > > By the way, i am wondering about a similar expint() function = > integral of dt*exp(t)/t. > > From there, the linearity of the integration operator and the Euler > formula would yield > in a trivial way sinint(a) and cosint(a), with a (almost) one-line > definition using > expint([-a a]*%i). > Of course, the same expint could then be used as well for integral(dt.sh(t)/t), integral(dt.ch(t)/t), etc. The exp familly is great, and, IMHO, there would be no need to create N specific functionint for trivial expint combinations. Just a good set of expint applications examples, in the expint documentation. Samuel -------------- next part -------------- An HTML attachment was scrubbed... URL: From sgougeon at free.fr Fri Feb 7 02:28:32 2020 From: sgougeon at free.fr (Samuel Gougeon) Date: Fri, 7 Feb 2020 02:28:32 +0100 Subject: [Scilab-users] imprecise error messages In-Reply-To: References: <91e07b07-be0b-66bc-25a8-8264c8b3fe43@fceia.unr.edu.ar> Message-ID: Le 06/02/2020 ? 23:17, Samuel Gougeon a ?crit?: > Le 06/02/2020 ? 22:55, Federico Miyara a ?crit?: >> >> Dear All, >> >> I'm trying to use the error messages available at >> https://help.scilab.org/docs/6.0.2/en_US/error_table.html >> >> However, I cannot find one that describes precisely what is wrong. >> >> My argument is any scalar, vector, matrix or N-D array of real or >> complex numbers. >> >> If I use >> >> ?? "%s: Argument #%d: Decimal or complex number expected.\n" >> >> it may convey the idea that only scalars are admissible. I think the >> word "number" jeopardizes the message. It would be better if the word >> "type" were clearly mentioned, for instance "Wrong input type: %d >> expected.\n" > > > Yes, but to me, "input" is useless, since only input types are > testable. In addition, the argument's number must appear. So yes, > something like > > "%s: Argument #%d: Decimal or complex type expected.\n" > > would be better. > Just a little issue, that is not disturbing for me: "decimal" and "complex" are not proper Scilab types. From there, we certainly won't go on discussing about "constant", "double" and "number", as we recently did here. But the term "number" has been proposed for this reason. So, may be it is not so bad. -------------- next part -------------- An HTML attachment was scrubbed... URL: From sgougeon at free.fr Fri Feb 7 02:41:04 2020 From: sgougeon at free.fr (Samuel Gougeon) Date: Fri, 7 Feb 2020 02:41:04 +0100 Subject: [Scilab-users] imprecise error messages In-Reply-To: References: <91e07b07-be0b-66bc-25a8-8264c8b3fe43@fceia.unr.edu.ar> Message-ID: <76abdadd-2d1a-863a-8a44-5304d74fa102@free.fr> Le 07/02/2020 ? 02:28, Samuel Gougeon a ?crit?: > Le 06/02/2020 ? 23:17, Samuel Gougeon a ?crit?: >> Le 06/02/2020 ? 22:55, Federico Miyara a ?crit?: >>> >>> Dear All, >>> >>> I'm trying to use the error messages available at >>> https://help.scilab.org/docs/6.0.2/en_US/error_table.html >>> >>> However, I cannot find one that describes precisely what is wrong. >>> >>> My argument is any scalar, vector, matrix or N-D array of real or >>> complex numbers. >>> >>> If I use >>> >>> ?? "%s: Argument #%d: Decimal or complex number expected.\n" >>> >>> it may convey the idea that only scalars are admissible. I think the >>> word "number" jeopardizes the message. It would be better if the >>> word "type" were clearly mentioned, for instance "Wrong input type: >>> %d expected.\n" >> >> >> Yes, but to me, "input" is useless, since only input types are >> testable. In addition, the argument's number must appear. So yes, >> something like >> >> "%s: Argument #%d: Decimal or complex type expected.\n" >> >> would be better. >> > Just a little issue, that is not disturbing for me: "decimal" and > "complex" are not proper Scilab types. > From there, we certainly won't go on discussing about "constant", > "double" and "number", > as we recently did here. > But the term "number" has been proposed for this reason. > So, may be it is not so bad. > In addition, "Real or complex /type/ expected.\n" could be ambiguous. Indeed, it may as well qualify polynomials, or rationals. So, all in all, as you see, it's not so easy to find good unambiguous and not too technical terms. We know that the longer and more technically worded error messages are, the less read they are. -------------- next part -------------- An HTML attachment was scrubbed... URL: From fmiyara at fceia.unr.edu.ar Fri Feb 7 06:09:56 2020 From: fmiyara at fceia.unr.edu.ar (Federico Miyara) Date: Fri, 7 Feb 2020 02:09:56 -0300 Subject: [Scilab-users] Awkward behavior of error handling <= for a too big number of inputs In-Reply-To: <8e6bac18-ca57-a1a9-e018-c7c16d0d9a30@free.fr> References: <14dffcee-2416-90f8-9d75-8184ededd60b@fceia.unr.edu.ar> <8e6bac18-ca57-a1a9-e018-c7c16d0d9a30@free.fr> Message-ID: Samuel, Thanks for clarifying. I have still a doubt regardihng the hard coding. Functions such as cos and abs, which are primitives, do declare an excess of arguments: --> cos(6,7) cos: Wrong number of input argument(s): 1 expected. Is the behavior different for primitives or they have a way of bypassing the hard-coded detection? Regards, Federico Miyara On 06/02/2020 18:35, Samuel Gougeon wrote: > Hello Federico, > > Le 06/02/2020 ? 22:04, Federico Miyara a ?crit?: >> >> Dear All, >> >> I'm trying to cast an error message for a function >> >> The test and message are >> >> if argn(2)<>1 >> ?? t1 = "%s: Wrong number of input arguments: %d expected.\n" >> ?? t2 = "Si" >> ?? error(msprintf(gettext(t1),t2,1)); >> end > > > Please pay attention to avoid separating the gettext() call from its > first literal argument. The reason is described with details in the > gettext() page. So, to abstract, writting both the following is not > fully equivalent: > > t1 = "%s: Wrong number of input arguments: %d expected.\n" > gettext(t1) > > and > > gettext("%s: Wrong number of input arguments: %d expected.\n") > > > Here, this separation has no consequence, because you are using a > standard message that already has a translation in Scilab. But for > custom messages as in a toolbox, gettext() could here fail finding the > translation. > >> >> The function has only one argument, so if invoked with 0 or more than >> one argument, the message should be the same. With 0 arguments I get: >> >> >> --> y = Si() >> >> ?? 0. >> at line??? 26 of function Si ( D:\work_scilab\Si.sci line 26 ) >> >> Si: Wrong number of input arguments: 1 expected. >> >> >> This is the correct and expected message. However, with 2 arguments I get >> >> >> --> y = Si(1,2) >> >> Wrong number of input arguments. >> >> >> This error seems to have been trapped before my test, > > > Yes, this is the case. This is a general features for all macros. The > detection of a number of input arguments greater than the max > acceptable by the macro is hard-coded, and stops the execution BEFORE > "really" calling and entering the macro. This is the very first step > that must be passed. Afterward, things actually "occur" in the macro. > >> the execution is halted and my message doesn't show. I've also tested >> the function wavwrite, which requires 2 or 3 arguments. With 0 or 1 >> the message is the expected one, but with 4 or more arguments, I get >> the same result as in my example. >> >> Seems as if less arguments are handled by the custom error handler, >> but more than required is handled by sort of a parser. >> >> I think this behavior contradicts the facility of customizing error >> messages. > > Not really. Only this one, related to an excessive number of inputs. > Since the number of possible distinct errors is infinite, it's cool. > Our freedom to customize all other messages is also infinite :-)) > > > Regards > Samuel > > > _______________________________________________ > users mailing list > users at lists.scilab.org > http://lists.scilab.org/mailman/listinfo/users -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephane.mottelet at utc.fr Fri Feb 7 09:14:43 2020 From: stephane.mottelet at utc.fr (=?UTF-8?Q?St=c3=a9phane_Mottelet?=) Date: Fri, 7 Feb 2020 09:14:43 +0100 Subject: [Scilab-users] Awkward behavior of error handling <= for a too big number of inputs In-Reply-To: References: <14dffcee-2416-90f8-9d75-8184ededd60b@fceia.unr.edu.ar> <8e6bac18-ca57-a1a9-e018-c7c16d0d9a30@free.fr> Message-ID: Here is the explanation : when you write a macro prototype, e.g. like this one function foo(x) endfunction when you call it with too many arguments, then the error always triggered by the parser. When you call the function with not enough arguments, then the variable scope takes precedence. For example the following is legal: x=1 foo() i.e. even when not enough input arguments, then the call may be OK, but hopefully argn(2) will have the correct value, i.e. 0 above. That is the reason why the parser always allow the call when there is not enough arguments, leaving the body of the macro do the verification, if necessary. To me this kind of scoping is always source of error and side effects. Accessing the calling context variable by value is OK, but that formal arguments may be asssigned like this id very prone to errors, at least for beginners. S. Le 07/02/2020 ? 06:09, Federico Miyara a ?crit?: > > Samuel, > > Thanks for clarifying. I have still a doubt regardihng the hard > coding. Functions such as cos and abs, which are > primitives, do declare an excess of arguments: > > --> cos(6,7) > > cos: Wrong number of input argument(s): 1 expected. > > Is the behavior different for primitives or they have a way of > bypassing the hard-coded detection? > > Regards, > > Federico Miyara > > > On 06/02/2020 18:35, Samuel Gougeon wrote: >> Hello Federico, >> >> Le 06/02/2020 ? 22:04, Federico Miyara a ?crit?: >>> >>> Dear All, >>> >>> I'm trying to cast an error message for a function >>> >>> The test and message are >>> >>> if argn(2)<>1 >>> ?? t1 = "%s: Wrong number of input arguments: %d expected.\n" >>> ?? t2 = "Si" >>> ?? error(msprintf(gettext(t1),t2,1)); >>> end >> >> >> Please pay attention to avoid separating the gettext() call from its >> first literal argument. The reason is described with details in the >> gettext() page. So, to abstract, writting both the following is not >> fully equivalent: >> >> t1 = "%s: Wrong number of input arguments: %d expected.\n" >> gettext(t1) >> >> and >> >> gettext("%s: Wrong number of input arguments: %d expected.\n") >> >> >> Here, this separation has no consequence, because you are using a >> standard message that already has a translation in Scilab. But for >> custom messages as in a toolbox, gettext() could here fail finding >> the translation. >> >>> >>> The function has only one argument, so if invoked with 0 or more >>> than one argument, the message should be the same. With 0 arguments >>> I get: >>> >>> >>> --> y = Si() >>> >>> ?? 0. >>> at line??? 26 of function Si ( D:\work_scilab\Si.sci line 26 ) >>> >>> Si: Wrong number of input arguments: 1 expected. >>> >>> >>> This is the correct and expected message. However, with 2 arguments >>> I get >>> >>> >>> --> y = Si(1,2) >>> >>> Wrong number of input arguments. >>> >>> >>> This error seems to have been trapped before my test, >> >> >> Yes, this is the case. This is a general features for all macros. The >> detection of a number of input arguments greater than the max >> acceptable by the macro is hard-coded, and stops the execution BEFORE >> "really" calling and entering the macro. This is the very first step >> that must be passed. Afterward, things actually "occur" in the macro. >> >>> the execution is halted and my message doesn't show. I've also >>> tested the function wavwrite, which requires 2 or 3 arguments. With >>> 0 or 1 the message is the expected one, but with 4 or more >>> arguments, I get the same result as in my example. >>> >>> Seems as if less arguments are handled by the custom error handler, >>> but more than required is handled by sort of a parser. >>> >>> I think this behavior contradicts the facility of customizing error >>> messages. >> >> Not really. Only this one, related to an excessive number of inputs. >> Since the number of possible distinct errors is infinite, it's cool. >> Our freedom to customize all other messages is also infinite :-)) >> >> >> Regards >> Samuel >> >> >> _______________________________________________ >> users mailing list >> users at lists.scilab.org >> http://lists.scilab.org/mailman/listinfo/users > > > _______________________________________________ > users mailing list > users at lists.scilab.org > https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From fmiyara at fceia.unr.edu.ar Fri Feb 7 10:30:54 2020 From: fmiyara at fceia.unr.edu.ar (Federico Miyara) Date: Fri, 7 Feb 2020 06:30:54 -0300 Subject: [Scilab-users] Awkward behavior of error handling <= for a too big number of inputs In-Reply-To: References: <14dffcee-2416-90f8-9d75-8184ededd60b@fceia.unr.edu.ar> <8e6bac18-ca57-a1a9-e018-c7c16d0d9a30@free.fr> Message-ID: <776785e7-98f8-817e-e036-50564dddf2f1@fceia.unr.edu.ar> St?phane, Thanks for the explanation. I find it already dangerous that a function be aware of the calling level variables of equal name. But allowing so even for input arguments is too much. I agree with you. Generally, variables inside a function are bound or dummy variables. Any other variable or parameter to be collected from the context should be passed through the arguments. This is much safer and better programming style, I think, since everybody is aware of the previously assigned variables required to be to be able to apply the function. I guess a macro designed for general use will never ever exploit this feature... Regards, Federico On 07/02/2020 05:14, St?phane Mottelet wrote: > > Here is the explanation : when you write a macro prototype, e.g. like > this one > > function foo(x) > > endfunction > > when you call it with too many arguments, then the error always > triggered by the parser. > > When you call the function with not enough arguments, then the > variable scope takes precedence. For example the following is legal: > > x=1 > foo() > > i.e. even when not enough input arguments, then the call may be OK, > but hopefully argn(2) will have the correct value, i.e. 0 above. That > is the reason why the parser always allow the call when there is not > enough arguments, leaving the body of the macro do the verification, > if necessary. > > To me this kind of scoping is always source of error and side effects. > Accessing the calling context variable by value is OK, but that formal > arguments may be asssigned like this id very prone to errors, at least > for beginners. > > S. > > Le 07/02/2020 ? 06:09, Federico Miyara a ?crit?: >> >> Samuel, >> >> Thanks for clarifying. I have still a doubt regardihng the hard >> coding. Functions such as cos and abs, which are >> primitives, do declare an excess of arguments: >> >> --> cos(6,7) >> >> cos: Wrong number of input argument(s): 1 expected. >> >> Is the behavior different for primitives or they have a way of >> bypassing the hard-coded detection? >> >> Regards, >> >> Federico Miyara >> >> >> On 06/02/2020 18:35, Samuel Gougeon wrote: >>> Hello Federico, >>> >>> Le 06/02/2020 ? 22:04, Federico Miyara a ?crit?: >>>> >>>> Dear All, >>>> >>>> I'm trying to cast an error message for a function >>>> >>>> The test and message are >>>> >>>> if argn(2)<>1 >>>> ?? t1 = "%s: Wrong number of input arguments: %d expected.\n" >>>> ?? t2 = "Si" >>>> error(msprintf(gettext(t1),t2,1)); >>>> end >>> >>> >>> Please pay attention to avoid separating the gettext() call from its >>> first literal argument. The reason is described with details in the >>> gettext() page. So, to abstract, writting both the following is not >>> fully equivalent: >>> >>> t1 = "%s: Wrong number of input arguments: %d expected.\n" >>> gettext(t1) >>> >>> and >>> >>> gettext("%s: Wrong number of input arguments: %d expected.\n") >>> >>> >>> Here, this separation has no consequence, because you are using a >>> standard message that already has a translation in Scilab. But for >>> custom messages as in a toolbox, gettext() could here fail finding >>> the translation. >>> >>>> >>>> The function has only one argument, so if invoked with 0 or more >>>> than one argument, the message should be the same. With 0 arguments >>>> I get: >>>> >>>> >>>> --> y = Si() >>>> >>>> ?? 0. >>>> at line??? 26 of function Si ( D:\work_scilab\Si.sci line 26 ) >>>> >>>> Si: Wrong number of input arguments: 1 expected. >>>> >>>> >>>> This is the correct and expected message. However, with 2 arguments >>>> I get >>>> >>>> >>>> --> y = Si(1,2) >>>> >>>> Wrong number of input arguments. >>>> >>>> >>>> This error seems to have been trapped before my test, >>> >>> >>> Yes, this is the case. This is a general features for all macros. >>> The detection of a number of input arguments greater than the max >>> acceptable by the macro is hard-coded, and stops the execution >>> BEFORE "really" calling and entering the macro. This is the very >>> first step that must be passed. Afterward, things actually "occur" >>> in the macro. >>> >>>> the execution is halted and my message doesn't show. I've also >>>> tested the function wavwrite, which requires 2 or 3 arguments. With >>>> 0 or 1 the message is the expected one, but with 4 or more >>>> arguments, I get the same result as in my example. >>>> >>>> Seems as if less arguments are handled by the custom error handler, >>>> but more than required is handled by sort of a parser. >>>> >>>> I think this behavior contradicts the facility of customizing error >>>> messages. >>> >>> Not really. Only this one, related to an excessive number of inputs. >>> Since the number of possible distinct errors is infinite, it's cool. >>> Our freedom to customize all other messages is also infinite :-)) >>> >>> >>> Regards >>> Samuel >>> >>> >>> _______________________________________________ >>> users mailing list >>> users at lists.scilab.org >>> http://lists.scilab.org/mailman/listinfo/users >> >> >> _______________________________________________ >> users mailing list >> users at lists.scilab.org >> https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/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 > > _______________________________________________ > users mailing list > users at lists.scilab.org > http://lists.scilab.org/mailman/listinfo/users -------------- next part -------------- An HTML attachment was scrubbed... URL: From sgougeon at free.fr Fri Feb 7 14:33:20 2020 From: sgougeon at free.fr (Samuel Gougeon) Date: Fri, 7 Feb 2020 14:33:20 +0100 Subject: [Scilab-users] Awkward behavior of error handling <= for a too big number of inputs In-Reply-To: <776785e7-98f8-817e-e036-50564dddf2f1@fceia.unr.edu.ar> References: <14dffcee-2416-90f8-9d75-8184ededd60b@fceia.unr.edu.ar> <8e6bac18-ca57-a1a9-e018-c7c16d0d9a30@free.fr> <776785e7-98f8-817e-e036-50564dddf2f1@fceia.unr.edu.ar> Message-ID: <7aa1fa81-f597-7dd8-4b48-60f01d52da44@free.fr> Le 07/02/2020 ? 10:30, Federico Miyara a ?crit?: > > St?phane, > > Thanks for the explanation. > > I find it already dangerous that a function be aware of the calling > level variables of equal name. But allowing so even for input > arguments is too much. I agree with you. > > Generally, variables inside a function are bound or dummy variables. > Any other variable or parameter to be collected from the context > should be passed through the arguments. This is much safer and better > programming style, I think, since everybody is aware of the previously > assigned variables required to be to be able to apply the function. > > I guess a macro designed for general use will never ever exploit this > feature... There are always exceptions ;-) Because, despite its drawbacks, this feature can also be very handy when there is an important needed context. Noticeably in case of recursivity. So, things are not all white or black. When you see an Object-Oriented Programming language, almost nothing is passed through input parameters. The major useful and used contents are "implicit" and contextual, in classes. This makes OOP IDEs such Eclipse or others almost mandatory, to easily get explicitly the hidden context of any object (or function). Otherwise, programming would turn just awful. Samuel -------------- next part -------------- An HTML attachment was scrubbed... URL: From fmiyara at fceia.unr.edu.ar Sun Feb 9 04:27:29 2020 From: fmiyara at fceia.unr.edu.ar (Federico Miyara) Date: Sun, 9 Feb 2020 00:27:29 -0300 Subject: [Scilab-users] undocumented behavior of sum(), prod() and type() Message-ID: <5f969cca-98fd-4f82-2cf0-eb451e2820b9@fceia.unr.edu.ar> Dear all, I note that sum([]) yields 0 instead of []. This is somewhat contradictory with the documented behavior that [] + n yields [] regardless of the type of n I allso find that prod([]) yields 1. This is even stranger. The common feature is that both are the respective neutral element of the operations. Interestingly, cumsum and cumprod applied to [] yield the expected result, [] Besides, type([]) is 1 (constant). Somehow it is asuming an empty matrix is by default a container for constants, even in csses such as the following: a = %s b = a(1:$-1) where b is an empty sub-vector of a polynomial vector. None of these behaviors seem to be documented. If intentional, they should be documented. Regards, Federico Miyara -------------- next part -------------- An HTML attachment was scrubbed... URL: From sgougeon at free.fr Sun Feb 9 04:40:11 2020 From: sgougeon at free.fr (Samuel Gougeon) Date: Sun, 9 Feb 2020 04:40:11 +0100 Subject: [Scilab-users] undocumented behavior of sum(), prod() and type() In-Reply-To: <5f969cca-98fd-4f82-2cf0-eb451e2820b9@fceia.unr.edu.ar> References: <5f969cca-98fd-4f82-2cf0-eb451e2820b9@fceia.unr.edu.ar> Message-ID: <5e8a7818-e133-d0c2-03b4-99fe1e6ebadb@free.fr> Hello federico, The empty page is improved in 6.1.0. Please have a look to http://bugzilla.scilab.org/15431 http://bugzilla.scilab.org/attachment.cgi?id=4929 Thanks Samuel Le 09/02/2020 ? 04:27, Federico Miyara a ?crit?: > > Dear all, > > I note that sum([]) yields 0 instead of []. This is somewhat > contradictory with the documented behavior that [] + n yields [] > regardless of the type of n > > I allso find that prod([]) yields 1. This is even stranger. The common > feature is that both are the respective neutral element of the operations. > > Interestingly, cumsum and cumprod applied to [] yield the expected > result, [] > > Besides, type([]) is 1 (constant). Somehow it is asuming an empty > matrix is by default a container for constants, even in csses such as > the following: > > a = %s > b = a(1:$-1) > > where b is an empty sub-vector of a polynomial vector. > > None of these behaviors seem to be documented. If intentional, they > should be documented. > > Regards, > > Federico Miyara > > _______________________________________________ > users mailing list > users at lists.scilab.org > http://lists.scilab.org/mailman/listinfo/users -------------- next part -------------- An HTML attachment was scrubbed... URL: From ltjudd at bigpond.com Sun Feb 9 08:56:54 2020 From: ltjudd at bigpond.com (Lloyd Judd) Date: Sun, 9 Feb 2020 18:56:54 +1100 (AEDT) Subject: [Scilab-users] plotting a function that changes with x Message-ID: <2121283e.14761.17028f38b16.Webtop.94@bigpond.com> Hello,? I am trying make a plot, the function of which changes depending on the value of x,. What I am really trying to do is to simulate solar panel out put where it roughly follows a sine? function during daylight but is basically zero from sunset to sunrise, and then later overlay that with the demand curve. But I am still experimenting with the code at this stage. ?I tried all different ways;? using the "function" command and the "plot 2d" command . It only ever seems? to plot the last argument in the "if then else" statement. For example with this code; clf x=(0:1:72) if x<18 then y = sin(x*%pi/24) else y= 0.1*x end plot2d(x,y,2)it only plots the y=0.1x partConversely if I put the sine function under the "else" statement, it only plots the sin function.clfx=(0:1:72) if x<18 then y=0.01*x else y=sin(x*%pi/24) end plot2d(x,y,2)What is the best way to plot a function that changes depending on the range of x?Thanks and regardsLloyd Judd -------------- next part -------------- An HTML attachment was scrubbed... URL: From amonmayr at laas.fr Sun Feb 9 10:33:29 2020 From: amonmayr at laas.fr (Antoine Monmayrant) Date: Sun, 09 Feb 2020 10:33:29 +0100 Subject: [Scilab-users] =?utf-8?b?Pz09P3V0Zi04P3E/ICBwbG90dGluZyBhIGZ1bmN0?= =?utf-8?q?ion_that_changes_with_x?= In-Reply-To: <2121283e.14761.17028f38b16.Webtop.94@bigpond.com> Message-ID: <7242-5e3fd200-19-73337e80@66224873> Hello, I think that (x>18) is not doing what you think it does. See below two options to define y piecewise. Hope it helps, Antoine ---------------------- //your code clf x=(0:1:72) // here you x<18 is not what your think (it's a boolean vector) if x<18 then y = sin(x*%pi/24) else y= 0.1*x end plot2d(x,y,2) // two options // using the fact that x>18 is converted into // 1 when the condition is true // 0 when the condition is false y2 = sin(x*%pi/24).*(x>18) + 0.1*x.*(x<=18); plot(x,y2,"ro"); // using a range of indices & find y3=0.1*x; inds=find(x>18); y3(inds)=sin(x(inds)*%pi/24); plot(x,y3,"g"); ---------------------- Le Dimanche, F?vrier 09, 2020 08:56 CET, Lloyd Judd a ?crit: > Hello,? > I am trying make a plot, the function of which changes depending on the > value of x,. What I am really trying to do is to simulate solar panel > out put where it roughly follows a sine? function during daylight but is > basically zero from sunset to sunrise, and then later overlay that with > the demand curve. But I am still experimenting with the code at this > stage. > ?I tried all different ways;? using the "function" command and the "plot > 2d" command . It only ever seems? to plot the last argument in the "if > then else" statement. > For example with this code; > clf > x=(0:1:72) > if x<18 > then y = sin(x*%pi/24) > else > y= 0.1*x > end > plot2d(x,y,2)it only plots the y=0.1x partConversely if I put the > sine function under the "else" statement, it only plots the sin > function.clfx=(0:1:72) > if x<18 then > y=0.01*x > else > y=sin(x*%pi/24) > end > plot2d(x,y,2)What is the best way to plot a function that changes > depending on the range of x?Thanks and regardsLloyd Judd > From p.muehlmann at gmail.com Mon Feb 10 02:46:49 2020 From: p.muehlmann at gmail.com (P M) Date: Mon, 10 Feb 2020 02:46:49 +0100 Subject: [Scilab-users] ?==?utf-8?q? plotting a function that changes with x In-Reply-To: <7242-5e3fd200-19-73337e80@66224873> References: <2121283e.14761.17028f38b16.Webtop.94@bigpond.com> <7242-5e3fd200-19-73337e80@66224873> Message-ID: Hi, with the if-loop-approach you probably thought about this: x=(0:1:72)for i=1:length(x) if ((x(i)<18) == %T) // elementwise comparison then y(i) = sin(x(i)*%pi/24) else y(i)= 0.1*x(i) endendplot2d(x,y,2) However it's a if-loop within a for loop... Best regards, Philipp Am So., 9. Feb. 2020 um 10:34 Uhr schrieb Antoine Monmayrant < amonmayr at laas.fr>: > Hello, > > I think that (x>18) is not doing what you think it does. > See below two options to define y piecewise. > Hope it helps, > > Antoine > > ---------------------- > > //your code > clf > x=(0:1:72) > // here you x<18 is not what your think (it's a boolean vector) > if x<18 > then y = sin(x*%pi/24) > else > y= 0.1*x > end > plot2d(x,y,2) > > // two options > > // using the fact that x>18 is converted into > // 1 when the condition is true > // 0 when the condition is false > y2 = sin(x*%pi/24).*(x>18) + 0.1*x.*(x<=18); > > plot(x,y2,"ro"); > > // using a range of indices & find > y3=0.1*x; > inds=find(x>18); > y3(inds)=sin(x(inds)*%pi/24); > > plot(x,y3,"g"); > > ---------------------- > > > > > Le Dimanche, F?vrier 09, 2020 08:56 CET, Lloyd Judd > a ?crit: > > > Hello, > > I am trying make a plot, the function of which changes depending on the > > value of x,. What I am really trying to do is to simulate solar panel > > out put where it roughly follows a sine function during daylight but is > > basically zero from sunset to sunrise, and then later overlay that with > > the demand curve. But I am still experimenting with the code at this > > stage. > > I tried all different ways; using the "function" command and the "plot > > 2d" command . It only ever seems to plot the last argument in the "if > > then else" statement. > > For example with this code; > > clf > > x=(0:1:72) > > if x<18 > > then y = sin(x*%pi/24) > > else > > y= 0.1*x > > end > > plot2d(x,y,2)it only plots the y=0.1x partConversely if I put the > > sine function under the "else" statement, it only plots the sin > > function.clfx=(0:1:72) > > if x<18 then > > y=0.01*x > > else > > y=sin(x*%pi/24) > > end > > plot2d(x,y,2)What is the best way to plot a function that changes > > depending on the range of x?Thanks and regardsLloyd Judd > > > > _______________________________________________ > users mailing list > users at lists.scilab.org > http://lists.scilab.org/mailman/listinfo/users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fmiyara at fceia.unr.edu.ar Mon Feb 10 20:52:05 2020 From: fmiyara at fceia.unr.edu.ar (Federico Miyara) Date: Mon, 10 Feb 2020 16:52:05 -0300 Subject: [Scilab-users] Command integrate() is too slow under certain expressions Message-ID: <79e31a97-9afb-414e-9723-082735e6c903@fceia.unr.edu.ar> Dear all, The function integrate() is very handy to obtain a numerical primtive of a function, particularly useful when there is no closed form for the primitive or it is too involved. According to the documentation x = integrate(expr, v, x0, x1 [, atol [, rtol]]) expr: a character string defining a Scilab expression. v: ?? a character string, the integration variable name However there is a case that would be interesting to handle, and it is when one has a set of experimental (or simulated) data xk, yk. Here there is no expression defining a function. One way to circumvent this is using as the expression some sort of interpolator such as x = integrate("interp1(xk, yk, x, ''spline'')", "x", x0, x1) This works, but for some reason I don't quite understand it is very slow. For instance, x0 = 0 x1 = 0:0.01:2*%pi; y1 = sin(x1); tic X = integrate("interp1(x1, y1, x, ''spline'')", "x", x0, x1); toc Requires 27 s to execute. In the meantime, control is seemingly returned to the console, one can enter instructions, but then the program freezes until the integrate comand finishes. Changing "spline" to "linear" even worsens it rising to 33 s. Has anybody an idea of what can be happening? Maybe it computes the full interpolator for each single point? Even if so, I have only 629 values of the independent variable. Regards, Federico Miyara -------------- next part -------------- An HTML attachment was scrubbed... URL: From fmiyara at fceia.unr.edu.ar Tue Feb 11 02:37:08 2020 From: fmiyara at fceia.unr.edu.ar (Federico Miyara) Date: Mon, 10 Feb 2020 22:37:08 -0300 Subject: [Scilab-users] undocumented behavior of sum(), prod() and type() In-Reply-To: <5e8a7818-e133-d0c2-03b4-99fe1e6ebadb@free.fr> References: <5f969cca-98fd-4f82-2cf0-eb451e2820b9@fceia.unr.edu.ar> <5e8a7818-e133-d0c2-03b4-99fe1e6ebadb@free.fr> Message-ID: <4ecf33be-890c-3a5d-0e0f-33602448a319@fceia.unr.edu.ar> Thanks, Samuel. This certainly clarifies how [] behaves. But is there a rationale for sum([])==0 and yet cumsum([])==[]? By the way, it would be useful to include cumsum and cumprod among the examples, or at least ensure the respective help pages include that information. Regards, Federico On 09/02/2020 00:40, Samuel Gougeon wrote: > Hello federico, > > The empty page is improved in 6.1.0. Please have a look to > http://bugzilla.scilab.org/15431 > http://bugzilla.scilab.org/attachment.cgi?id=4929 > > Thanks > Samuel > > Le 09/02/2020 ? 04:27, Federico Miyara a ?crit?: >> >> Dear all, >> >> I note that sum([]) yields 0 instead of []. This is somewhat >> contradictory with the documented behavior that [] + n yields [] >> regardless of the type of n >> >> I allso find that prod([]) yields 1. This is even stranger. The >> common feature is that both are the respective neutral element of the >> operations. >> >> Interestingly, cumsum and cumprod applied to [] yield the expected >> result, [] >> >> Besides, type([]) is 1 (constant). Somehow it is asuming an empty >> matrix is by default a container for constants, even in csses such as >> the following: >> >> a = %s >> b = a(1:$-1) >> >> where b is an empty sub-vector of a polynomial vector. >> >> None of these behaviors seem to be documented. If intentional, they >> should be documented. >> >> Regards, >> >> Federico Miyara >> >> _______________________________________________ >> 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephane.mottelet at utc.fr Tue Feb 11 08:17:12 2020 From: stephane.mottelet at utc.fr (=?UTF-8?Q?St=c3=a9phane_Mottelet?=) Date: Tue, 11 Feb 2020 08:17:12 +0100 Subject: [Scilab-users] Command integrate() is too slow under certain expressions In-Reply-To: <79e31a97-9afb-414e-9723-082735e6c903@fceia.unr.edu.ar> References: <79e31a97-9afb-414e-9723-082735e6c903@fceia.unr.edu.ar> Message-ID: Hello, The usual way to compute a primitive would be to use ode, like this: function out=f(x, y, x1, y1, d1) out = interp(x,x1,y1,d1) endfunction x0 = 0 x1 = 0:0.01:2*%pi; y1 = sin(x1); d1 = splin(x1,y1); y = ode(x0,-1,x1,list(f,x1,y1,d1)) Your proposition is very slow because you are recomputing the spline many times. S. Le 10/02/2020 ? 20:52, Federico Miyara a ?crit?: > > Dear all, > > The function integrate() is very handy to obtain a numerical primtive > of a function, particularly useful when there is no closed form for > the primitive or it is too involved. According to the documentation > > x = integrate(expr, v, x0, x1 [, atol [, rtol]]) > > expr: a character string defining a Scilab expression. > v: ?? a character string, the integration variable name > > > However there is a case that would be interesting to handle, and it is > when one has a set of experimental (or simulated) data xk, yk. Here > there is no expression defining a function. > > One way to circumvent this is using as the expression some sort of > interpolator such as > > x = integrate("interp1(xk, yk, x, ''spline'')", "x", x0, x1) > > This works, but for some reason I don't quite understand it is very slow. > > For instance, > > x0 = 0 > x1 = 0:0.01:2*%pi; > y1 = sin(x1); > > tic > X = integrate("interp1(x1, y1, x, ''spline'')", "x", x0, x1); > toc > > Requires 27 s to execute. In the meantime, control is seemingly > returned to the console, one can enter instructions, but then the > program freezes until the integrate comand finishes. > > Changing "spline" to "linear" even worsens it rising to 33 s. > > Has anybody an idea of what can be happening? > > Maybe it computes the full interpolator for each single point? Even if > so, I have only 629 values of the independent variable. > > Regards, > > Federico Miyara > > > > > _______________________________________________ > users mailing list > users at lists.scilab.org > https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephane.mottelet at utc.fr Tue Feb 11 08:23:26 2020 From: stephane.mottelet at utc.fr (=?UTF-8?Q?St=c3=a9phane_Mottelet?=) Date: Tue, 11 Feb 2020 08:23:26 +0100 Subject: [Scilab-users] Command integrate() is too slow under certain expressions In-Reply-To: References: <79e31a97-9afb-414e-9723-082735e6c903@fceia.unr.edu.ar> Message-ID: Sorry the ode call should be (y0 first, then x0) y = ode(-1,x0,x1,list(f,x1,y1,d1)) The elapsed time seems OK: --> tic;y = ode(-1,x0,x1,list(f,x1,y1,d1));toc ?ans? = ?? 0.002235 S. Le 11/02/2020 ? 08:17, St?phane Mottelet a ?crit?: > > Hello, > > The usual way to compute a primitive would be to use ode, like this: > > function out=f(x, y, x1, y1, d1) > out = interp(x,x1,y1,d1) > endfunction > > x0 = 0 > x1 = 0:0.01:2*%pi; > y1 = sin(x1); > > d1 = splin(x1,y1); > > y = ode(x0,-1,x1,list(f,x1,y1,d1)) > Your proposition is very slow because you are recomputing the spline > many times. > > S. > > Le 10/02/2020 ? 20:52, Federico Miyara a ?crit?: >> >> Dear all, >> >> The function integrate() is very handy to obtain a numerical primtive >> of a function, particularly useful when there is no closed form for >> the primitive or it is too involved. According to the documentation >> >> x = integrate(expr, v, x0, x1 [, atol [, rtol]]) >> >> expr: a character string defining a Scilab expression. >> v: ?? a character string, the integration variable name >> >> >> However there is a case that would be interesting to handle, and it >> is when one has a set of experimental (or simulated) data xk, yk. >> Here there is no expression defining a function. >> >> One way to circumvent this is using as the expression some sort of >> interpolator such as >> >> x = integrate("interp1(xk, yk, x, ''spline'')", "x", x0, x1) >> >> This works, but for some reason I don't quite understand it is very slow. >> >> For instance, >> >> x0 = 0 >> x1 = 0:0.01:2*%pi; >> y1 = sin(x1); >> >> tic >> X = integrate("interp1(x1, y1, x, ''spline'')", "x", x0, x1); >> toc >> >> Requires 27 s to execute. In the meantime, control is seemingly >> returned to the console, one can enter instructions, but then the >> program freezes until the integrate comand finishes. >> >> Changing "spline" to "linear" even worsens it rising to 33 s. >> >> Has anybody an idea of what can be happening? >> >> Maybe it computes the full interpolator for each single point? Even >> if so, I have only 629 values of the independent variable. >> >> Regards, >> >> Federico Miyara >> >> >> >> >> _______________________________________________ >> users mailing list >> users at lists.scilab.org >> https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/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 > > _______________________________________________ > users mailing list > users at lists.scilab.org > https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From sgougeon at free.fr Tue Feb 11 11:04:35 2020 From: sgougeon at free.fr (Samuel Gougeon) Date: Tue, 11 Feb 2020 11:04:35 +0100 Subject: [Scilab-users] undocumented behavior of sum(), prod() and type() In-Reply-To: <4ecf33be-890c-3a5d-0e0f-33602448a319@fceia.unr.edu.ar> References: <5f969cca-98fd-4f82-2cf0-eb451e2820b9@fceia.unr.edu.ar> <5e8a7818-e133-d0c2-03b4-99fe1e6ebadb@free.fr> <4ecf33be-890c-3a5d-0e0f-33602448a319@fceia.unr.edu.ar> Message-ID: <4fc589eb-7b65-a7f3-7359-715872fd5c9f@free.fr> Le 11/02/2020 ? 02:37, Federico Miyara a ?crit?: > > Thanks, Samuel. > > This certainly clarifies how [] behaves. But is there a rationale for > sum([])==0 and yet cumsum([])==[]? For sum([])==0 : IMO this is OK. Personnaly, i expect from sum(A) + sum(B) + .. sum(Z) not to be killed just because one of the arguments is []. So, to me, this case is somewhat distinct from the? A +[]. A + [] works element-wise. Because a vector is expected from sum([],"r"), that then would be added in an element-wise way, --> sum([],"r") ?ans? = ??? [] is also OK. I would give the same rationale for prod([])==1. > By the way, it would be useful to include cumsum and cumprod among the > examples, Right Regards Samuel -------------- next part -------------- An HTML attachment was scrubbed... URL: From sgougeon at free.fr Tue Feb 11 11:13:22 2020 From: sgougeon at free.fr (Samuel Gougeon) Date: Tue, 11 Feb 2020 11:13:22 +0100 Subject: [Scilab-users] undocumented behavior of sum(), prod() and type() In-Reply-To: <4ecf33be-890c-3a5d-0e0f-33602448a319@fceia.unr.edu.ar> References: <5f969cca-98fd-4f82-2cf0-eb451e2820b9@fceia.unr.edu.ar> <5e8a7818-e133-d0c2-03b4-99fe1e6ebadb@free.fr> <4ecf33be-890c-3a5d-0e0f-33602448a319@fceia.unr.edu.ar> Message-ID: <57caa612-de5c-a595-4a6f-77edcafa289c@free.fr> Le 11/02/2020 ? 02:37, Federico Miyara a ?crit?: > > .../... > But is there a rationale for sum([])==0 and yet cumsum([])==[]? We expect a scalar from sum([]), while from cumsum([]) we expect an array with the same size than the input array. -------------- next part -------------- An HTML attachment was scrubbed... URL: From arctica1963 at gmail.com Tue Feb 11 13:10:56 2020 From: arctica1963 at gmail.com (arctica1963) Date: Tue, 11 Feb 2020 05:10:56 -0700 (MST) Subject: [Scilab-users] Count specific values in text file Message-ID: <1581423056993-0.post@n3.nabble.com> Hello all, Basic query. I have text files of Pi and e to a million places and I want to scan the number for the occurrences of particular values and the separation of those values in the number. This code snippet works on a vector: // create vector of elements A=[1 2 3 4 5 6 7 8 9 1 1 1 1 1 1 4 4 5 5 5 5 8 8]; // Count number of values, e.g. 1 Val_count1= sum(A==1) disp(Val_count1) // answer 7 I can open the text file with pinum=mopen('pi-million.txt','rt') - but does it need to be changed to a vector where each value is an element?. At the moment the text file is just a single line of numbers (no decimal pint at the start (e.g. 314159...etc). Any pointers would be good. Sorry if this is basic one! Thanks -- Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html From Christophe.Dang at sidel.com Tue Feb 11 13:19:07 2020 From: Christophe.Dang at sidel.com (Dang Ngoc Chan, Christophe) Date: Tue, 11 Feb 2020 12:19:07 +0000 Subject: [Scilab-users] {EXT} Count specific values in text file In-Reply-To: <1581423056993-0.post@n3.nabble.com> References: <1581423056993-0.post@n3.nabble.com> Message-ID: Hello, > De la part de arctica1963 > Envoy? : mardi 11 f?vrier 2020 13:11 > > I have text files of Pi and e to a million places [...] > > I can open the text file with pinum=mopen('pi-million.txt','rt') - but does it > need to be changed to a vector where each value is an element?. At the > moment the text file is just a single line of numbers (no decimal pint at the > start (e.g. 314159...etc). You might have a look at csvRead and csvTextScan https://help.scilab.org/docs/6.0.2/en_US/csvRead.html https://help.scilab.org/docs/6.0.2/en_US/csvTextScan.html Hope this helps, regards -- Christophe Dang Ngoc Chan Mechanical calculation engineer General This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error), please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. From sgougeon at free.fr Tue Feb 11 13:28:44 2020 From: sgougeon at free.fr (Samuel Gougeon) Date: Tue, 11 Feb 2020 13:28:44 +0100 Subject: [Scilab-users] Count specific values in text file In-Reply-To: <1581423056993-0.post@n3.nabble.com> References: <1581423056993-0.post@n3.nabble.com> Message-ID: <657412e3-560e-6932-de63-945d271a56c8@free.fr> Hello, Le 11/02/2020 ? 13:10, arctica1963 a ?crit?: > Hello all, > > Basic query. I have text files of Pi and e to a million places and I want to > scan the number for the occurrences of particular values and the separation > of those values in the number. I am afraid that i do not catch clearly the purpose. Could you post a sample, and the expected result for it? You may also have a look to grep(). Regards Samuel From paul.carrico at auxitrolweston.com Tue Feb 11 13:58:14 2020 From: paul.carrico at auxitrolweston.com (Carrico, Paul) Date: Tue, 11 Feb 2020 12:58:14 +0000 Subject: [Scilab-users] [EXTERNAL] Count specific values in text file In-Reply-To: <1581423056993-0.post@n3.nabble.com> References: <1581423056993-0.post@n3.nabble.com> Message-ID: <3A6B7233274DB449A2A0053A47684F9557F69C25@BGS-EX01.auxitrol.ad> Hi Is that what you're expecting i.e. a way to reshape your matrix among other things ? Paul ################################################## mode(0) A=[1 2 3 4 5 6 7 8 9 1 1 1 1 1 1 4 4 5 5 5 5 8 8]; loc = find(A == 1); occ = size(loc, "*"); printf("Number of occurences = %d",occ); // reshaping B=[1 2 3 4 5 6 7 8 9 1 1 1 ; 1 1 1 4 4 5 5 5 5 8 8 0]; [n,m] = size(B); C = matrix(B,(n*m),1); // then look for your specific values -----Message d'origine----- De?: users [mailto:users-bounces at lists.scilab.org] De la part de arctica1963 Envoy??: mardi 11 f?vrier 2020 13:11 ??: users at lists.scilab.org Objet?: [EXTERNAL] [Scilab-users] Count specific values in text file Hello all, Basic query. I have text files of Pi and e to a million places and I want to scan the number for the occurrences of particular values and the separation of those values in the number. This code snippet works on a vector: // create vector of elements A=[1 2 3 4 5 6 7 8 9 1 1 1 1 1 1 4 4 5 5 5 5 8 8]; // Count number of values, e.g. 1 Val_count1= sum(A==1) disp(Val_count1) // answer 7 I can open the text file with pinum=mopen('pi-million.txt','rt') - but does it need to be changed to a vector where each value is an element?. At the moment the text file is just a single line of numbers (no decimal pint at the start (e.g. 314159...etc). Any pointers would be good. Sorry if this is basic one! Thanks -- Sent from: https://urldefense.com/v3/__http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html__;!!Cn2zSGkVug!dS2Fn2dKbFa5OF5GfEkOTNYlP5qA1dPf0ClsKnbfRbq7V6EWja6b9vP-OaWfFOX5zIqjbi3g$ _______________________________________________ users mailing list users at lists.scilab.org https://urldefense.com/v3/__http://lists.scilab.org/mailman/listinfo/users__;!!Cn2zSGkVug!dS2Fn2dKbFa5OF5GfEkOTNYlP5qA1dPf0ClsKnbfRbq7V6EWja6b9vP-OaWfFOX5zLxxkxMH$ From perrichon.pierre at wanadoo.fr Tue Feb 11 15:00:43 2020 From: perrichon.pierre at wanadoo.fr (Perrichon) Date: Tue, 11 Feb 2020 15:00:43 +0100 Subject: [Scilab-users] Sampling in the CSCOPE component - Last sample - Bugzilla 16322 Message-ID: Hello Last sample time is missed in a CSOPE componant W10- x64-scilab 6.1.0 See bugzilla #16322 Best regards -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image003.jpg Type: image/jpeg Size: 22033 bytes Desc: not available URL: From p.muehlmann at gmail.com Tue Feb 11 15:40:50 2020 From: p.muehlmann at gmail.com (P M) Date: Tue, 11 Feb 2020 15:40:50 +0100 Subject: [Scilab-users] [EXTERNAL] Count specific values in text file In-Reply-To: <3A6B7233274DB449A2A0053A47684F9557F69C25@BGS-EX01.auxitrol.ad> References: <1581423056993-0.post@n3.nabble.com> <3A6B7233274DB449A2A0053A47684F9557F69C25@BGS-EX01.auxitrol.ad> Message-ID: Hi, is this what you're looking for? // path to the txt filepath = 'pathToFile' // read the file as stringpiAsString = csvRead(path, [],['.'],'string') // split the string at the decimal[piAsString] = strsplit(piAsString,'.'); // just get the digitspiDigits = strtod(strsplit(piAsString(2))); // search: how often does appears a certain value in a specific range within the digitssearchRange = 100;searchVal = 1; [locations] = find(piDigits(1:searchRange) == searchVal); printf("The number %d appears %d times in the first %d digits of Pi\n",searchVal,length(locations),searchRange) ;printf("The number %d appears at following locations: \n", searchVal);disp(locations'); Best regards, Philipp -------------- next part -------------- An HTML attachment was scrubbed... URL: From fmiyara at fceia.unr.edu.ar Tue Feb 11 18:31:44 2020 From: fmiyara at fceia.unr.edu.ar (Federico Miyara) Date: Tue, 11 Feb 2020 14:31:44 -0300 Subject: [Scilab-users] undocumented behavior of sum(), prod() and type() In-Reply-To: <57caa612-de5c-a595-4a6f-77edcafa289c@free.fr> References: <5f969cca-98fd-4f82-2cf0-eb451e2820b9@fceia.unr.edu.ar> <5e8a7818-e133-d0c2-03b4-99fe1e6ebadb@free.fr> <4ecf33be-890c-3a5d-0e0f-33602448a319@fceia.unr.edu.ar> <57caa612-de5c-a595-4a6f-77edcafa289c@free.fr> Message-ID: <0f9a431a-d279-9b48-292f-8ccf5887ace8@fceia.unr.edu.ar> Samuel: Sounds reasonable! Thanks, Federico On 11/02/2020 07:13, Samuel Gougeon wrote: > Le 11/02/2020 ? 02:37, Federico Miyara a ?crit?: >> >> .../... >> But is there a rationale for sum([])==0 and yet cumsum([])==[]? > > > We expect a scalar from sum([]), while from cumsum([]) we expect an > array with the same size than the input array. > > > > _______________________________________________ > users mailing list > users at lists.scilab.org > http://lists.scilab.org/mailman/listinfo/users -------------- next part -------------- An HTML attachment was scrubbed... URL: From fmiyara at fceia.unr.edu.ar Wed Feb 12 01:54:17 2020 From: fmiyara at fceia.unr.edu.ar (Federico Miyara) Date: Tue, 11 Feb 2020 21:54:17 -0300 Subject: [Scilab-users] Command integrate() is too slow under certain expressions In-Reply-To: References: <79e31a97-9afb-414e-9723-082735e6c903@fceia.unr.edu.ar> Message-ID: <6c5b1612-4bb0-da18-6540-5bd9532a9d93@fceia.unr.edu.ar> St?phane, Thanks for your solution. I've found another solution that is even slightly faster: I've modified the function intsplin(), changing both instances of sum by cumsum (and some formal details), so the same interpolator is used for the whole set of data. Regards, Federico Miyara On 11/02/2020 04:23, St?phane Mottelet wrote: > > Sorry the ode call should be (y0 first, then x0) > > y = ode(-1,x0,x1,list(f,x1,y1,d1)) > > The elapsed time seems OK: > > --> tic;y = ode(-1,x0,x1,list(f,x1,y1,d1));toc > ?ans? = > > ?? 0.002235 > > S. > > Le 11/02/2020 ? 08:17, St?phane Mottelet a ?crit?: >> >> Hello, >> >> The usual way to compute a primitive would be to use ode, like this: >> >> function out=f(x, y, x1, y1, d1) >> out = interp(x,x1,y1,d1) >> endfunction >> >> x0 = 0 >> x1 = 0:0.01:2*%pi; >> y1 = sin(x1); >> >> d1 = splin(x1,y1); >> >> y = ode(x0,-1,x1,list(f,x1,y1,d1)) >> Your proposition is very slow because you are recomputing the spline >> many times. >> >> S. >> >> Le 10/02/2020 ? 20:52, Federico Miyara a ?crit?: >>> >>> Dear all, >>> >>> The function integrate() is very handy to obtain a numerical >>> primtive of a function, particularly useful when there is no closed >>> form for the primitive or it is too involved. According to the >>> documentation >>> >>> x = integrate(expr, v, x0, x1 [, atol [, rtol]]) >>> >>> expr: a character string defining a Scilab expression. >>> v: ?? a character string, the integration variable name >>> >>> >>> However there is a case that would be interesting to handle, and it >>> is when one has a set of experimental (or simulated) data xk, yk. >>> Here there is no expression defining a function. >>> >>> One way to circumvent this is using as the expression some sort of >>> interpolator such as >>> >>> x = integrate("interp1(xk, yk, x, ''spline'')", "x", x0, x1) >>> >>> This works, but for some reason I don't quite understand it is very >>> slow. >>> >>> For instance, >>> >>> x0 = 0 >>> x1 = 0:0.01:2*%pi; >>> y1 = sin(x1); >>> >>> tic >>> X = integrate("interp1(x1, y1, x, ''spline'')", "x", x0, x1); >>> toc >>> >>> Requires 27 s to execute. In the meantime, control is seemingly >>> returned to the console, one can enter instructions, but then the >>> program freezes until the integrate comand finishes. >>> >>> Changing "spline" to "linear" even worsens it rising to 33 s. >>> >>> Has anybody an idea of what can be happening? >>> >>> Maybe it computes the full interpolator for each single point? Even >>> if so, I have only 629 values of the independent variable. >>> >>> Regards, >>> >>> Federico Miyara >>> >>> >>> >>> >>> _______________________________________________ >>> users mailing list >>> users at lists.scilab.org >>> https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/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 >> >> _______________________________________________ >> users mailing list >> users at lists.scilab.org >> https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/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 > > _______________________________________________ > users mailing list > users at lists.scilab.org > http://lists.scilab.org/mailman/listinfo/users -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab // Copyright (C) INRIA // Copyright (C) 2017 - Samuel GOUGEON // // Copyright (C) 2012 - 2016 - Scilab Enterprises // // This file is hereby licensed under the terms of the GNU GPL v2.0, // pursuant to article 5.3.4 of the CeCILL v.2.1. // This file was originally licensed under the terms of the CeCILL v2.1, // and continues to be available under such terms. // For more information, see the COPYING file which you should have received // along with this program. function v = intsplin_cum(x, s) //splin numerical integration. //v = intsplin(x,s) computes the integral of y with respect to x using //splin interpolation and integration. //x and y must be vectors of the same dimension // //v = intsplin(s) computes the integral of y assuming unit //spacing between the data points. x = x(:); if argn(2) < 2 then s = x; x = (1:size(s,"*"))'; else s = s(:); if size(x,"*")<>size(s,"*") then msg = _("%s: Wrong size for input arguments: Same size expected.\n") error(msprintf(msg, "intsplin")); end end if ~isreal(x) then if isreal(x,%eps) x = real(x); else msg = _("%s: Argument #%d: Real number(s) expected.\n"); error(msprintf(msg, "intsplin",1)) end end h = x(2:$) - x(1:$-1); y = real(s); d = splin(x, y); v = cumsum((h.*(d(1:$-1)-d(2:$))/12 + (y(1:$-1)+y(2:$))/2).*h); if ~and(imag(s)==0) then y = imag(s); d = splin(x, y); v = v + %i*cumsum((h.*(d(1:$-1)-d(2:$))/12 + (y(1:$-1)+y(2:$))/2).*h); end v = [0; v]; endfunction From arctica1963 at gmail.com Wed Feb 12 08:57:23 2020 From: arctica1963 at gmail.com (arctica1963) Date: Wed, 12 Feb 2020 00:57:23 -0700 (MST) Subject: [Scilab-users] [EXTERNAL] Count specific values in text file In-Reply-To: References: <1581423056993-0.post@n3.nabble.com> <3A6B7233274DB449A2A0053A47684F9557F69C25@BGS-EX01.auxitrol.ad> Message-ID: <1581494243846-0.post@n3.nabble.com> Hello Philipp Your suggestion is kind of what I am trying to do, but the text file is not a CSV structure. It is just a single, very big number on one row. A small chunk: 31415926535897932384626433832795028841971693993751058209749445923078164 etc (no spaces between digits) How best to load the text file and then count the number of occurrences of a specific digit (e.g. 1)? At the moment the file essentially contains a very big integer. Interested to see the best method of doing this. Thanks -- Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html From p.muehlmann at gmail.com Wed Feb 12 09:46:45 2020 From: p.muehlmann at gmail.com (P M) Date: Wed, 12 Feb 2020 09:46:45 +0100 Subject: [Scilab-users] [EXTERNAL] Count specific values in text file In-Reply-To: <1581494243846-0.post@n3.nabble.com> References: <1581423056993-0.post@n3.nabble.com> <3A6B7233274DB449A2A0053A47684F9557F69C25@BGS-EX01.auxitrol.ad> <1581494243846-0.post@n3.nabble.com> Message-ID: Hi, Option 1: You manually put a "." inside the file and run the script. Since you only mentioned "pi" and "e" it's little efford. Option 2: You still can use csvRead even without having a "." as separator. Note: Search range adapted to count only in digits behind the decimal sign. You may change as you wish. Best regards, Philipp // path to the txt filepath = 'pathToFile'// read the file as stringpiAsString = csvRead(path, [],[],'string')// split the string at '' (use no token) [piAsString] = strsplit(piAsString,'');// convert string to doublepiDigits = strtod(piAsString);// search: how often appears a certain value in a specific range within the digitssearchRange = 100;searchVal = 1;// adapt the range, to search only places behind the decimal sign [locations] = find(piDigits(2:searchRange+1) == searchVal);// uncomment if wished// printf("location \t number\n");// for i= 2:searchRange+1// printf("%d \t %d \n", i-1, piDigits(i));// endprintf("The number %d appears %d times in the first %d digits of Pi\n",searchVal,length(locations),searchRange) ;printf("The number %d appears at following locations: \n", searchVal);disp(locations'); Am Mi., 12. Feb. 2020 um 08:57 Uhr schrieb arctica1963 < arctica1963 at gmail.com>: > Hello Philipp > > Your suggestion is kind of what I am trying to do, but the text file is not > a CSV structure. It is just a single, very big number on one row. A small > chunk: > > 31415926535897932384626433832795028841971693993751058209749445923078164 etc > (no spaces between digits) > > How best to load the text file and then count the number of occurrences of > a > specific digit (e.g. 1)? At the moment the file essentially contains a very > big integer. > > Interested to see the best method of doing this. > > Thanks > > > > > > -- > Sent from: > http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html > _______________________________________________ > users mailing list > users at lists.scilab.org > http://lists.scilab.org/mailman/listinfo/users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From chinluh.tan at bytecode-asia.com Wed Feb 12 09:35:47 2020 From: chinluh.tan at bytecode-asia.com (Chin Luh Tan) Date: Wed, 12 Feb 2020 16:35:47 +0800 Subject: [Scilab-users] [EXTERNAL] Count specific values in text file In-Reply-To: <1581494243846-0.post@n3.nabble.com> References: <1581423056993-0.post@n3.nabble.com> <3A6B7233274DB449A2A0053A47684F9557F69C25@BGS-EX01.auxitrol.ad> <1581494243846-0.post@n3.nabble.com> Message-ID: <170388a3724.114b8bf63333197.2842344709924870690@bytecode-asia.com> Hi, tabul function might help. sample data download from?https://thestarman.pcministry.com/math/pi/picalcs.htm unzip the?https://thestarman.pcministry.com/math/pi/df/pimultdp.zip following lines do the "counting" job.? have not tried the millions decimal places, good luck. --> data = mgetl('PI25K_DP.TXT'); --> data2=strsplit(data); --> tabul(data2) ans? = ?????? ans(1) !9? ! !?? ! !8? ! !?? ! !7? ! !?? ! !6? ! !?? ! !5? ! !?? ! !4? ! !?? ! !3? ! !?? ! !2? ! !?? ! !1? ! !?? ! !0? ! ?????? ans(2) ?? 2509. ?? 2465. ?? 2480. ?? 2541. ?? 2567. ?? 2549. ?? 2491. ?? 2403. ?? 2519. ?? 2476. ---- On Wed, 12 Feb 2020 15:57:23 +0800 arctica1963 wrote ---- Hello Philipp Your suggestion is kind of what I am trying to do, but the text file is not a CSV structure. It is just a single, very big number on one row. A small chunk: 31415926535897932384626433832795028841971693993751058209749445923078164 etc (no spaces between digits) How best to load the text file and then count the number of occurrences of a specific digit (e.g. 1)? At the moment the file essentially contains a very big integer. Interested to see the best method of doing this. Thanks -- Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html _______________________________________________ users mailing list mailto:users at lists.scilab.org http://lists.scilab.org/mailman/listinfo/users -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: smile.png Type: image/png Size: 1470 bytes Desc: not available URL: From sgougeon at free.fr Wed Feb 12 10:12:15 2020 From: sgougeon at free.fr (Samuel Gougeon) Date: Wed, 12 Feb 2020 10:12:15 +0100 Subject: [Scilab-users] [EXTERNAL] Count specific values in text file In-Reply-To: <1581494243846-0.post@n3.nabble.com> References: <1581423056993-0.post@n3.nabble.com> <3A6B7233274DB449A2A0053A47684F9557F69C25@BGS-EX01.auxitrol.ad> <1581494243846-0.post@n3.nabble.com> Message-ID: Le 12/02/2020 ? 08:57, arctica1963 a ?crit?: > Hello Philipp > > Your suggestion is kind of what I am trying to do, but the text file is not > a CSV structure. It is just a single, very big number on one row. A small > chunk: > > 31415926535897932384626433832795028841971693993751058209749445923078164 etc > (no spaces between digits) > > How best to load the text file and then count the number of occurrences of a > specific digit (e.g. 1)? At the moment the file essentially contains a very > big integer. --> t = "31415926535897932384626433832795028841971693993751058209749445923078164"; --> length(regexp(t,"/1/")) ?ans? = ?? 6. --> length(regexp(t,"/41/")) ?ans? = ?? 2. From arctica1963 at gmail.com Wed Feb 12 12:31:56 2020 From: arctica1963 at gmail.com (arctica1963) Date: Wed, 12 Feb 2020 04:31:56 -0700 (MST) Subject: [Scilab-users] [EXTERNAL] Count specific values in text file In-Reply-To: References: <1581423056993-0.post@n3.nabble.com> <3A6B7233274DB449A2A0053A47684F9557F69C25@BGS-EX01.auxitrol.ad> <1581494243846-0.post@n3.nabble.com> Message-ID: <1581507116098-0.post@n3.nabble.com> Hi Philipp, Your script works fine using csvRead. One odd thing. Tested a few files with pi, and ones with >= 500,000 gave an error: csvRead: can not read file pi-million.txt: Error in the column structure. (same for 500,000), but worked with 250,000? Not sure if this an internal bug/limit in csvRead. Thanks for the pointers everyone Lester -- Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html From amonmayr at laas.fr Wed Feb 12 13:00:42 2020 From: amonmayr at laas.fr (Antoine Monmayrant) Date: Wed, 12 Feb 2020 13:00:42 +0100 Subject: [Scilab-users] =?utf-8?b?Pz09P3V0Zi04P3E/ID89PT91dGYtOD9xPyBbRVhU?= =?utf-8?q?ERNAL=5D__Count_specific_values_in_text_file?= In-Reply-To: <1581507116098-0.post@n3.nabble.com> Message-ID: <8b9-5e43e900-b-6cfef10@97806017> Hello Lester, Could this be related to http://bugzilla.scilab.org/show_bug.cgi?id=15788 ? Which version of scilab are you using (the bug above was fixed in 6.0.2)? Antoine Le Mercredi, F?vrier 12, 2020 12:31 CET, arctica1963 a ?crit: ?Hi Philipp, Your script works fine using csvRead. One odd thing. Tested a few files with pi, and ones with >= 500,000 gave an error: csvRead: can not read file pi-million.txt: Error in the column structure. (same for 500,000), but worked with 250,000? Not sure if this an internal bug/limit in csvRead. Thanks for the pointers everyone Lester -- Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html _______________________________________________ users mailing list users at lists.scilab.org http://lists.scilab.org/mailman/listinfo/users ? ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From arctica1963 at gmail.com Wed Feb 12 15:15:33 2020 From: arctica1963 at gmail.com (arctica1963) Date: Wed, 12 Feb 2020 07:15:33 -0700 (MST) Subject: [Scilab-users] ?==?utf-8?q? ?==?utf-8?q? [EXTERNAL] Count specific values in text file In-Reply-To: <8b9-5e43e900-b-6cfef10@97806017> References: <1581423056993-0.post@n3.nabble.com> <3A6B7233274DB449A2A0053A47684F9557F69C25@BGS-EX01.auxitrol.ad> <1581494243846-0.post@n3.nabble.com> <1581507116098-0.post@n3.nabble.com> <8b9-5e43e900-b-6cfef10@97806017> Message-ID: <1581516933290-0.post@n3.nabble.com> Hello Antoine I am using version 6.0.2. Not sure if it is the same issue as there is only one line in the file, but a lot of digits to handle. The error message is not exactly clear. Lester -- Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html From amonmayr at laas.fr Wed Feb 12 16:26:23 2020 From: amonmayr at laas.fr (Antoine Monmayrant) Date: Wed, 12 Feb 2020 16:26:23 +0100 Subject: [Scilab-users] =?utf-8?b?Pz09P3V0Zi04P3E/ID89PT91dGYtOD9xPyA/PSBl?= In-Reply-To: <1581516933290-0.post@n3.nabble.com> Message-ID: <66f1-5e441900-3b-5fe76a00@226782375> Hello Lester, Could you: (1) Share the file so that we can try & see whether we can reproduce the bug? (2) Share a minimum working example that shows the bug / no bug depending on the lenght of the file? This could help us confirm/report a bug. Cheers, Antoine Le Mercredi, F?vrier 12, 2020 15:15 CET, arctica1963 a ?crit: ?Hello Antoine I am using version 6.0.2. Not sure if it is the same issue as there is only one line in the file, but a lot of digits to handle. The error message is not exactly clear. Lester -- Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html _______________________________________________ users mailing list users at lists.scilab.org http://lists.scilab.org/mailman/listinfo/users ? ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.s.strom at hslmg.de Wed Feb 12 16:19:25 2020 From: j.s.strom at hslmg.de (Jens Simon Strom) Date: Wed, 12 Feb 2020 16:19:25 +0100 Subject: [Scilab-users] Polyline markers cycling through selected colors Message-ID: Hallo Scilab experts, The script below should color the markers in a cyclic manner. It does - however only temporary! What should be changed? I would like to keep the plot command off the loop. Kind regards Jens xdel() x=1:15; y=x; COLO=[5 3 2 1]//selction of color IDs ncol=length(COLO); plot(%nan,%nan)//initialize axes ca=gca();//get handle for i=1:15 colo=modulo(i+ncol-1,ncol)+1;//i mapped to cyclic indices ca.children.children.data=[x(i),y(i)]; ca.children.children.mark_mode = "on"; ca.children.children.mark_style = 4; ca.children.children.mark_size = 25; ca.children.children.mark_foreground = COLO(colo); //set(ca,"auto_clear","off"); sleep(500) end //End of Skript -------------- next part -------------- An HTML attachment was scrubbed... URL: From arctica1963 at gmail.com Wed Feb 12 16:40:45 2020 From: arctica1963 at gmail.com (arctica1963) Date: Wed, 12 Feb 2020 08:40:45 -0700 (MST) Subject: [Scilab-users] =?utf-8?b?Pz0gID89PT91dGYtOD9xPyBl?= In-Reply-To: <66f1-5e441900-3b-5fe76a00@226782375> References: <1581423056993-0.post@n3.nabble.com> <3A6B7233274DB449A2A0053A47684F9557F69C25@BGS-EX01.auxitrol.ad> <1581494243846-0.post@n3.nabble.com> <1581507116098-0.post@n3.nabble.com> <8b9-5e43e900-b-6cfef10@97806017> <1581516933290-0.post@n3.nabble.com> <66f1-5e441900-3b-5fe76a00@226782375> Message-ID: <1581522045800-0.post@n3.nabble.com> PI250KDP.TXT PI500KDP.TXT clear // path to the txt file path = 'PI250KDP.txt' // read the file as string piAsString = csvRead(path, [],[],'string') // split the string at '' (use no token) [piAsString] = strsplit(piAsString,''); // convert string to double piDigits = strtod(piAsString); // search: how often appears a certain value in a specific range within the digits searchRange = 10000; searchVal = 1; // adapt the range, to search only places behind the decimal sign [locations] = find(piDigits(1:searchRange+1) == searchVal); // small tweak here printf("The number %d appears %d times in the first %d digits of Pi\n",searchVal,length(locations),searchRange) ; printf("The number %d appears at following locations: \n", searchVal); disp(locations'); The 250K file works; the 500k file fails -- Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html From chinluh.tan at bytecode-asia.com Wed Feb 12 17:02:47 2020 From: chinluh.tan at bytecode-asia.com (Chin Luh Tan) Date: Thu, 13 Feb 2020 00:02:47 +0800 Subject: [Scilab-users] ?= ?==?utf-8?q? e In-Reply-To: <1581522045800-0.post@n3.nabble.com> References: <1581423056993-0.post@n3.nabble.com> <3A6B7233274DB449A2A0053A47684F9557F69C25@BGS-EX01.auxitrol.ad> <1581494243846-0.post@n3.nabble.com> <1581507116098-0.post@n3.nabble.com> <8b9-5e43e900-b-6cfef10@97806017> <1581516933290-0.post@n3.nabble.com> <66f1-5e441900-3b-5fe76a00@226782375> <1581522045800-0.post@n3.nabble.com> Message-ID: <1703a237832.d426840b420834.1924702607600515718@bytecode-asia.com> to add on, it might not just affect csvRead, but also others file IO functions as well: how to reproduce: // Not OK a = ones(1,300000); b = strcat(string(a)); mputl(b,'test.txt'); c = mgetl('test.txt'); then a is 250,000 mgetl get the string correctly, but when a is 300,000, it return empty string. on the other hand, file in single column of data working fine.? // OK a = ones(1,300000); b = string(a); mputl(b,'test.txt'); c = mgetl('test.txt'); thanks. rgds, CL ---- On Wed, 12 Feb 2020 23:40:45 +0800 arctica1963 wrote ---- PI250KDP.TXT PI500KDP.TXT clear // path to the txt file path = 'PI250KDP.txt' // read the file as string piAsString = csvRead(path, [],[],'string') // split the string at '' (use no token) [piAsString] = strsplit(piAsString,''); // convert string to double piDigits = strtod(piAsString); // search: how often appears a certain value in a specific range within the digits searchRange = 10000; searchVal = 1; // adapt the range, to search only places behind the decimal sign [locations] = find(piDigits(1:searchRange+1) == searchVal); // small tweak here printf("The number %d appears %d times in the first %d digits of Pi\n",searchVal,length(locations),searchRange) ; printf("The number %d appears at following locations: \n", searchVal); disp(locations'); The 250K file works; the 500k file fails -- Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html _______________________________________________ users mailing list mailto:users at lists.scilab.org http://lists.scilab.org/mailman/listinfo/users -------------- next part -------------- An HTML attachment was scrubbed... URL: From ltjudd at bigpond.com Mon Feb 10 16:28:07 2020 From: ltjudd at bigpond.com (Lloyd Judd) Date: Tue, 11 Feb 2020 02:28:07 +1100 (AEDT) Subject: [Scilab-users] ?==?utf-8?q? plotting a function that changes with x In-Reply-To: References: <2121283e.14761.17028f38b16.Webtop.94@bigpond.com> <7242-5e3fd200-19-73337e80@66224873> Message-ID: <33076450.124dd3.1702fb7007b.Webtop.97@bigpond.com> Merci Phillip,Antoine, Now I have something very close to what I am looking for Thanks for your help regards Lloyd ------ Original Message ------ From: "P M" To: "Users mailing list for Scilab" Sent: Monday, 10 Feb, 2020 At 9:46 AM Subject: Re: [Scilab-users] ?==?utf-8?q? plotting a function that changes with x Hi, with the if-loop-approach you probably thought about this: x=(0:1:72) for i=1:length(x) ? ?if ((x(i)<18) == %T) ? ? ? ? ? ? ? ? ? // elementwise comparison ? ? ? ?then y(i) = sin(x(i)*%pi/24) ? ?else ? ? ? ?y(i)= 0.1*x(i) ? ?end end plot2d(x,y,2)However it's a if-loop within a for loop... Best regards, Philipp Am So., 9. Feb. 2020 um 10:34?Uhr schrieb Antoine Monmayrant >: Hello, I think that (x>18) is not doing what you think it does. See below two options to define? y piecewise. Hope it helps, Antoine ---------------------- //your code clf ? x=(0:1:72) // here you x<18 is not what your think (it's a boolean vector) if x<18 then y = sin(x*%pi/24) else ? ? ?y= 0.1*x end plot2d(x,y,2) // two options // using the fact that x>18 is converted into // 1 when the condition is true // 0 when the condition is false y2 =? sin(x*%pi/24).*(x>18) + 0.1*x.*(x<=18); plot(x,y2,"ro"); // using a range of indices & find y3=0.1*x; inds=find(x>18); y3(inds)=sin(x(inds)*%pi/24); plot(x,y3,"g"); ---------------------- Le Dimanche, F?vrier 09, 2020 08:56 CET, Lloyd Judd > a ?crit: > Hello,? > I am trying make a plot, the function of which changes depending on the > value of x,. What I am really trying to do is to simulate solar panel > out put where it roughly follows a sine? function during daylight but is > basically zero from sunset to sunrise, and then later overlay that with > the demand curve. But I am still experimenting with the code at this > stage. > ?I tried all different ways;? using the "function" command and the "plot > 2d" command . It only ever seems? to plot the last argument in the "if > then else" statement. > For example with this code; > clf >? ? x=(0:1:72) >? ?if x<18 >? ? ? ?then y = sin(x*%pi/24) >? ?else >? ? ? ?y= 0.1*x >? ? end >? ?plot2d(x,y,2)it only plots? the y=0.1x partConversely if I put the > sine function under the "else" statement, it only plots the? sin > function.clfx=(0:1:72) > if x<18 then >? ? ? y=0.01*x > else >? ? ? y=sin(x*%pi/24) > end >? ?plot2d(x,y,2)What is the best way to plot a function that changes > depending on the range of x?Thanks and regardsLloyd Judd > _______________________________________________ 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Capture truncated sine curve.JPG Type: image/jpeg Size: 121905 bytes Desc: not available URL: From clement.david at scilab.org Wed Feb 12 14:30:52 2020 From: clement.david at scilab.org (=?UTF-8?Q?Cl=C3=A9ment_DAVID?=) Date: Wed, 12 Feb 2020 06:30:52 -0700 (MST) Subject: [Scilab-users] [EXTERNAL] Count specific values in text file In-Reply-To: <1581507116098-0.post@n3.nabble.com> References: <1581423056993-0.post@n3.nabble.com> <3A6B7233274DB449A2A0053A47684F9557F69C25@BGS-EX01.auxitrol.ad> <1581494243846-0.post@n3.nabble.com> <1581507116098-0.post@n3.nabble.com> Message-ID: <1581514252002-0.post@n3.nabble.com> Hi all, Nice challenge, I have a simple answer to display an histogram (with 10 classes) of the PI digits stored in a pi.txt file (without any dot separator): F="pi.txt"; fd = mopen(F, 'r'); histplot(ascii(strcat(string(0:9))), mget(fileinfo(F)(1), "c", fd)); mclose(fd); The idea is to read the file using mget() and store each ascii value into a vector. These data are plot as a histogram of "0" to "9" ascii value. -- Cl?ment -- Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html From arctica1963 at gmail.com Thu Feb 13 12:31:36 2020 From: arctica1963 at gmail.com (arctica1963) Date: Thu, 13 Feb 2020 04:31:36 -0700 (MST) Subject: [Scilab-users] 2D Density plot Message-ID: <1581593496495-0.post@n3.nabble.com> Hello all, I was wondering if it is possible to generate a 2D density plot from scattered data to highlight areas with a higher concentration of points compared to others? The image shows a subsidence plot with theoretical curves and real data overlaid. It would be nice to have a way to colour the density of points, but leave areas with zero density blank. In GIS software (e.g. ArcMap or QGIS) this would be defined using a "Heatmap" based on a search radius around each data point. Any ideas? Thanks -- Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html From stephane.mottelet at utc.fr Thu Feb 13 13:06:35 2020 From: stephane.mottelet at utc.fr (=?UTF-8?Q?St=c3=a9phane_Mottelet?=) Date: Thu, 13 Feb 2020 13:06:35 +0100 Subject: [Scilab-users] 2D Density plot In-Reply-To: <1581593496495-0.post@n3.nabble.com> References: <1581593496495-0.post@n3.nabble.com> Message-ID: Hello, You could estimate your density by using kernels https://en.wikipedia.org/wiki/Kernel_density_estimation and then sample the continuous density to assign a value to each point. S. Le 13/02/2020 ? 12:31, arctica1963 a ?crit?: > Hello all, > > I was wondering if it is possible to generate a 2D density plot from > scattered data to highlight areas with a higher concentration of points > compared to others? > > > > The image shows a subsidence plot with theoretical curves and real data > overlaid. It would be nice to have a way to colour the density of points, > but leave areas with zero density blank. > > In GIS software (e.g. ArcMap or QGIS) this would be defined using a > "Heatmap" based on a search radius around each data point. > > Any ideas? > Thanks > > > > > -- > Sent from: https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html > _______________________________________________ > users mailing list > users at lists.scilab.org > https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/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 antoine.monmayrant at laas.fr Thu Feb 13 13:15:05 2020 From: antoine.monmayrant at laas.fr (Antoine Monmayrant) Date: Thu, 13 Feb 2020 13:15:05 +0100 Subject: [Scilab-users] ?= ?==?utf-8?q? e In-Reply-To: <1703a237832.d426840b420834.1924702607600515718@bytecode-asia.com> References: <1581423056993-0.post@n3.nabble.com> <3A6B7233274DB449A2A0053A47684F9557F69C25@BGS-EX01.auxitrol.ad> <1581494243846-0.post@n3.nabble.com> <1581507116098-0.post@n3.nabble.com> <8b9-5e43e900-b-6cfef10@97806017> <1581516933290-0.post@n3.nabble.com> <66f1-5e441900-3b-5fe76a00@226782375> <1581522045800-0.post@n3.nabble.com> <1703a237832.d426840b420834.1924702607600515718@bytecode-asia.com> Message-ID: Well, that sounds like a bug! Could you report it? Cheers, Antoine Le 12/02/2020 ? 17:02, Chin Luh Tan a ?crit?: > to add on, it might not just affect csvRead, but also others file IO > functions as well: > > how to reproduce: > > // Not OK > a = ones(1,300000); > b = strcat(string(a)); > mputl(b,'test.txt'); > c = mgetl('test.txt'); > > > then a is 250,000 mgetl get the string correctly, but when a is > 300,000, it return empty string. > > on the other hand, file in single column of data working fine. > > // OK > a = ones(1,300000); > b = string(a); > mputl(b,'test.txt'); > c = mgetl('test.txt'); > > thanks. > > rgds, > CL > > > ---- On Wed, 12 Feb 2020 23:40:45 +0800 *arctica1963 > * wrote ---- > > PI250KDP.TXT > > PI500KDP.TXT > > > clear > // path to the txt file > path = 'PI250KDP.txt' > // read the file as string > piAsString = csvRead(path, [],[],'string') > // split the string at '' (use no token) > [piAsString] = strsplit(piAsString,''); > // convert string to double > piDigits = strtod(piAsString); > // search: how often appears a certain value in a specific range > within the > digits > searchRange = 10000; > searchVal = 1; > // adapt the range, to search only places behind the decimal sign > [locations] = find(piDigits(1:searchRange+1) == searchVal); // > small tweak > here > printf("The number %d appears %d times in the first %d digits of > Pi\n",searchVal,length(locations),searchRange) ; > printf("The number %d appears at following locations: \n", > searchVal); > disp(locations'); > > The 250K file works; the 500k file fails > > > > -- > Sent from: > http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html > > _______________________________________________ > 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From chinluh.tan at bytecode-asia.com Thu Feb 13 14:17:58 2020 From: chinluh.tan at bytecode-asia.com (Chin Luh Tan) Date: Thu, 13 Feb 2020 21:17:58 +0800 Subject: [Scilab-users] 3D ?=3D=3D?utf-8?q? e?= In-Reply-To: References: <1581423056993-0.post@n3.nabble.com> <3A6B7233274DB449A2A0053A47684F9557F69C25@BGS-EX01.auxitrol.ad> <1581494243846-0.post@n3.nabble.com> <1581507116098-0.post@n3.nabble.com> <8b9-5e43e900-b-6cfef10@97806017> <1581516933290-0.post@n3.nabble.com> <66f1-5e441900-3b-5fe76a00@226782375> <1581522045800-0.post@n3.nabble.com> <1703a237832.d426840b420834.1924702607600515718@bytecode-asia.com> Message-ID: <1703eb2ed3e.12a5f33e9577170.5645072327273435602@bytecode-asia.com> sure, here it is: http://bugzilla.scilab.org/show_bug.cgi?id=16325 rgds, CL ---- On Thu, 13 Feb 2020 20:15:05 +0800 Antoine Monmayrant wrote ---- Well, that sounds like a bug! Could you report it? Cheers, Antoine Le 12/02/2020 ? 17:02, Chin Luh Tan a ?crit?: _______________________________________________ users mailing list users at lists.scilab.org http://lists.scilab.org/mailman/listinfo/users to add on, it might not just affect csvRead, but also others file IO functions as well: how to reproduce: // Not OK a = ones(1,300000); b = strcat(string(a)); mputl(b,'test.txt'); c = mgetl('test.txt'); then a is 250,000 mgetl get the string correctly, but when a is 300,000, it return empty string. on the other hand, file in single column of data working fine.? // OK a = ones(1,300000); b = string(a); mputl(b,'test.txt'); c = mgetl('test.txt'); thanks. rgds, CL ---- On Wed, 12 Feb 2020 23:40:45 +0800 arctica1963 mailto:arctica1963 at gmail.com wrote ---- PI250KDP.TXT PI500KDP.TXT clear // path to the txt file path = 'PI250KDP.txt' // read the file as string piAsString = csvRead(path, [],[],'string') // split the string at '' (use no token) [piAsString] = strsplit(piAsString,''); // convert string to double piDigits = strtod(piAsString); // search: how often appears a certain value in a specific range within the digits searchRange = 10000; searchVal = 1; // adapt the range, to search only places behind the decimal sign [locations] = find(piDigits(1:searchRange+1) == searchVal); // small tweak here printf("The number %d appears %d times in the first %d digits of Pi\n",searchVal,length(locations),searchRange) ; printf("The number %d appears at following locations: \n", searchVal); disp(locations'); The 250K file works; the 500k file fails -- Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html _______________________________________________ users mailing list mailto:users at lists.scilab.org http://lists.scilab.org/mailman/listinfo/users _______________________________________________ users mailing list mailto:users at lists.scilab.org http://lists.scilab.org/mailman/listinfo/users -------------- next part -------------- An HTML attachment was scrubbed... URL: From perrichon.pierre at wanadoo.fr Thu Feb 13 23:08:50 2020 From: perrichon.pierre at wanadoo.fr (Perrichon) Date: Thu, 13 Feb 2020 23:08:50 +0100 Subject: [Scilab-users] Request for information - Release of Scilab for version 6.1 Message-ID: Hello, I actually work with Scilab 5.5.2 For the next version 6.1.0, I have to plan my interventions and warn customers. I plan at least 2 months of work for my part at least. Can I announce July 2020? Or more? Could we know more? Here is my basic scheme, with 30 algos per machine (10 machines). Big work I suppose. Sincerely Pierre P. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image002.jpg Type: image/jpeg Size: 20062 bytes Desc: not available URL: From apchar123 at outlook.com Sat Feb 15 21:58:20 2020 From: apchar123 at outlook.com (apchar boiir) Date: Sat, 15 Feb 2020 20:58:20 +0000 Subject: [Scilab-users] Has anyone interfaced scilab/xcos with the RTL Software defined radio dongle ? Message-ID: There's a popular (meaning cheap) software defined radio receiver on a USB dongle called the RTL SDR. Has anyone interfaced it or anything like it to scilab/xcos. It would be a blast to stream data from this device into xcos and play with DSP. Matlab has it but you're looking at $300 of software just to get started. I'll take a crack at it (it's all opensource) if no one else has but no sense reinventing the wheel. I don't see anything in the atoms list. Are there any hooks in scilab to interface with hardware? -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephane.mottelet at utc.fr Wed Feb 19 21:14:17 2020 From: stephane.mottelet at utc.fr (=?UTF-8?Q?St=c3=a9phane_Mottelet?=) Date: Wed, 19 Feb 2020 21:14:17 +0100 Subject: [Scilab-users] opportunity of merging cov() and covar() Message-ID: Hi all, Within the development team we recently had a discussion about the improvement of cov() in terms of speed and memory requirement and about the opportunity of merging cov() and covar() wich are two disctinct macros. Since we did not manage to reach a consensus we thought it could be the occasion to have the opinion of members of this list which have a recognized academical/research knowledge in probability and statistics. Here are some elements to start the discussion. Let us start with covar() macro and what it actually computes: * covar() Let us start with a definition of covariance in general: https://fr.wikipedia.org/wiki/Covariance#D%C3%A9finition_de_la_covariance and with an example there: https://en.wikipedia.org/wiki/Covariance#Example In the two above links scalar/real variables are considered and in the second link discrete random variables are considered. In the example the covariance is computed knowing the possible values and their joint density. You can easily check in the source of covar() (type "edit covar") that, after normalizing the matrix of joint probabilities (named "frequencies" in the source), the macro computes the same value, which is confirmed by the result of the following statements: --> x=[1 2];y=[1 2 3];fre = [1/4 1/4 0;0 1/4 1/4];covar(x,y,fre) ?ans? = ?? 0.25 Please note that covar() output is always a scalar. Now let us consider cov(): * cov() Here is a definition of the covariance matrix: https://en.wikipedia.org/wiki/Covariance_matrix Here we consider vectors of random variables (not scalar random variables) and in this case the covariance is a matrix. When there is no a priori knowledge on these variables (when the joint density is not known, typically), the best you can do is, when you have samples of this random vector, is to compute an estimation of the covariance matrix, see e.g. he following page: https://en.wikipedia.org/wiki/Estimation_of_covariance_matrices You can verify in actual code of cov() that this macro computes the same estimation (sums are vectorized). We can summarize these facts this way: * covar(x,y,fre) computes the scalar covariance of two discrete random variables knowing their possible values x(:) and y(:) and their joint probability density * When x is a matrix, cov(x) computes an estimator of the covariance matrix of a vector X of size(x,2) random variables by using size(x,1) samples of this vector (each x(i,:) is a sample). if x and y are vectors of the same size, cov(x,y) is computed as cov([x(:) y(:)]). To me, the main difference is that covar(x,y,fre) does not compute an _estimator_but a _exact value_. Of course, the vectors x and y can be the unique value of two random variables, gathered from samples (x,y) and "fre" be the empirical frequency of samples (x_i,y_j). In this case covar() will compute an estimation. For example, consider the two random variables X and Y, where X takes values {1,2} with equal probability, and Y=X+U where U takes values {0,1} with equal probability. We can use covar() to compute the exact covariance of X and Y, but if we only have samples, like in the below script, if we want to estimate the covariance with the same macro, then unique pairs have to be found and occurences counted in order to estimate the frequency : N=1000; x=ceil(rand(N,1)*2); y=x+floor(rand(N,1)*2); [pairs,k]=unique(gsort([x y],'lr','i'),'r'); f=diff([k;N+1])/N; freq=sparse(pairs,f) N/(N-1)*covar(1:2,1:3,freq) cov(x,y) If you have a look to the results, --> freq ?freq? = ?? 0.2526?? 0.2489?? 0. ?? 0.?????? 0.2453?? 0.2532 --> N/(N-1)*covar(1:2,1:3,freq) ?ans? = ?? 0.249769 --> cov(x,y) ?ans? = ?? 0.2500182?? 0.249769 ?? 0.249769??? 0.4995447 you can see that 1. we have considered the same random variables as in the example https://en.wikipedia.org/wiki/Covariance#Example 2. covar's output (up to the normalization to correct the bias) gives the off diagonal term of cov(x,y) So, yes, off diagonal term of cov(x,y) and covar(x,y,fre) (up to unique pairs determination, computation of "fre" and bias correction) have the same value, but is it a reason to merge the two functions. I think that the answer is NO. If you agree or disagree, feel free to continue the discussion in this thread. S. -- 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From fmiyara at fceia.unr.edu.ar Thu Feb 20 02:58:01 2020 From: fmiyara at fceia.unr.edu.ar (Federico Miyara) Date: Wed, 19 Feb 2020 22:58:01 -0300 Subject: [Scilab-users] opportunity of merging cov() and covar() In-Reply-To: References: Message-ID: <28f454d4-adc8-efc0-e595-c1bf29bcf93a@fceia.unr.edu.ar> St?phane, My first argument in favor of keeping covar and cov as separate functions is that often what one needs is the covariance between two potentially correlated signals regardless of their individual variances, so it seems somewhat inefficient to compute essentially three covariances (two of them between two equal signals) when it is only one of them what one wants to calculate. However, the syntax of covar should have an option to process the signals directly instead of their statistics (values and joint frequencies): covar(x,y) My second argument seems to be the opposite of my pevious request: covar(x,y,fre) is a quite different function since the input information is presented in a different way, which is valuable when one happens to have the information in such fashion. Regards, Federico Miyara On 19/02/2020 17:14, St?phane Mottelet wrote: > > Hi all, > > Within the development team we recently had a discussion about the > improvement of cov() in terms of speed and memory requirement and > about the opportunity of merging cov() and covar() wich are two > disctinct macros. Since we did not manage to reach a consensus we > thought it could be the occasion to have the opinion of members of > this list which have a recognized academical/research knowledge in > probability and statistics. Here are some elements to start the > discussion. Let us start with covar() macro and what it actually computes: > > * covar() > > Let us start with a definition of covariance in general: > > https://fr.wikipedia.org/wiki/Covariance#D%C3%A9finition_de_la_covariance > > and with an example there: > > https://en.wikipedia.org/wiki/Covariance#Example > > In the two above links scalar/real variables are considered and in the > second link discrete random variables are considered. In the example > the covariance is computed knowing the possible values and their joint > density. You can easily check in the source of covar() (type "edit > covar") that, after normalizing the matrix of joint probabilities > (named "frequencies" in the source), the macro computes the same > value, which is confirmed by the result of the following statements: > > --> x=[1 2];y=[1 2 3];fre = [1/4 1/4 0;0 1/4 1/4];covar(x,y,fre) > ?ans? = > > ?? 0.25 > > Please note that covar() output is always a scalar. Now let us > consider cov(): > > * cov() > > Here is a definition of the covariance matrix: > > https://en.wikipedia.org/wiki/Covariance_matrix > > Here we consider vectors of random variables (not scalar random > variables) and in this case the covariance is a matrix. When there is > no a priori knowledge on these variables (when the joint density is > not known, typically), the best you can do is, when you have samples > of this random vector, is to compute an estimation of the covariance > matrix, see e.g. he following page: > > https://en.wikipedia.org/wiki/Estimation_of_covariance_matrices > > You can verify in actual code of cov() that this macro computes the > same estimation (sums are vectorized). > > We can summarize these facts this way: > > * covar(x,y,fre) computes the scalar covariance of two discrete random > variables knowing their possible values x(:) and y(:) and their joint > probability density > > * When x is a matrix, cov(x) computes an estimator of the covariance > matrix of a vector X of size(x,2) random variables by using size(x,1) > samples of this vector (each x(i,:) is a sample). if x and y are > vectors of the same size, cov(x,y) is computed as cov([x(:) y(:)]). > > To me, the main difference is that covar(x,y,fre) does not compute an > _estimator_but a _exact value_. Of course, the vectors x and y can be > the unique value of two random variables, gathered from samples (x,y) > and "fre" be the empirical frequency of samples (x_i,y_j). In this > case covar() will compute an estimation. For example, consider the two > random variables X and Y, where X takes values {1,2} with equal > probability, and Y=X+U where U takes values {0,1} with equal > probability. We can use covar() to compute the exact covariance of X > and Y, but if we only have samples, like in the below script, if we > want to estimate the covariance with the same macro, then unique pairs > have to be found and occurences counted in order to estimate the > frequency : > > N=1000; > x=ceil(rand(N,1)*2); > y=x+floor(rand(N,1)*2); > > [pairs,k]=unique(gsort([x y],'lr','i'),'r'); > f=diff([k;N+1])/N; > > freq=sparse(pairs,f) > N/(N-1)*covar(1:2,1:3,freq) > cov(x,y) > > If you have a look to the results, > > --> freq > ?freq? = > > ?? 0.2526?? 0.2489?? 0. > ?? 0.?????? 0.2453?? 0.2532 > > --> N/(N-1)*covar(1:2,1:3,freq) > ?ans? = > > ?? 0.249769 > > --> cov(x,y) > ?ans? = > > ?? 0.2500182?? 0.249769 > ?? 0.249769??? 0.4995447 > > you can see that > > 1. we have considered the same random variables as in the example > https://en.wikipedia.org/wiki/Covariance#Example > 2. covar's output (up to the normalization to correct the bias) gives > the off diagonal term of cov(x,y) > > So, yes, off diagonal term of cov(x,y) and covar(x,y,fre) (up to > unique pairs determination, computation of "fre" and bias correction) > have the same value, but is it a reason to merge the two functions. I > think that the answer is NO. > > If you agree or disagree, feel free to continue the discussion in this > thread. > > S. > > -- > 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From perrichon.pierre at wanadoo.fr Fri Feb 21 18:45:29 2020 From: perrichon.pierre at wanadoo.fr (Perrichon) Date: Fri, 21 Feb 2020 18:45:29 +0100 Subject: [Scilab-users] Palette Builder failed with scilab 6.1.0 nightly build - Bugzilla #16332 Message-ID: Hello, I created several years ago my palette SEGPAL for additional components in XCOS, using Scilab 5.5.2 W10 x64 This library very well run Now, I try to recompile it using Scilab 6.1.0 nightly build, but the buider.sce failed and I don"t know how tu continue PS : For the C files, I use gcc version 4.6.3 See bugzilla #16332 for attached file (SEGPAL library) I get errors : --> exec('C:\SEGPAL\SegPal\builder.sce', -1) Cr?ation des macros... -- Cr?ation de [SegPallib] (Macros) -- genlib : Traitement du fichier : CLRseg.sci genlib : Traitement du fichier : DerFil.sci genlib : Traitement du fichier : EdgeTrigger.sci genlib : Traitement du fichier : IntHyd.sci genlib : Traitement du fichier : IntLim.sci genlib : Traitement du fichier : IntSuiv.sci genlib : Traitement du fichier : IntegralInt.sci genlib : Traitement du fichier : Memo.sci genlib : Traitement du fichier : PSB.sci genlib : Traitement du fichier : PSBsuiv.sci genlib : Traitement du fichier : PlusInt.sci genlib : Traitement du fichier : Pow.sci genlib : Traitement du fichier : RampJet.sci genlib : Traitement du fichier : Rampe.sci genlib : Traitement du fichier : Satur.sci genlib : Traitement du fichier : Step2.sci genlib : Traitement du fichier : TempoTrig.sci genlib : Traitement du fichier : Time_Delay.sci Cr?ation des blocs... Cr?ation des sources... ? la ligne 57 de la fonction detectmsvc64tools ( C:\Program Files\scilab-branch-master\modules\dynamic_link\macros\detectmsvc64tools.sci ligne 71 ) ? la ligne 4 de la fonction dlwHaveCompiler ( C:\Program Files\scilab-branch-master\modules\dynamic_link\macros\windows\dlwHaveCompil er.sci ligne 17 ) ? la ligne 7 de la fonction haveacompiler ( C:\Program Files\scilab-branch-master\modules\dynamic_link\macros\haveacompiler.sci ligne 20 ) ? la ligne 38 de la fonction tbx_builder_src ( C:\Program Files\scilab-branch-master\modules\modules_manager\macros\tbx_builder_src.sc i ligne 55 ) ? la ligne 35 de la fonction main_builder ( C:\SEGPAL\SegPal\builder.sce ligne 43 ) ? la ligne 51 du fichier ex?cut? C:\SEGPAL\SegPal\builder.sce Variable non d?finie : dlwIsVc11Express Best regards Pierre P. -------------- next part -------------- An HTML attachment was scrubbed... URL: From antoine.elias at scilab-enterprises.com Fri Feb 21 18:55:19 2020 From: antoine.elias at scilab-enterprises.com (Antoine ELIAS) Date: Fri, 21 Feb 2020 18:55:19 +0100 Subject: [Scilab-users] Palette Builder failed with scilab 6.1.0 nightly build - Bugzilla #16332 In-Reply-To: References: Message-ID: Oops my bad o/ I removed support for some very old versions of VS/VC but it seems I forgot some references. Thank you to report, I will fix that soon. Regards, Antoine Le 21/02/2020 ? 18:45, Perrichon a ?crit?: > > Hello, > > I created several years ago my palette SEGPAL for additional > components in XCOS, using Scilab 5.5.2 W10 x64 > > This library very well run > > Now, I try to recompile it using Scilab 6.1.0 nightly build, but the > buider.sce failed and I don"t know how tu continue > > PS : For the C files, I use gcc version 4.6.3 > > See bugzilla #16332 for attached file (SEGPAL library) > > I get errors?: > > --> exec('C:\SEGPAL\SegPal\builder.sce', -1) > > Cr?ation des macros... > > -- Cr?ation de [SegPallib] (Macros) -- > > genlib : Traitement du fichier : CLRseg.sci > > genlib : Traitement du fichier : DerFil.sci > > genlib : Traitement du fichier : EdgeTrigger.sci > > genlib : Traitement du fichier : IntHyd.sci > > genlib : Traitement du fichier : IntLim.sci > > genlib : Traitement du fichier : IntSuiv.sci > > genlib : Traitement du fichier : IntegralInt.sci > > genlib : Traitement du fichier : Memo.sci > > genlib : Traitement du fichier : PSB.sci > > genlib : Traitement du fichier : PSBsuiv.sci > > genlib : Traitement du fichier : PlusInt.sci > > genlib : Traitement du fichier : Pow.sci > > genlib : Traitement du fichier : RampJet.sci > > genlib : Traitement du fichier : Rampe.sci > > genlib : Traitement du fichier : Satur.sci > > genlib : Traitement du fichier : Step2.sci > > genlib : Traitement du fichier : TempoTrig.sci > > genlib : Traitement du fichier : Time_Delay.sci > > Cr?ation des blocs... > > Cr?ation des sources... > > ? la ligne??? 57 de la fonction detectmsvc64tools ( C:\Program > Files\scilab-branch-master\modules\dynamic_link\macros\detectmsvc64tools.sci > ligne 71 ) > > ? la ligne???? 4 de la fonction dlwHaveCompiler?? ( C:\Program > Files\scilab-branch-master\modules\dynamic_link\macros\windows\dlwHaveCompiler.sci > ligne 17 ) > > ? la ligne???? 7 de la fonction haveacompiler???? ( C:\Program > Files\scilab-branch-master\modules\dynamic_link\macros\haveacompiler.sci > ligne 20 ) > > ? la ligne??? 38 de la fonction tbx_builder_src?? ( C:\Program > Files\scilab-branch-master\modules\modules_manager\macros\tbx_builder_src.sci > ligne 55 ) > > ? la ligne??? 35 de la fonction main_builder????? ( > C:\SEGPAL\SegPal\builder.sce ligne 43 ) > > ? la ligne??? 51 du fichier ex?cut? C:\SEGPAL\SegPal\builder.sce > > Variable non d?finie : dlwIsVc11Express > > Best regards > > Pierre P. > > > _______________________________________________ > users mailing list > users at lists.scilab.org > http://lists.scilab.org/mailman/listinfo/users -------------- next part -------------- An HTML attachment was scrubbed... URL: From suzana.uran at um.si Tue Feb 25 09:41:09 2020 From: suzana.uran at um.si (Suzana Uran) Date: Tue, 25 Feb 2020 09:41:09 +0100 Subject: [Scilab-users] how to integrate Scilab into Moodle - options and experiences Message-ID: <001801d5ebb7$57198350$054c89f0$@uran@um.si> Hi all, I'm interested in integration of Scilab with Learning Management System (LMS) Moodle. Because Moodle is a LMS used by our university (University of Maribor, Slovenia). I would be very glad if you could provide me examples of good praxis and your experiences on this topics. Best regards, Uran Suzana, FERI, University of Maribor -------------- next part -------------- An HTML attachment was scrubbed... URL: From arctica1963 at gmail.com Tue Feb 25 10:35:08 2020 From: arctica1963 at gmail.com (arctica1963) Date: Tue, 25 Feb 2020 02:35:08 -0700 (MST) Subject: [Scilab-users] Line integrals Message-ID: <1582623308328-0.post@n3.nabble.com> Hello all, I am interested in doing line integrals on f(x,y) and f(x,y,z) for scalar and vector calculations. It is not an issue to do mathematically, but not so clear in Scilab how variable substitution should work in this process. As I understand it, one has to take the function and convert it to a parametric form in x,y,(z) in order to reduce the integrand to a single variable (e.g. t) that can be integrated simply. Now, clearly it is not a problem to do the substitutions by hand and then run the Scilab function (Integrate), but nice to simplify the procedure. For the integral over a path (C) of f(x,y) ds, x and y have to be parametric e.g. x(t) and y(t), where ds = sqrt( (dx(t)/dt)^2 + (dy(t)/dt)^2 ) dt Is there a simple route to solve line integrals in Scilab or building a function to do this? e.g. LineIntegral(expr,x(t),y(t),t,a,b), where x(t) and y(t) are the parametric forms. A very simple problem: f(x,y) = 2*x with x(t)=t/2 and y(t)=t^2 for t=0 to 6 Substitution for x and y and solving the integral over t should result in 144.36 approx. Any pointers would be useful. Could not see any reference in the mailing list or help on this. Thanks Lester -- Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html From stephane.mottelet at utc.fr Tue Feb 25 12:25:13 2020 From: stephane.mottelet at utc.fr (=?UTF-8?Q?St=c3=a9phane_Mottelet?=) Date: Tue, 25 Feb 2020 12:25:13 +0100 Subject: [Scilab-users] Line integrals In-Reply-To: <1582623308328-0.post@n3.nabble.com> References: <1582623308328-0.post@n3.nabble.com> Message-ID: Hello, You can use intg, once you have forged the correct function of the parameter: function out=parabola(t) out = [t/2;t^2]; endfunction function out=my_f(M) out = 2*M(1); endfunction function out=line_int(a, b, curve, f) function out=fun(t, f, curve) dcurve = imag(curve(t+%eps*%i))/%eps; out = f(curve(t))*norm(dcurve) end out = intg(a,b,list(fun,f,curve)) endfunction --> line_int(0,6,parabola,my_f) ?ans? = ?? 144.36474604669 The derivative of the curve w.r.t. the parameter is computed by using the complex step. S. Le 25/02/2020 ? 10:35, arctica1963 a ?crit?: > Hello all, > > I am interested in doing line integrals on f(x,y) and f(x,y,z) for scalar > and vector calculations. > > It is not an issue to do mathematically, but not so clear in Scilab how > variable substitution should work in this process. As I understand it, one > has to take the function and convert it to a parametric form in x,y,(z) in > order to reduce the integrand to a single variable (e.g. t) that can be > integrated simply. > > Now, clearly it is not a problem to do the substitutions by hand and then > run the Scilab function (Integrate), but nice to simplify the procedure. > > For the integral over a path (C) of f(x,y) ds, x and y have to be parametric > e.g. x(t) and y(t), > where ds = sqrt( (dx(t)/dt)^2 + (dy(t)/dt)^2 ) dt > > Is there a simple route to solve line integrals in Scilab or building a > function to do this? > e.g. LineIntegral(expr,x(t),y(t),t,a,b), where x(t) and y(t) are the > parametric forms. > > A very simple problem: > > f(x,y) = 2*x with x(t)=t/2 and y(t)=t^2 for t=0 to 6 > Substitution for x and y and solving the integral over t should result in > 144.36 approx. > > Any pointers would be useful. Could not see any reference in the mailing > list or help on this. > > Thanks > Lester > > > > -- > Sent from: https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html > _______________________________________________ > users mailing list > users at lists.scilab.org > https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Clement.David at esi-group.com Tue Feb 25 14:10:28 2020 From: Clement.David at esi-group.com (=?iso-8859-1?Q?Cl=E9ment_David?=) Date: Tue, 25 Feb 2020 13:10:28 +0000 Subject: [Scilab-users] Scilab 6.1.0 is available! Message-ID: Dear Scilab-ers, A brand new Scilab 6.1.0 is released today! This version includes further improvement atop Scilab 6.0 for better stability and increased algorithm performance. It also includes a reworked display for more compact and meaningful value printing; web tools for HTTP, JSON support; better debug support and various algorithm rewrite/extension. This first iteration of the 6.1 branch fixes up to 245 bugs and implements missing features from the 6.0.2 version. We would like to give a special thanks to Samuel and Stephane who have been very active this year. If you find any critical issue or instability that might need a 6.1.x release please alert us. If you are a toolbox maintainer, please rebuild your code, upgrade it when needed and publish it to atoms.scilab.org. For the complete list of changes and bugs fixed, please take a look at the CHANGES file. -- Cl?ment on behalf of the Scilab team -------------- next part -------------- An HTML attachment was scrubbed... URL: From samuel.enibe at unn.edu.ng Tue Feb 25 14:39:18 2020 From: samuel.enibe at unn.edu.ng (Samuel Enibe) Date: Tue, 25 Feb 2020 14:39:18 +0100 Subject: [Scilab-users] Scilab 6.1.0 is available! In-Reply-To: References: Message-ID: This is good news indeed. We have been looking forward to this release. Thanks to all of you working behind the scenes. God bless you. Samuel Enibe On Tue, 25 Feb 2020, 14:11 Cl?ment David, wrote: > Dear Scilab-ers, > > > > A brand new Scilab 6.1.0 is > released today! > > > > This version includes further improvement atop Scilab 6.0 for better > stability and increased algorithm performance. It also includes a reworked > display for more compact and meaningful value printing; web tools for HTTP, > JSON support; better debug support and various algorithm rewrite/extension. > > > > This first iteration of the 6.1 branch fixes up to 245 bugs and implements > missing features from the 6.0.2 version. We would like to give a special > thanks to Samuel and Stephane who have been very active this year. > > > > If you find any critical issue or instability that might need a 6.1.x > release please alert us . If you are a > toolbox maintainer, please rebuild your code, upgrade it when needed and > publish it to atoms.scilab.org. > > > > For the complete list of changes and bugs fixed, please take a look at the > CHANGES file. > > > > -- > > Cl?ment on behalf of the Scilab team > _______________________________________________ > users mailing list > users at lists.scilab.org > http://lists.scilab.org/mailman/listinfo/users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cfuttrup at gmail.com Tue Feb 25 16:37:09 2020 From: cfuttrup at gmail.com (Claus Futtrup) Date: Tue, 25 Feb 2020 16:37:09 +0100 Subject: [Scilab-users] Scilab 6.1.0 is available! In-Reply-To: References: Message-ID: <36d46ce0-6528-c251-0cae-c05fa32ba44c@gmail.com> Congratulations! Don't forget to announce on LinkedIn, so I can give it a thumbs up. https://www.linkedin.com/groups/3688414/ Cheers, Claus On 25.02.2020 14:10, Cl?ment David wrote: > > Dear Scilab-ers, > > A brand new Scilab 6.1.0 is > released today! > > This version includes further improvement atop Scilab 6.0 for better > stability and increased algorithm performance. It also includes a > reworked display for more compact and meaningful value printing; web > tools for HTTP, JSON support; better debug support and various > algorithm rewrite/extension. > > This first iteration of the 6.1 branch fixes up to 245 bugs and > implements missing features from the 6.0.2 version. We would like to > give a special thanks to Samuel and Stephane who have been very active > this year. > > If you find any critical issue or instability that might need a 6.1.x > release please alert us . If you are a > toolbox maintainer, please rebuild your code, upgrade it when needed > and publish it to atoms.scilab.org . > > For the complete list of changes and bugs fixed, please take a look at > the CHANGES ? file. > > -- > > Cl?ment on behalf of the Scilab team > > > _______________________________________________ > users mailing list > users at lists.scilab.org > http://lists.scilab.org/mailman/listinfo/users -------------- next part -------------- An HTML attachment was scrubbed... URL: From heinznabielek at me.com Tue Feb 25 16:51:58 2020 From: heinznabielek at me.com (Heinz Nabielek) Date: Tue, 25 Feb 2020 16:51:58 +0100 Subject: [Scilab-users] Scilab 6.1.0 is available! In-Reply-To: References: Message-ID: And where is the Mac version? Heinz > On 25.02.2020, at 14:10, Cl?ment David wrote: > > Dear Scilab-ers, > > A brand new Scilab 6.1.0 is released today! > > This version includes further improvement atop Scilab 6.0 for better stability and increased algorithm performance. It also includes a reworked display for more compact and meaningful value printing; web tools for HTTP, JSON support; better debug support and various algorithm rewrite/extension. > > This first iteration of the 6.1 branch fixes up to 245 bugs and implements missing features from the 6.0.2 version. We would like to give a special thanks to Samuel and Stephane who have been very active this year. > > If you find any critical issue or instability that might need a 6.1.x release please alert us. If you are a toolbox maintainer, please rebuild your code, upgrade it when needed and publish it to atoms.scilab.org. > > For the complete list of changes and bugs fixed, please take a look at the CHANGES file. > > -- > Cl?ment on behalf of the Scilab team > _______________________________________________ > users mailing list > users at lists.scilab.org > http://lists.scilab.org/mailman/listinfo/users From perrichon.pierre at wanadoo.fr Tue Feb 25 16:56:53 2020 From: perrichon.pierre at wanadoo.fr (Perrichon) Date: Tue, 25 Feb 2020 16:56:53 +0100 Subject: [Scilab-users] several problems with xcos scilab 6.1.0 Message-ID: Hello, Even if it is minor, apparently somebody has decided to define the time simulation to 30 s by default. Why ? I don't know Before, it was 1.0E05 s and I stop the simulation with the END box in my main scheme. (to avoid user to go on this menu and choose another solver, at least). (choose is Newton for me , so the default one) So I've hundred shemes to see And this is not the first surprise. Others tests don't work anymore I can do tests to correct that, but it was not foreseen. I still believe to go on with 6.1.0 but keep aware because not so clear with xcos Pierre P. -------------- next part -------------- An HTML attachment was scrubbed... URL: From perrichon.pierre at wanadoo.fr Tue Feb 25 17:03:47 2020 From: perrichon.pierre at wanadoo.fr (Perrichon) Date: Tue, 25 Feb 2020 17:03:47 +0100 Subject: [Scilab-users] several problems with xcos scilab 6.1.0 Message-ID: For Kaplan turbine time simulation is 600s at least. Why the default time is 30 s ? Please program it at + infinity that is 10000000 s. De : Perrichon Envoy? : mardi 25 f?vrier 2020 16:57 ? : 'Users mailing list for Scilab' Objet : several problems with xcos scilab 6.1.0 Hello, Even if it is minor, apparently somebody has decided to define the time simulation to 30 s by default. Why ? I don?t know Before, it was 1.0E05 s and I stop the simulation with the END box in my main scheme. (to avoid user to go on this menu and choose another solver, at least). (choose is Newton for me , so the default one) So I?ve hundred shemes to see And this is not the first surprise. Others tests don?t work anymore I can do tests to correct that, but it was not foreseen. I still believe to go on with 6.1.0 but keep aware because not so clear with xcos Pierre P. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Clement.David at esi-group.com Tue Feb 25 17:09:08 2020 From: Clement.David at esi-group.com (=?utf-8?B?Q2zDqW1lbnQgRGF2aWQ=?=) Date: Tue, 25 Feb 2020 16:09:08 +0000 Subject: [Scilab-users] Scilab 6.1.0 is available! In-Reply-To: References: Message-ID: Hello Heinz, The macOS version is still in progress, we don't have any access to a macOS machine anymore and there are hard issues reported by Stephane (a hard crash in GUI mode, the required JVM installation, a non-signed packaging, at least...). So yes, we rely on the community (and especially Stephane) to ship a macOS binary; if you are willing to help, please contact him and keep in mind that it is a very complex task. Note: this was also the case for Scilab 6.0.0 to 6.0.2. Regards, -- Cl?ment > -----Original Message----- > From: Heinz Nabielek > Sent: Tuesday, February 25, 2020 4:52 PM > To: Users mailing list for Scilab ; Cl?ment David > > Cc: List dedicated to the development of Scilab > Subject: Re: [Scilab-users] Scilab 6.1.0 is available! > > And where is the Mac version? > Heinz > > > > > > On 25.02.2020, at 14:10, Cl?ment David > wrote: > > > > Dear Scilab-ers, > > > > A brand new Scilab 6.1.0 is released today! > > > > This version includes further improvement atop Scilab 6.0 for better stability > and increased algorithm performance. It also includes a reworked display for > more compact and meaningful value printing; web tools for HTTP, JSON support; > better debug support and various algorithm rewrite/extension. > > > > This first iteration of the 6.1 branch fixes up to 245 bugs and implements > missing features from the 6.0.2 version. We would like to give a special thanks > to Samuel and Stephane who have been very active this year. > > > > If you find any critical issue or instability that might need a 6.1.x release please > alert us. If you are a toolbox maintainer, please rebuild your code, upgrade it > when needed and publish it to atoms.scilab.org. > > > > For the complete list of changes and bugs fixed, please take a look at the > CHANGES file. > > > > -- > > Cl?ment on behalf of the Scilab team > > _______________________________________________ > > users mailing list > > users at lists.scilab.org > > http://lists.scilab.org/mailman/listinfo/users From Clement.David at esi-group.com Tue Feb 25 17:26:04 2020 From: Clement.David at esi-group.com (=?iso-8859-1?Q?Cl=E9ment_David?=) Date: Tue, 25 Feb 2020 16:26:04 +0000 Subject: [Scilab-users] several problems with xcos scilab 6.1.0 In-Reply-To: References: Message-ID: Hello Pierre, This change was introduced 6 months ago and is coherent to the default scope window for a beginner. This is the default settings that apply only to any new schema, for any saved Xcos diagram the previous value should be preserved; if not please report a bug. Note: while investigating your issue, I tested the Xcos preferences and it failed to set up a default final simulation time; this is a bug reported at http://bugzilla.scilab.org/show_bug.cgi?id=16336 Regards, -- Cl?ment From: users On Behalf Of Perrichon Sent: Tuesday, February 25, 2020 5:04 PM To: 'Users mailing list for Scilab' Subject: Re: [Scilab-users] several problems with xcos scilab 6.1.0 For Kaplan turbine time simulation is 600s at least. Why the default time is 30 s ? Please program it at + infinity that is 10000000 s. De : Perrichon > Envoy? : mardi 25 f?vrier 2020 16:57 ? : 'Users mailing list for Scilab' > Objet : several problems with xcos scilab 6.1.0 Hello, Even if it is minor, apparently somebody has decided to define the time simulation to 30 s by default. Why ? I don't know Before, it was 1.0E05 s and I stop the simulation with the END box in my main scheme. (to avoid user to go on this menu and choose another solver, at least). (choose is Newton for me , so the default one) So I've hundred shemes to see And this is not the first surprise. Others tests don't work anymore I can do tests to correct that, but it was not foreseen. I still believe to go on with 6.1.0 but keep aware because not so clear with xcos Pierre P. -------------- next part -------------- An HTML attachment was scrubbed... URL: From heinznabielek at me.com Tue Feb 25 17:54:30 2020 From: heinznabielek at me.com (Heinz Nabielek) Date: Tue, 25 Feb 2020 17:54:30 +0100 Subject: [Scilab-users] Scilab 6.1.0 is available! In-Reply-To: References: Message-ID: <7BAC7D5E-F78B-48A3-8F89-13D52CFB1CC9@me.com> Thanks ? Greetings from Heinz > On 25.02.2020, at 17:09, Cl?ment David wrote: > > Hello Heinz, > > The macOS version is still in progress, we don't have any access to a macOS machine anymore and there are hard issues reported by Stephane (a hard crash in GUI mode, the required JVM installation, a non-signed packaging, at least...). So yes, we rely on the community (and especially Stephane) to ship a macOS binary; if you are willing to help, please contact him and keep in mind that it is a very complex task. > > Note: this was also the case for Scilab 6.0.0 to 6.0.2. > > Regards, > > -- > Cl?ment > >> -----Original Message----- >> From: Heinz Nabielek >> Sent: Tuesday, February 25, 2020 4:52 PM >> To: Users mailing list for Scilab ; Cl?ment David >> >> Cc: List dedicated to the development of Scilab >> Subject: Re: [Scilab-users] Scilab 6.1.0 is available! >> >> And where is the Mac version? >> Heinz >> >> >> >> >>> On 25.02.2020, at 14:10, Cl?ment David >> wrote: >>> >>> Dear Scilab-ers, >>> >>> A brand new Scilab 6.1.0 is released today! >>> >>> This version includes further improvement atop Scilab 6.0 for better stability >> and increased algorithm performance. It also includes a reworked display for >> more compact and meaningful value printing; web tools for HTTP, JSON support; >> better debug support and various algorithm rewrite/extension. >>> >>> This first iteration of the 6.1 branch fixes up to 245 bugs and implements >> missing features from the 6.0.2 version. We would like to give a special thanks >> to Samuel and Stephane who have been very active this year. >>> >>> If you find any critical issue or instability that might need a 6.1.x release please >> alert us. If you are a toolbox maintainer, please rebuild your code, upgrade it >> when needed and publish it to atoms.scilab.org. >>> >>> For the complete list of changes and bugs fixed, please take a look at the >> CHANGES file. >>> >>> -- >>> Cl?ment on behalf of the Scilab team >>> _______________________________________________ >>> users mailing list >>> users at lists.scilab.org >>> http://lists.scilab.org/mailman/listinfo/users > From perrichon.pierre at wanadoo.fr Tue Feb 25 20:11:58 2020 From: perrichon.pierre at wanadoo.fr (Perrichon) Date: Tue, 25 Feb 2020 20:11:58 +0100 Subject: [Scilab-users] Scilab 6.1.0 - MinGW Message-ID: Hello Many Thanks to Antoine for reintroducing MinGW tools in atom pack and plug, after all discussions on email and phone last week-end, for compiling palette in xcos with no errors and no warnings in c++. Include files are ok now (.h) Buider is ok. After other problems to discuss. BR Pierre P. -------------- next part -------------- An HTML attachment was scrubbed... URL: From antisenam at gmail.com Wed Feb 26 04:14:58 2020 From: antisenam at gmail.com (Antisen A M) Date: Wed, 26 Feb 2020 08:44:58 +0530 Subject: [Scilab-users] simulink model to xcos Message-ID: Hi, is there a import function available to convert simulink model to xcos model? Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From chinluh.tan at bytecode-asia.com Wed Feb 26 05:56:37 2020 From: chinluh.tan at bytecode-asia.com (Chin Luh Tan) Date: Wed, 26 Feb 2020 12:56:37 +0800 Subject: [Scilab-users] Scilab 6.1 - Possible GUI Bug Message-ID: <1707fda98b1.1277b57b9757463.8274870039387235086@bytecode-asia.com> Hi,? When trying to update guibuilder for Scilab 6.1, I notice that the figure menu is not able to be remove with "delmenu" when the "dockable" is set to "off". How to reproduce: Scenario 1: Menu "File" will not be removed --> f1 = figure("dockable", "off") --> delmenu(f1.figure_id, gettext("File")); Scenario 2: Menu "File" will be removed -->f1 = figure("dockable", "on") -->delmenu(f1.figure_id, gettext("File")); Current workaround:? -->f1 = figure("dockable", "on") -->delmenu(f1.figure_id, gettext("File")); -->f1.dockable = "off"; thanks. rgds, CL -------------- next part -------------- An HTML attachment was scrubbed... URL: From chinluh.tan at bytecode-asia.com Wed Feb 26 06:13:15 2020 From: chinluh.tan at bytecode-asia.com (Chin Luh Tan) Date: Wed, 26 Feb 2020 13:13:15 +0800 Subject: [Scilab-users] Scilab 6.1 - Possible GUI Bug In-Reply-To: <1707fda98b1.1277b57b9757463.8274870039387235086@bytecode-asia.com> References: <1707fda98b1.1277b57b9757463.8274870039387235086@bytecode-asia.com> Message-ID: <1707fe9d407.bfa402d0753358.1506950996311597269@bytecode-asia.com> sorry, the workaround does not work, the dockable value can only set during creation.? ---- On Wed, 26 Feb 2020 12:56:37 +0800 Chin Luh Tan wrote ---- Hi,? When trying to update guibuilder for Scilab 6.1, I notice that the figure menu is not able to be remove with "delmenu" when the "dockable" is set to "off". How to reproduce: Scenario 1: Menu "File" will not be removed --> f1 = figure("dockable", "off") --> delmenu(f1.figure_id, gettext("File")); Scenario 2: Menu "File" will be removed -->f1 = figure("dockable", "on") -->delmenu(f1.figure_id, gettext("File")); Current workaround:? -->f1 = figure("dockable", "on") -->delmenu(f1.figure_id, gettext("File")); -->f1.dockable = "off"; thanks. rgds, CL _______________________________________________ users mailing list users at lists.scilab.org http://lists.scilab.org/mailman/listinfo/users -------------- next part -------------- An HTML attachment was scrubbed... URL: From perrichon.pierre at wanadoo.fr Wed Feb 26 12:19:26 2020 From: perrichon.pierre at wanadoo.fr (Perrichon) Date: Wed, 26 Feb 2020 12:19:26 +0100 Subject: [Scilab-users] Personnal Palette : black component using drag and drop - Scilab 6.1.0 Message-ID: Hello Using my personnal palette, I see that drag and drop a component in an xcos screen is not drawn with Scilab 6.1.0 See bugzilla #16338 for attached file "Photo of the Bug" It was fine with scilab 5.5.2 So what to do in the -case "define"- part of the sci files? See the sci attached file And why does it happen??? Best regards Pierre P. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Clement.David at esi-group.com Wed Feb 26 14:18:52 2020 From: Clement.David at esi-group.com (=?iso-8859-1?Q?Cl=E9ment_David?=) Date: Wed, 26 Feb 2020 13:18:52 +0000 Subject: [Scilab-users] Personnal Palette : black component using drag and drop - Scilab 6.1.0 In-Reply-To: References: Message-ID: Hello Pierre, I confirmed it is a bug, setting the graphics.style of a block is supposed to work when allocating a block (on the "define" part of a block). Thanks for the report, -- Cl?ment > -----Original Message----- > From: users On Behalf Of Perrichon > Sent: Wednesday, February 26, 2020 12:19 PM > To: 'Users mailing list for Scilab' > Subject: [Scilab-users] Personnal Palette : black component using drag > and drop > - Scilab 6.1.0 > > Hello > > > > Using my personnal palette, I see that drag and drop a component in an > xcos screen is not drawn with Scilab 6.1.0 > > > > See bugzilla # for attached file "Photo of the Bug" > > > > It was fine with scilab 5.5.2 > > > > So what to do in the -case "define"- part of the sci files? See the > sci attached file > > > > And why does it happen??? > > > > > > Best regards > > Pierre P. > > > > From ayrat.khalimov at gmail.com Wed Feb 26 16:26:58 2020 From: ayrat.khalimov at gmail.com (Ayrat Khalimov) Date: Wed, 26 Feb 2020 16:26:58 +0100 Subject: [Scilab-users] Difference between port types in xcos (box, circle, triangle; and black, blue, gray, white, red) Message-ID: hi all, Is there an explanation of all different port types? Here is a picture: https://www.dropbox.com/s/hskhnupp8vv2lfs/port-types.png?dl=0 There are ports which are - box blue and white (1 and 2) - circular (4 and 5) - triangle blue and black (3 and 6) - red triangular (9) How do they differ, and why some can be connected while others cannot? In particular, why can't blue and black ports be connected together? (I know that red triangular means "events", but added there for completeness.) ps: the picture contains some Coselica blocks (they are modelica blocks I guess) thanks! ayrat -------------- next part -------------- An HTML attachment was scrubbed... URL: From perrichon.pierre at wanadoo.fr Wed Feb 26 17:29:25 2020 From: perrichon.pierre at wanadoo.fr (Perrichon) Date: Wed, 26 Feb 2020 17:29:25 +0100 Subject: [Scilab-users] Bugzilla 15921 : The multiplication operator is missing Message-ID: Hello, Coment about Bugzilla 15921 in xcos scilab 6.1.0 : The multiplication operator is missing : Best regards -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image003.jpg Type: image/jpeg Size: 8823 bytes Desc: not available URL: From sgougeon at free.fr Wed Feb 26 18:44:15 2020 From: sgougeon at free.fr (Samuel Gougeon) Date: Wed, 26 Feb 2020 18:44:15 +0100 Subject: [Scilab-users] Scilab 6.1 - Possible GUI Bug In-Reply-To: <1707fda98b1.1277b57b9757463.8274870039387235086@bytecode-asia.com> References: <1707fda98b1.1277b57b9757463.8274870039387235086@bytecode-asia.com> Message-ID: <125bbd09-55ce-12ef-1d26-d88695de89d3@free.fr> Hello Chin Luh, Le 26/02/2020 ? 05:56, Chin Luh Tan a ?crit?: > Hi, > > When trying to update guibuilder for Scilab 6.1, I notice that the > figure menu is not able to be remove with "delmenu" when the > "dockable" is set to "off". > > How to reproduce: > > Scenario 1: Menu "File" *will **not **be* removed > --> f1 = figure("dockable", "off") > --> delmenu(f1.figure_id, gettext("File")); Bug confirmed. Work-around: f1 = figure("dockable", "off"); get(0).showhiddenhandles = "on"; delete(f1.children($)); get(0).showhiddenhandles = "off"; Regards Samuel -------------- next part -------------- An HTML attachment was scrubbed... URL: From perrichon.pierre at wanadoo.fr Thu Feb 27 12:18:47 2020 From: perrichon.pierre at wanadoo.fr (Perrichon) Date: Thu, 27 Feb 2020 12:18:47 +0100 Subject: [Scilab-users] Isoview in GUI - Scilab 6.1.0 Message-ID: Hello, I've seen that syntax change for the isoview in scilab 6.1.0 : isoview(gcf(), "on") // Scilab 6.1.0 In that case I must take a new time bounds in Nyquist and positionning 0 dB, 3 dB and so on In my GUI, I personnaly prefer this fonction in scilab 5.5.2, where I can fixe limits for the drawing isoview(-1.0,1.0,-1.0,1.0); // Scilab 5.5.2 So I've done a copy of isoview Scilab 5.5.2, call Isoview, and automaticcaly load at scilab 6.1.0 in the scilab.ini of SCIHOME I hope this solution will be sustainable Isoview in GUI - Scilab 5.5.2 Best regards -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image002.jpg Type: image/jpeg Size: 38902 bytes Desc: not available URL: From ayrat.khalimov at gmail.com Thu Feb 27 14:08:49 2020 From: ayrat.khalimov at gmail.com (Ayrat Khalimov) Date: Thu, 27 Feb 2020 14:08:49 +0100 Subject: [Scilab-users] Example of block Automat in xcos (hybrid automata) Message-ID: hi all, Is there an example of how to use the Automat block in xcos? The xcos documentation refers to paper [1], which contains good explanations *but no sci files*. If you have an example sci files with block Automat, pls share. Thanks! best wishes, Ayrat [1]: Implementation of Hybrid Automata in Scicos: https://sci-hub.tw/10.1109/cca.2007.4389334 ps: I know that there is a special module for hybrid automata, that helps to specify them, but it is only for version ~5.3 of xcos and does not work on 6.0.2 -------------- next part -------------- An HTML attachment was scrubbed... URL: From sgougeon at free.fr Thu Feb 27 15:34:33 2020 From: sgougeon at free.fr (Samuel Gougeon) Date: Thu, 27 Feb 2020 15:34:33 +0100 Subject: [Scilab-users] Isoview in GUI - Scilab 6.1.0 In-Reply-To: References: Message-ID: Hello Pierre, The former isoview() implementation mixed some poor isometrical tuning, with some unrelated rebounding action. This is why both types of actions have been split: * isoview deals only with the isometrical view, in a richer way than formerly: Please see history sections and compare synopses https://help.scilab.org/docs/6.0.0/en_US/isoview.html? with the former https://help.scilab.org/docs/5.5.2/en_US/isoview.html * replot(), whose dedicated action is to rebound axes,? has also been extended a lot in Scilab: Please compare https://help.scilab.org/docs/6.0.0/en_US/replot.html with the former https://help.scilab.org/docs/5.5.2/en_US/replot.html Users were warned about this isoview change for 3 years. So, the replacement for the former isoview([xmin,xmax,ymin,ymax]) is simply isoview replot([xmin,ymin,xmax,ymax]) with extended features with bounds values. Maybe you think that replot() is not a nice name, not describing the actual action of replot(). I would definitively agree. But reframing axes has aways been its dedicated action. And isoview() wasn't the right name to support (poor) rebounding features, either I hope you will appreciate and use recent isoview and replot features, separately. Best regards Samuel Le 27/02/2020 ? 12:18, Perrichon a ?crit?: > > Hello, > > I?ve seen that syntax change for the isoview in scilab 6.1.0?: > > isoview(gcf(), "on") // Scilab 6.1.0 > > In that case I must take a new time bounds in Nyquist and positionning > 0 dB, 3 dB and so on > > In my GUI, I personnaly prefer this fonction in scilab 5.5.2, where I > can fixe limits for the drawing > > isoview(-1.0,1.0,-1.0,1.0); ?????????? // Scilab 5.5.2 > > So I?ve done a copy of isoview Scilab 5.5.2, call Isoview, and > automaticcaly load at scilab 6.1.0 in the scilab.ini of SCIHOME > > I hope this solution will be sustainable > > Isoview in GUI - Scilab 5.5.2 > > Best regards > > > _______________________________________________ > users mailing list > users at lists.scilab.org > http://lists.scilab.org/mailman/listinfo/users -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image002.jpg Type: image/jpeg Size: 38902 bytes Desc: not available URL: From j-lan at online.no Thu Feb 27 16:17:25 2020 From: j-lan at online.no (JLan) Date: Thu, 27 Feb 2020 08:17:25 -0700 (MST) Subject: [Scilab-users] Bitget for int64/uint64 Message-ID: <1582816645238-0.post@n3.nabble.com> I wonder if i have misunderstood the documentation for bitget, or if this is a bug? It seems to me that numbers > 2^53 are still not handled correctly. --> a=uint64(2^61) a = 2305843009213693952 --> b=uint64(2^61)+1 b = 2305843009213693953 --> bitget(a,1:64) ans = column 1 to 32 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 column 33 to 64 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 --> bitget(b,1:64) ans = column 1 to 32 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 column 33 to 64 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 -- Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html From stephane.mottelet at utc.fr Thu Feb 27 16:37:40 2020 From: stephane.mottelet at utc.fr (=?UTF-8?Q?St=c3=a9phane_Mottelet?=) Date: Thu, 27 Feb 2020 16:37:40 +0100 Subject: [Scilab-users] Bitget for int64/uint64 In-Reply-To: <1582816645238-0.post@n3.nabble.com> References: <1582816645238-0.post@n3.nabble.com> Message-ID: <2321bd9f-c279-1dd8-9d98-1641decdcf54@utc.fr> You should generate big ints like this: a=uint64(2)^61 S. Le 27/02/2020 ? 16:17, JLan a ?crit?: > I wonder if i have misunderstood the documentation for bitget, or if this is > a bug? It seems to me that numbers > 2^53 are still not handled correctly. > --> a=uint64(2^61) > a = 2305843009213693952 > --> b=uint64(2^61)+1 > b = 2305843009213693953 > --> bitget(a,1:64) > ans = > column 1 to 32 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 > column 33 to 64 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 0 1 0 0 > > --> bitget(b,1:64) > ans = > column 1 to 32 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 > column 33 to 64 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 0 1 0 0 > > > > -- > Sent from: https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html > _______________________________________________ > users mailing list > users at lists.scilab.org > https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/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 stephane.mottelet at utc.fr Thu Feb 27 16:55:39 2020 From: stephane.mottelet at utc.fr (=?UTF-8?Q?St=c3=a9phane_Mottelet?=) Date: Thu, 27 Feb 2020 16:55:39 +0100 Subject: [Scilab-users] Bitget for int64/uint64 In-Reply-To: <2321bd9f-c279-1dd8-9d98-1641decdcf54@utc.fr> References: <1582816645238-0.post@n3.nabble.com> <2321bd9f-c279-1dd8-9d98-1641decdcf54@utc.fr> Message-ID: But the problem with bitget remains. The new bitstring is ok: --> bitstring(a) ?ans? = "0010000000000000000000000000000000000000000000000000000000000000" --> bitstring(a+1) ?ans? = "0010000000000000000000000000000000000000000000000000000000000001" S. Le 27/02/2020 ? 16:37, St?phane Mottelet a ?crit?: > You should generate big ints like this: > > a=uint64(2)^61 > > S. > > Le 27/02/2020 ? 16:17, JLan a ?crit?: >> I wonder if i have misunderstood the documentation for bitget, or if >> this is >> a bug? It seems to me that numbers > 2^53 are still not handled >> correctly. >> --> a=uint64(2^61) >> ? a? =?? 2305843009213693952 >> --> b=uint64(2^61)+1 >> ? b? =?? 2305843009213693953 >> --> bitget(a,1:64) >> ? ans? = >> ????????? column 1 to 32 >> ?? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0 0? 0? >> 0? 0? 0 >> 0? 0? 0? 0? 0? 0? 0 >> ????????? column 33 to 64 >> ?? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0 0? 0? >> 0? 0? 0 >> 0? 0? 0? 0? 1? 0? 0 >> >> --> bitget(b,1:64) >> ? ans? = >> ????????? column 1 to 32 >> ?? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0 0? 0? >> 0? 0? 0 >> 0? 0? 0? 0? 0? 0? 0 >> ????????? column 33 to 64 >> ?? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0 0? 0? >> 0? 0? 0 >> 0? 0? 0? 0? 1? 0? 0 >> >> >> >> -- >> Sent from: >> https://antispam.utc.fr/proxy/2/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html >> _______________________________________________ >> users mailing list >> users at lists.scilab.org >> https://antispam.utc.fr/proxy/2/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/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 Thu Feb 27 16:58:04 2020 From: sgougeon at free.fr (Samuel Gougeon) Date: Thu, 27 Feb 2020 16:58:04 +0100 Subject: [Scilab-users] Bitget for int64/uint64 In-Reply-To: <1582816645238-0.post@n3.nabble.com> References: <1582816645238-0.post@n3.nabble.com> Message-ID: <4295c7fd-c9a4-b584-285d-7192b249d76c@free.fr> Le 27/02/2020 ? 16:17, JLan a ?crit?: > I wonder if i have misunderstood the documentation for bitget, or if this is > a bug? It seems to me that numbers > 2^53 are still not handled correctly. > --> a=uint64(2^61) > a = 2305843009213693952 > --> b=uint64(2^61)+1 > b = 2305843009213693953 bitget(b,1) --> bitget(b,1) ?ans? = ? 0 is a bug. bitget.tst tests int64 and uint64 cases with other inttypes: --> edit SCI\modules\elementary_functions\tests\unit_tests\bitget.tst When bitget() has been extended to 64 bits integers ~3 years ago, several bugs have appeared about the processing of these integers by other Scilab functions, noticeably some functions involved in the bitget implementation. Not all are fixed (actually, only few of them are fixed). But maybe it's another issue here. I could have a look, about this specific case. If you can do other tests and get issues, please report all of them on bugzilla. Thanks From sgougeon at free.fr Thu Feb 27 17:51:00 2020 From: sgougeon at free.fr (Samuel Gougeon) Date: Thu, 27 Feb 2020 17:51:00 +0100 Subject: [Scilab-users] Bitget for int64/uint64 In-Reply-To: <4295c7fd-c9a4-b584-285d-7192b249d76c@free.fr> References: <1582816645238-0.post@n3.nabble.com> <4295c7fd-c9a4-b584-285d-7192b249d76c@free.fr> Message-ID: <9e59d89d-ab76-579f-7ec8-f0dda77ad2b0@free.fr> As suspected, the bug originates from the * operator, that is still not reliable between uint64 or int64: --> b ?b? = ? 230584300921369395*5* --> b * uint64(1) ?ans? = ? 230584300921369395*2* This was reported in 2018 @ http://bugzilla.scilab.org/15836 and is still unfixed. For bitget, i will see how to do, if there is a workaround. If not, at least warn users in the help page. Samuel Le 27/02/2020 ? 16:58, Samuel Gougeon a ?crit?: > Le 27/02/2020 ? 16:17, JLan a ?crit?: >> I wonder if i have misunderstood the documentation for bitget, or if >> this is >> a bug? It seems to me that numbers > 2^53 are still not handled >> correctly. >> --> a=uint64(2^61) >> ? a? =?? 2305843009213693952 >> --> b=uint64(2^61)+1 >> ? b? =?? 2305843009213693953 > > bitget(b,1) > > --> bitget(b,1) > ?ans? = > ? 0 > > is a bug. > bitget.tst tests int64 and uint64 cases with other inttypes: > --> edit SCI\modules\elementary_functions\tests\unit_tests\bitget.tst > > When bitget() has been extended to 64 bits integers ~3 years ago, > several bugs have appeared about the processing of these integers by > other Scilab functions, noticeably some functions involved in the > bitget implementation. > Not all are fixed (actually, only few of them are fixed). > But maybe it's another issue here. I could have a look, about this > specific case. > > If you can do other tests and get issues, please report all of them on > bugzilla. > Thanks > > _______________________________________________ > users mailing list > users at lists.scilab.org > http://lists.scilab.org/mailman/listinfo/users -------------- next part -------------- An HTML attachment was scrubbed... URL: From j-lan at online.no Thu Feb 27 17:58:25 2020 From: j-lan at online.no (=?UTF-8?Q?Jan_=c3=85ge_Langeland?=) Date: Thu, 27 Feb 2020 17:58:25 +0100 Subject: [Scilab-users] Bitget for int64/uint64 In-Reply-To: <9e59d89d-ab76-579f-7ec8-f0dda77ad2b0@free.fr> References: <1582816645238-0.post@n3.nabble.com> <4295c7fd-c9a4-b584-285d-7192b249d76c@free.fr> <9e59d89d-ab76-579f-7ec8-f0dda77ad2b0@free.fr> Message-ID: <0f0e9091-0349-f8ec-3fe6-0ff4708845f7@online.no> Samuel My suggestion for a workaround (looks like my first reply disappeared): b? =uint64(2)^61+1 bb2=uint64(bin2dec(strsplit(strrev(bitstring(b))))'); bb1=bitget(b,1:64); bb2(1)-bb1(1) ?ans? =? 1 A bit of a waste to use uint64 to store single bits, but that is what bitget does: --> typeof(bb1) ?ans? =? "uint64" Jan On 2020-02-27 17:51 PM, Samuel Gougeon wrote: > As suspected, the bug originates from the * operator, that is still > not reliable between uint64 or int64: > --> b > ?b? = > ? 230584300921369395*5* > > --> b * uint64(1) > ?ans? = > ? 230584300921369395*2* > > This was reported in 2018 @ http://bugzilla.scilab.org/15836 and is > still unfixed. > > For bitget, i will see how to do, if there is a workaround. If not, at > least warn users in the help page. > > Samuel > > Le 27/02/2020 ? 16:58, Samuel Gougeon a ?crit?: >> Le 27/02/2020 ? 16:17, JLan a ?crit?: >>> I wonder if i have misunderstood the documentation for bitget, or if >>> this is >>> a bug? It seems to me that numbers > 2^53 are still not handled >>> correctly. >>> --> a=uint64(2^61) >>> ? a? =?? 2305843009213693952 >>> --> b=uint64(2^61)+1 >>> ? b? =?? 2305843009213693953 >> >> bitget(b,1) >> >> --> bitget(b,1) >> ?ans? = >> ? 0 >> >> is a bug. >> bitget.tst tests int64 and uint64 cases with other inttypes: >> --> edit SCI\modules\elementary_functions\tests\unit_tests\bitget.tst >> >> When bitget() has been extended to 64 bits integers ~3 years ago, >> several bugs have appeared about the processing of these integers by >> other Scilab functions, noticeably some functions involved in the >> bitget implementation. >> Not all are fixed (actually, only few of them are fixed). >> But maybe it's another issue here. I could have a look, about this >> specific case. >> >> If you can do other tests and get issues, please report all of them >> on bugzilla. >> Thanks >> >> _______________________________________________ >> 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From sgougeon at free.fr Thu Feb 27 18:10:57 2020 From: sgougeon at free.fr (Samuel Gougeon) Date: Thu, 27 Feb 2020 18:10:57 +0100 Subject: [Scilab-users] Bitget for int64/uint64 In-Reply-To: <9e59d89d-ab76-579f-7ec8-f0dda77ad2b0@free.fr> References: <1582816645238-0.post@n3.nabble.com> <4295c7fd-c9a4-b584-285d-7192b249d76c@free.fr> <9e59d89d-ab76-579f-7ec8-f0dda77ad2b0@free.fr> Message-ID: <09eeb8d1-01cf-4603-7159-82ebe873c45c@free.fr> OK, there is a trivial work-around for bitget(). I will post the URL of the fixed macro and how-to fix it for your own 6.1.0 as soon as put on the forge. I will also add actual examples with integers in the page, and fix minor typos. Samuel Le 27/02/2020 ? 17:51, Samuel Gougeon a ?crit?: > As suspected, the bug originates from the * operator, that is still > not reliable between uint64 or int64: > --> b > ?b? = > ? 230584300921369395*5* > > --> b * uint64(1) > ?ans? = > ? 230584300921369395*2* > > This was reported in 2018 @ http://bugzilla.scilab.org/15836 and is > still unfixed. > > For bitget, i will see how to do, if there is a workaround. If not, at > least warn users in the help page. > > Samuel > > Le 27/02/2020 ? 16:58, Samuel Gougeon a ?crit?: >> Le 27/02/2020 ? 16:17, JLan a ?crit?: >>> I wonder if i have misunderstood the documentation for bitget, or if >>> this is >>> a bug? It seems to me that numbers > 2^53 are still not handled >>> correctly. >>> --> a=uint64(2^61) >>> ? a? =?? 2305843009213693952 >>> --> b=uint64(2^61)+1 >>> ? b? =?? 2305843009213693953 >> >> bitget(b,1) >> >> --> bitget(b,1) >> ?ans? = >> ? 0 >> >> is a bug. >> bitget.tst tests int64 and uint64 cases with other inttypes: >> --> edit SCI\modules\elementary_functions\tests\unit_tests\bitget.tst >> >> When bitget() has been extended to 64 bits integers ~3 years ago, >> several bugs have appeared about the processing of these integers by >> other Scilab functions, noticeably some functions involved in the >> bitget implementation. >> Not all are fixed (actually, only few of them are fixed). >> But maybe it's another issue here. I could have a look, about this >> specific case. >> >> If you can do other tests and get issues, please report all of them >> on bugzilla. >> Thanks >> >> _______________________________________________ >> 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From j-lan at online.no Thu Feb 27 17:44:52 2020 From: j-lan at online.no (=?UTF-8?Q?Jan_=c3=85ge_Langeland?=) Date: Thu, 27 Feb 2020 17:44:52 +0100 Subject: [Scilab-users] Bitget for int64/uint64 In-Reply-To: References: <1582816645238-0.post@n3.nabble.com> <2321bd9f-c279-1dd8-9d98-1641decdcf54@utc.fr> Message-ID: <1ef65eaa-0248-b2e3-96b4-5e1efba1ad53@online.no> Thank you, St?phane So a workaround is: b? =uint64(2)^61+1 bb2=uint64(bin2dec(strsplit(strrev(bitstring(b))))'); bb1=bitget(b,1:64); bb2(1)-bb1(1) ?ans? =? 1 A bit of a waste to use uint64 to store single bits, but that is what bitget does: --> typeof(bb1) ?ans? =? "uint64" Jan On 2020-02-27 16:55 PM, St?phane Mottelet wrote: > But the problem with bitget remains. The new bitstring is ok: > > --> bitstring(a) > ?ans? = > > "0010000000000000000000000000000000000000000000000000000000000000" > > --> bitstring(a+1) > ?ans? = > > "0010000000000000000000000000000000000000000000000000000000000001" > > S. > > Le 27/02/2020 ? 16:37, St?phane Mottelet a ?crit?: >> You should generate big ints like this: >> >> a=uint64(2)^61 >> >> S. >> >> Le 27/02/2020 ? 16:17, JLan a ?crit?: >>> I wonder if i have misunderstood the documentation for bitget, or if >>> this is >>> a bug? It seems to me that numbers > 2^53 are still not handled >>> correctly. >>> --> a=uint64(2^61) >>> ? a? =?? 2305843009213693952 >>> --> b=uint64(2^61)+1 >>> ? b? =?? 2305843009213693953 >>> --> bitget(a,1:64) >>> ? ans? = >>> ????????? column 1 to 32 >>> ?? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0 0? 0? >>> 0? 0? 0 >>> 0? 0? 0? 0? 0? 0? 0 >>> ????????? column 33 to 64 >>> ?? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0 0? 0? >>> 0? 0? 0 >>> 0? 0? 0? 0? 1? 0? 0 >>> >>> --> bitget(b,1:64) >>> ? ans? = >>> ????????? column 1 to 32 >>> ?? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0 0? 0? >>> 0? 0? 0 >>> 0? 0? 0? 0? 0? 0? 0 >>> ????????? column 33 to 64 >>> ?? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0? 0 0? 0? >>> 0? 0? 0 >>> 0? 0? 0? 0? 1? 0? 0 >>> >>> >>> >>> -- >>> Sent from: >>> https://antispam.utc.fr/proxy/2/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html >>> _______________________________________________ >>> users mailing list >>> users at lists.scilab.org >>> https://antispam.utc.fr/proxy/2/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users >>> >> From sgougeon at free.fr Thu Feb 27 18:51:21 2020 From: sgougeon at free.fr (Samuel Gougeon) Date: Thu, 27 Feb 2020 18:51:21 +0100 Subject: [Scilab-users] Bitget for int64/uint64 In-Reply-To: <1582816645238-0.post@n3.nabble.com> References: <1582816645238-0.post@n3.nabble.com> Message-ID: With the current implementation, you will get the right result with the following: bitget([b b], uint64(1:64))(1,:) * use a non scalar x (pad it with anything if scalar) * use a non scalar pos (idem) * use a pos with the same int64 or uint64 type than x Samuel Le 27/02/2020 ? 16:17, JLan a ?crit?: > I wonder if i have misunderstood the documentation for bitget, or if this is > a bug? It seems to me that numbers > 2^53 are still not handled correctly. > --> a=uint64(2^61) > a = 2305843009213693952 > --> b=uint64(2^61)+1 > b = 2305843009213693953 > --> bitget(a,1:64) > ans = > column 1 to 32 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 > column 33 to 64 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 0 1 0 0 > > --> bitget(b,1:64) > ans = > column 1 to 32 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 > column 33 to 64 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 0 1 0 0 > > > > -- > Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html > _______________________________________________ > users mailing list > users at lists.scilab.org > http://lists.scilab.org/mailman/listinfo/users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From perrichon.pierre at wanadoo.fr Thu Feb 27 19:35:21 2020 From: perrichon.pierre at wanadoo.fr (Perrichon) Date: Thu, 27 Feb 2020 19:35:21 +0100 Subject: [Scilab-users] Xcos Editor in Scilab 6.1.0 breaks diagrams Message-ID: Hello, Xcos Editor in Scilab 6.1.0 breaks diagrams. Number of failure is big. Must I understand I've to rewrite all my projects in Scilab 6.1.0. Here is an example (with several minus zooms) The big box in simply a MUX in the standard Palette, normaly drawn at the bottom of this diagram Must I write a bugzilla ? Best regards -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image002.jpg Type: image/jpeg Size: 11142 bytes Desc: not available URL: From perrichon.pierre at wanadoo.fr Thu Feb 27 19:56:36 2020 From: perrichon.pierre at wanadoo.fr (Perrichon) Date: Thu, 27 Feb 2020 19:56:36 +0100 Subject: [Scilab-users] Xcos Editor in Scilab 6.1.0 breaks diagrams In-Reply-To: References: Message-ID: Hello I correctly rewrite the MUX box dans the zcos. Then I go out off Scilab, come in a new time and go to my folio. Now I obtain : What to do ? De : users De la part de Perrichon Envoy? : jeudi 27 f?vrier 2020 19:35 ? : 'Users mailing list for Scilab' Objet : [Scilab-users] Xcos Editor in Scilab 6.1.0 breaks diagrams Hello, Xcos Editor in Scilab 6.1.0 breaks diagrams. Number of failure is big. Must I understand I?ve to rewrite all my projects in Scilab 6.1.0. Here is an example (with several minus zooms) The big box in simply a MUX in the standard Palette, normaly drawn at the bottom of this diagram Must I write a bugzilla ? Best regards -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image002.jpg Type: image/jpeg Size: 3915 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image006.jpg Type: image/jpeg Size: 11056 bytes Desc: not available URL: From sgougeon at free.fr Thu Feb 27 20:08:43 2020 From: sgougeon at free.fr (Samuel Gougeon) Date: Thu, 27 Feb 2020 20:08:43 +0100 Subject: [Scilab-users] Xcos Editor in Scilab 6.1.0 breaks diagrams In-Reply-To: References: Message-ID: <0cd07906-7e28-8a58-ff28-c1c096f36e2c@free.fr> Le 27/02/2020 ? 19:56, Perrichon a ?crit?: > > Hello > > I correctly rewrite the MUX box dans the zcos. > > Then I go out off Scilab, come in a new time and go to my folio. > > Now I obtain?: > > What to do?? > Have you tried to use the /Format => Link style => Optimal/ feature? -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image002.jpg Type: image/jpeg Size: 3915 bytes Desc: not available URL: From sgougeon at free.fr Thu Feb 27 20:31:33 2020 From: sgougeon at free.fr (Samuel Gougeon) Date: Thu, 27 Feb 2020 20:31:33 +0100 Subject: [Scilab-users] Bitget for int64/uint64 In-Reply-To: <1ef65eaa-0248-b2e3-96b4-5e1efba1ad53@online.no> References: <1582816645238-0.post@n3.nabble.com> <2321bd9f-c279-1dd8-9d98-1641decdcf54@utc.fr> <1ef65eaa-0248-b2e3-96b4-5e1efba1ad53@online.no> Message-ID: <574c3868-5d51-051b-db54-1e5fcd350721@free.fr> Le 27/02/2020 ? 17:44, Jan ?ge Langeland a ?crit?: > A bit of a waste to use uint64 to store single bits, but that is what > bitget does: > > --> typeof(bb1) > ?ans? =? "uint64" This is not worse than returning always decimal numbers 0. and 1. And better than returning booleans, for u-int8 and u-int16, since a boolean is stored on 4 bytes. By the way, providing a result with the same integer type as the input straightforwardly allows many operations between the input and the result, if required. Samuel From sgougeon at free.fr Thu Feb 27 22:02:08 2020 From: sgougeon at free.fr (Samuel Gougeon) Date: Thu, 27 Feb 2020 22:02:08 +0100 Subject: [Scilab-users] simulink model to xcos In-Reply-To: References: Message-ID: Hello, Le 26/02/2020 ? 04:14, Antisen A M a ?crit?: > Hi, is there a import function available to convert simulink model to > xcos model? You may set you in CC: and put your +1 to http://bugzilla.scilab.org/5947 And have a look to https://wiki.scilab.org/Ideas%20of%20development%20for%20Scilab#Xcos And even contribute! BR Samuel From perrichon.pierre at wanadoo.fr Fri Feb 28 08:26:49 2020 From: perrichon.pierre at wanadoo.fr (Perrichon) Date: Fri, 28 Feb 2020 08:26:49 +0100 Subject: [Scilab-users] Xcos Editor in Scilab 6.1.0 breaks diagrams In-Reply-To: <0cd07906-7e28-8a58-ff28-c1c096f36e2c@free.fr> References: <0cd07906-7e28-8a58-ff28-c1c096f36e2c@free.fr> Message-ID: Hello Samuel I dont?t find this option BR De : users De la part de Samuel Gougeon Envoy? : jeudi 27 f?vrier 2020 20:09 ? : users at lists.scilab.org Objet : Re: [Scilab-users] Xcos Editor in Scilab 6.1.0 breaks diagrams Le 27/02/2020 ? 19:56, Perrichon a ?crit : Hello I correctly rewrite the MUX box dans the zcos. Then I go out off Scilab, come in a new time and go to my folio. Now I obtain : What to do ? Have you tried to use the Format => Link style => Optimal feature? -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image005.jpg Type: image/jpeg Size: 16906 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image006.jpg Type: image/jpeg Size: 3641 bytes Desc: not available URL: From ayrat.khalimov at gmail.com Fri Feb 28 08:44:56 2020 From: ayrat.khalimov at gmail.com (Ayrat Khalimov) Date: Fri, 28 Feb 2020 08:44:56 +0100 Subject: [Scilab-users] Xcos Editor in Scilab 6.1.0 breaks diagrams In-Reply-To: References: <0cd07906-7e28-8a58-ff28-c1c096f36e2c@free.fr> Message-ID: Style de liens...? (First select a line) Similarly helpful, you can select the conjunct of a line and select 'optimal position'. Regarding the ugly resized and displaced block, i have no idea... On Fri, 28 Feb 2020, 08:27 Perrichon, wrote: > Hello Samuel > > I dont?t find this option > > BR > > > > > > > > *De :* users *De la part de* Samuel > Gougeon > *Envoy? :* jeudi 27 f?vrier 2020 20:09 > *? :* users at lists.scilab.org > *Objet :* Re: [Scilab-users] Xcos Editor in Scilab 6.1.0 breaks diagrams > > > > Le 27/02/2020 ? 19:56, Perrichon a ?crit : > > Hello > > I correctly rewrite the MUX box dans the zcos. > > Then I go out off Scilab, come in a new time and go to my folio. > > Now I obtain : > > What to do ? > > > > Have you tried to use the *Format => Link style => Optimal* feature? > > > _______________________________________________ > users mailing list > users at lists.scilab.org > http://lists.scilab.org/mailman/listinfo/users > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image005.jpg Type: image/jpeg Size: 16906 bytes Desc: not available URL: From perrichon.pierre at wanadoo.fr Fri Feb 28 08:50:47 2020 From: perrichon.pierre at wanadoo.fr (Perrichon) Date: Fri, 28 Feb 2020 08:50:47 +0100 Subject: [Scilab-users] Xcos 6.1.0 - benchmark time test Message-ID: Hello, Here I test a PELTON basic algorithm under xcos, and record with tic-toc the simulation real time. These programs have been set for 120 s (scope) Results : Xcos Scilab 5.5.2 : Dur?e de la simulation : 45.4 s Xcos Sciab 6.1.0 : Dur?e de la simulation : 65.2 s So the ratio is 1.44 for a basic sheme Any explaination ? Can that be improved ? BR -------------- next part -------------- An HTML attachment was scrubbed... URL: From Clement.David at esi-group.com Fri Feb 28 09:53:12 2020 From: Clement.David at esi-group.com (=?iso-8859-1?Q?Cl=E9ment_David?=) Date: Fri, 28 Feb 2020 08:53:12 +0000 Subject: [Scilab-users] Xcos Editor in Scilab 6.1.0 breaks diagrams In-Reply-To: References: Message-ID: Hello Pierre, Could you please open a Bugzilla report with the attached diagram, Scilab/Xcos 5.5.2 might set some positions incorrectly decoded in Scilab/Xcos 6.1.0 ? Thanks, -- Cl?ment > -----Original Message----- > From: users On Behalf Of Perrichon > Sent: Thursday, February 27, 2020 7:35 PM > To: 'Users mailing list for Scilab' > Subject: [Scilab-users] Xcos Editor in Scilab 6.1.0 breaks diagrams > > Hello, > > > > Xcos Editor in Scilab 6.1.0 breaks diagrams. Number of failure is big. > > Must I understand I've to rewrite all my projects in Scilab 6.1.0. > > > > Here is an example (with several minus zooms) > > The big box in simply a MUX in the standard Palette, normaly drawn at the > bottom of this diagram > > > > Must I write a bugzilla ? > > > > Best regards > > > > > > > > > > From Clement.David at esi-group.com Fri Feb 28 10:10:01 2020 From: Clement.David at esi-group.com (=?iso-8859-1?Q?Cl=E9ment_David?=) Date: Fri, 28 Feb 2020 09:10:01 +0000 Subject: [Scilab-users] Xcos 6.1.0 - benchmark time test In-Reply-To: References: Message-ID: Hello Pierre, Are you using a block with its simulation function implemented in Scilab? Any C/C++ implemented block might perform the same at simulation time. In 6.0.2, implementing Xcos blocks using the Scilab language had some performance issues. In 6.1.0, I tried to speed up things a little bit by reusing some allocated data structure during simulation time [1] ; more work might still be needed here. [1]: http://cgit.scilab.org/scilab/commit/?id=bfe4f25275dc0d889817d10b63e10c9a0641ef32 Regards, -- Cl?ment From: users On Behalf Of Perrichon Sent: Friday, February 28, 2020 8:51 AM To: 'Users mailing list for Scilab' Subject: [Scilab-users] Xcos 6.1.0 - benchmark time test Hello, Here I test a PELTON basic algorithm under xcos, and record with tic-toc the simulation real time. These programs have been set for 120 s (scope) Results : Xcos Scilab 5.5.2 : Dur?e de la simulation : 45.4 s Xcos Sciab 6.1.0 : Dur?e de la simulation : 65.2 s So the ratio is 1.44 for a basic sheme Any explaination ? Can that be improved ? BR -------------- next part -------------- An HTML attachment was scrubbed... URL: From perrichon.pierre at wanadoo.fr Fri Feb 28 11:15:03 2020 From: perrichon.pierre at wanadoo.fr (Perrichon) Date: Fri, 28 Feb 2020 11:15:03 +0100 Subject: [Scilab-users] Xcos Editor in Scilab 6.1.0 breaks diagrams In-Reply-To: References: Message-ID: Hello Cl?ment This is done See bugzilla #16343 BR Before printing, think about ENVIRONMENTAL responsabity -----Message d'origine----- De?: users De la part de Cl?ment David Envoy??: vendredi 28 f?vrier 2020 09:53 ??: Users mailing list for Scilab Objet?: Re: [Scilab-users] Xcos Editor in Scilab 6.1.0 breaks diagrams Hello Pierre, Could you please open a Bugzilla report with the attached diagram, Scilab/Xcos 5.5.2 might set some positions incorrectly decoded in Scilab/Xcos 6.1.0 ? Thanks, -- Cl?ment > -----Original Message----- > From: users On Behalf Of Perrichon > Sent: Thursday, February 27, 2020 7:35 PM > To: 'Users mailing list for Scilab' > Subject: [Scilab-users] Xcos Editor in Scilab 6.1.0 breaks diagrams > > Hello, > > > > Xcos Editor in Scilab 6.1.0 breaks diagrams. Number of failure is big. > > Must I understand I've to rewrite all my projects in Scilab 6.1.0. > > > > Here is an example (with several minus zooms) > > The big box in simply a MUX in the standard Palette, normaly drawn at > the bottom of this diagram > > > > Must I write a bugzilla ? > > > > Best regards > > > > > > > > > > _______________________________________________ users mailing list users at lists.scilab.org http://lists.scilab.org/mailman/listinfo/users -------------- next part -------------- A non-text attachment was scrubbed... Name: M_ Pierre PERRICHON.vcf Type: text/x-vcard Size: 2865 bytes Desc: not available URL: From perrichon.pierre at wanadoo.fr Fri Feb 28 12:10:15 2020 From: perrichon.pierre at wanadoo.fr (Perrichon) Date: Fri, 28 Feb 2020 12:10:15 +0100 Subject: [Scilab-users] Xcos 6.1.0 - benchmark time test In-Reply-To: References: Message-ID: Hello Cl?ment In this benchmark test, I only use xcos files in scilab 5.5.2 and 6.1.0, same file save in 6.1.0 done without any components of my personal palette SEGPAL. So all components are with the xcos standart palettes I?ve work with scilab 6.0.x But all is fine in all my projects with 5.5.2, so this is a nice blue sky. I now try to go to scilab 6.1.0 which the begining of my nigthmares. It also means that at this step, I shall not test 6.0.2. Not easy For example, I?ve to understant why instruction ? importXcosDiagram ? don?t run. But this is another discussion . This instruction well run in Scilab 5.5.2 ? la ligne 13 de la fonction importXcosDiagram ( C:\Program Files\scilab-6.1.0\modules\xcos\macros\importXcosDiagram.sci ligne 32 ) BR Pierre P. De : users De la part de Cl?ment David Envoy? : vendredi 28 f?vrier 2020 10:10 ? : Users mailing list for Scilab Objet : Re: [Scilab-users] Xcos 6.1.0 - benchmark time test Hello Pierre, Are you using a block with its simulation function implemented in Scilab? Any C/C++ implemented block might perform the same at simulation time. In 6.0.2, implementing Xcos blocks using the Scilab language had some performance issues. In 6.1.0, I tried to speed up things a little bit by reusing some allocated data structure during simulation time [1] ; more work might still be needed here. [1]: http://cgit.scilab.org/scilab/commit/?id=bfe4f25275dc0d889817d10b63e10c9a064 1ef32 Regards, -- Cl?ment From: users > On Behalf Of Perrichon Sent: Friday, February 28, 2020 8:51 AM To: 'Users mailing list for Scilab' > Subject: [Scilab-users] Xcos 6.1.0 - benchmark time test Hello, Here I test a PELTON basic algorithm under xcos, and record with tic-toc the simulation real time. These programs have been set for 120 s (scope) Results : Xcos Scilab 5.5.2 : Dur?e de la simulation : 45.4 s Xcos Sciab 6.1.0 : Dur?e de la simulation : 65.2 s So the ratio is 1.44 for a basic sheme Any explaination ? Can that be improved ? BR -------------- next part -------------- An HTML attachment was scrubbed... URL: From perrichon.pierre at wanadoo.fr Fri Feb 28 12:14:53 2020 From: perrichon.pierre at wanadoo.fr (Perrichon) Date: Fri, 28 Feb 2020 12:14:53 +0100 Subject: [Scilab-users] Xcos 6.1.0 - benchmark time test In-Reply-To: References: Message-ID: Sorry , I wanted to write : I?ve NEVER work with scilab 6.0.x De : users De la part de Perrichon Envoy? : vendredi 28 f?vrier 2020 12:10 ? : 'Users mailing list for Scilab' Objet : Re: [Scilab-users] Xcos 6.1.0 - benchmark time test Hello Cl?ment In this benchmark test, I only use xcos files in scilab 5.5.2 and 6.1.0, same file save in 6.1.0 done without any components of my personal palette SEGPAL. So all components are with the xcos standart palettes I?ve work with scilab 6.0.x But all is fine in all my projects with 5.5.2, so this is a nice blue sky. I now try to go to scilab 6.1.0 which the begining of my nigthmares. It also means that at this step, I shall not test 6.0.2. Not easy For example, I?ve to understant why instruction ? importXcosDiagram ? don?t run. But this is another discussion . This instruction well run in Scilab 5.5.2 ? la ligne 13 de la fonction importXcosDiagram ( C:\Program Files\scilab-6.1.0\modules\xcos\macros\importXcosDiagram.sci ligne 32 ) BR Pierre P. De : users > De la part de Cl?ment David Envoy? : vendredi 28 f?vrier 2020 10:10 ? : Users mailing list for Scilab > Objet : Re: [Scilab-users] Xcos 6.1.0 - benchmark time test Hello Pierre, Are you using a block with its simulation function implemented in Scilab? Any C/C++ implemented block might perform the same at simulation time. In 6.0.2, implementing Xcos blocks using the Scilab language had some performance issues. In 6.1.0, I tried to speed up things a little bit by reusing some allocated data structure during simulation time [1] ; more work might still be needed here. [1]: http://cgit.scilab.org/scilab/commit/?id=bfe4f25275dc0d889817d10b63e10c9a064 1ef32 Regards, -- Cl?ment From: users > On Behalf Of Perrichon Sent: Friday, February 28, 2020 8:51 AM To: 'Users mailing list for Scilab' > Subject: [Scilab-users] Xcos 6.1.0 - benchmark time test Hello, Here I test a PELTON basic algorithm under xcos, and record with tic-toc the simulation real time. These programs have been set for 120 s (scope) Results : Xcos Scilab 5.5.2 : Dur?e de la simulation : 45.4 s Xcos Sciab 6.1.0 : Dur?e de la simulation : 65.2 s So the ratio is 1.44 for a basic sheme Any explaination ? Can that be improved ? BR -------------- next part -------------- An HTML attachment was scrubbed... URL: From ayrat.khalimov at gmail.com Fri Feb 28 15:07:55 2020 From: ayrat.khalimov at gmail.com (Ayrat Khalimov) Date: Fri, 28 Feb 2020 15:07:55 +0100 Subject: [Scilab-users] Example of block Automat in xcos (hybrid automata) In-Reply-To: References: Message-ID: Just in case, I created one such diagram that uses the Automaton block: https://www.dropbox.com/s/hcs2vccgzdtmhpg/hyb_atm.zcos?dl=0 (I post it here, because someone in future may ask the same question) On Thu, Feb 27, 2020 at 2:08 PM Ayrat Khalimov wrote: > hi all, > > Is there an example of how to use the Automat block in xcos? > The xcos documentation refers to paper [1], which contains good > explanations *but no sci files*. > If you have an example sci files with block Automat, pls share. Thanks! > > > best wishes, > Ayrat > > > [1]: Implementation of Hybrid Automata in Scicos: > https://sci-hub.tw/10.1109/cca.2007.4389334 > > > ps: I know that there is a special module for hybrid automata, that helps > to specify them, but it is only for version ~5.3 of xcos and does not work > on 6.0.2 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sgougeon at free.fr Fri Feb 28 16:25:26 2020 From: sgougeon at free.fr (Samuel Gougeon) Date: Fri, 28 Feb 2020 16:25:26 +0100 Subject: [Scilab-users] Bitget for int64/uint64 In-Reply-To: <1582816645238-0.post@n3.nabble.com> References: <1582816645238-0.post@n3.nabble.com> Message-ID: Hello Jan, You will find => there a fixed version of bitget() for big u-int64 integers. You can patch your Scilab 6.1.0 installation in the following way: * download and unzip the file. rename it bitget.sci * put bitget.sci in the SCI/elementary_functions/macros directory * Run the following Scilab code in the console: cd SCI/elementary_functions/macros predef clear genlib elementary_functionslib clear bitget And then test and use bitget in the current session and all forthcoming ones. Regards Samuel Le 27/02/2020 ? 16:17, JLan a ?crit?: > I wonder if i have misunderstood the documentation for bitget, or if this is > a bug? It seems to me that numbers > 2^53 are still not handled correctly. > --> a=uint64(2^61) > a = 2305843009213693952 > --> b=uint64(2^61)+1 > b = 2305843009213693953 > --> bitget(a,1:64) > ans = > column 1 to 32 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 > column 33 to 64 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 0 1 0 0 > > --> bitget(b,1:64) > ans = > column 1 to 32 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 > column 33 to 64 > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > 0 0 0 0 1 0 0 -------------- next part -------------- An HTML attachment was scrubbed... URL: From j-lan at online.no Fri Feb 28 18:14:34 2020 From: j-lan at online.no (=?UTF-8?Q?Jan_=c3=85ge_Langeland?=) Date: Fri, 28 Feb 2020 18:14:34 +0100 Subject: [Scilab-users] Bitget for int64/uint64 In-Reply-To: References: <1582816645238-0.post@n3.nabble.com> Message-ID: <013c569c-9fcd-28b1-e3a2-71ddcd5e42cd@online.no> Thank you Samuel For some reason I get an error message : --> genlib elementary_functionslib genlib: Cannot open file ''C:\Program Files\scilab-6.1.0\modules\elementary_functions\macros\lib''. ?ans? =? F Although scinotes("lib") opens the file, so it is there. Anyway, this works fine: --> exec bitget.sci; Warning : redefining function: bitget????????????????? . Use funcprot(0) to avoid this message Regards Jan On 2020-02-28 16:25 PM, Samuel Gougeon wrote: > Hello Jan, > > You will find => there > > a fixed version of bitget() for big u-int64 integers. > You can patch your Scilab 6.1.0 installation in the following way: > > * download and unzip the file. rename it bitget.sci > * put bitget.sci in the SCI/elementary_functions/macros directory > * Run the following Scilab code in the console: > cd SCI/elementary_functions/macros > predef clear > genlib elementary_functionslib > clear bitget > > And then test and use bitget in the current session and all > forthcoming ones. > > Regards > Samuel > > Le 27/02/2020 ? 16:17, JLan a ?crit?: >> I wonder if i have misunderstood the documentation for bitget, or if this is >> a bug? It seems to me that numbers > 2^53 are still not handled correctly. >> --> a=uint64(2^61) >> a = 2305843009213693952 >> --> b=uint64(2^61)+1 >> b = 2305843009213693953 >> --> bitget(a,1:64) >> ans = >> column 1 to 32 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 >> 0 0 0 0 0 0 0 >> column 33 to 64 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 >> 0 0 0 0 1 0 0 >> >> --> bitget(b,1:64) >> ans = >> column 1 to 32 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 >> 0 0 0 0 0 0 0 >> column 33 to 64 >> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 >> 0 0 0 0 1 0 0 > > > _______________________________________________ > users mailing list > users at lists.scilab.org > http://lists.scilab.org/mailman/listinfo/users -------------- next part -------------- An HTML attachment was scrubbed... URL: From sgougeon at free.fr Fri Feb 28 19:05:38 2020 From: sgougeon at free.fr (Samuel Gougeon) Date: Fri, 28 Feb 2020 19:05:38 +0100 Subject: [Scilab-users] Bitget for int64/uint64 In-Reply-To: <013c569c-9fcd-28b1-e3a2-71ddcd5e42cd@online.no> References: <1582816645238-0.post@n3.nabble.com> <013c569c-9fcd-28b1-e3a2-71ddcd5e42cd@online.no> Message-ID: Le 28/02/2020 ? 18:14, Jan ?ge Langeland a ?crit?: > > Thank you Samuel > > For some reason I get an error message : > > --> genlib elementary_functionslib > genlib: Cannot open file ''C:\Program > Files\scilab-6.1.0\modules\elementary_functions\macros\lib''. > ?ans? =? F > > Although scinotes("lib") opens the file, so it is there. > If the lib file is opened for another reason -- for instance it is edited in Scinotes or another editor -- while you run genlib(), then it is likely locked (by the editor), in such a way that genlib() can't update it. Or it may be for another reason. Samuel From fmiyara at fceia.unr.edu.ar Fri Feb 28 22:52:50 2020 From: fmiyara at fceia.unr.edu.ar (Federico Miyara) Date: Fri, 28 Feb 2020 18:52:50 -0300 Subject: [Scilab-users] tlist Message-ID: <5ff7d223-3d0b-33c9-d125-86670f06e513@fceia.unr.edu.ar> Dear all, The documentation of rationals (https://help.scilab.org/docs/6.1.0/en_US/rational.html) mentions ?R = tlist(['r','num','den','dt'], Num, Den,[]) However, if one attempts to create a rational with this syntax the result is an error message. Is it because the first argument is sort of protected and cannot be redefined? If this is the case it would be great if it were clarified in the documentation to avoid confusion. Regards, Federico Miyara -------------- next part -------------- An HTML attachment was scrubbed... URL: From perrichon.pierre at wanadoo.fr Sat Feb 29 11:32:39 2020 From: perrichon.pierre at wanadoo.fr (Perrichon) Date: Sat, 29 Feb 2020 11:32:39 +0100 Subject: [Scilab-users] Context error in Xcos Scilab 6.1.0 Message-ID: Hello, I try to understand and find a reason why my projects done with xcos scilab 5.5.2 not run i 6.1.0 So I isolate at least one reason in a basic test program (see attached files) Here, zcos file are lunched into scilab 5.5.2 or 6.10, with the A.sce file which test the version A.ctx is a context file. Here is a simple variable definition A=50 in that case. Every zcos file contains in its simulation contexte, the instruction ? exec("A.ctx") ? ; accessible with simulation-> context modifying To run this program, make a directory, a copy of the attached files, and change eventually line 4 in A.sce : Root="c:\0 - tampon" // R?pertoire de travail pour le test So run A.sce inside xcos scilab 5.5.2 or 6.1.0 Scilab 5.5.2 run correctly : Scilab 6.1.0 is bugged : It means that A is not seen in xcos scilab 6.1.0 Must I write a bugzilla. Sincerely Pierre P. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image002.jpg Type: image/jpeg Size: 4233 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image006.jpg Type: image/jpeg Size: 4196 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: A.ctx Type: application/octet-stream Size: 4 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: A.sce Type: application/octet-stream Size: 710 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: A552.zcos Type: application/octet-stream Size: 2109 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: A610.zcos Type: application/octet-stream Size: 2345 bytes Desc: not available URL: From sgougeon at free.fr Sat Feb 29 17:41:34 2020 From: sgougeon at free.fr (Samuel Gougeon) Date: Sat, 29 Feb 2020 17:41:34 +0100 Subject: [Scilab-users] Context error in Xcos Scilab 6.1.0 In-Reply-To: References: Message-ID: Hello Pierre, Le 29/02/2020 ? 11:32, Perrichon a ?crit?: > > Hello, > > I try to understand and find a reason why my projects done with xcos > scilab 5.5.2 not run i 6.1.0 > > So I isolate at least one reason in a basic test program (see attached > files) > > Here, zcos file are lunched into scilab 5.5.2 or 6.10, with the A.sce > file which test the version > > A.ctx is a context file. Here is a simple variable definition A=50 in > that case. > > Every zcos file contains in its simulation contexte, the instruction > ??exec("A.ctx")???; accessible with simulation-> context modifying > > To run this program, make a directory, a copy of the attached files, > and change eventually line 4 in A.sce?: > > Root="c:\0 - tampon" // R?pertoire de travail pour le test > > So run A.sce inside xcos scilab 5.5.2 or 6.1.0 > > Scilab 5.5.2 run correctly?: > > > > Scilab 6.1.0 is bugged?: > Apparently, the problem is that the context is not executed when the diagram is loaded. Despite what the context message indicates: Indeed, the message mprintf("Chargement du contexte d''ex?cution %s\n\n",FichierContexte) set in the context is not displayed when the diagram is loaded in 6.1.0 ; only when the context is updated (or simply edited and revalidated). With Scilab 5.5, the context is not executed when loading the diagram,but when running it. So, to me, there are apparently 2 issues: 1. The /Set Context/ message should be fixed: "... and every time the diagram is *run*" (not loaded) 2. The fact that the context is executed when the diagram is run should be restored in Scilab 6. Regards Samuel -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image006.jpg Type: image/jpeg Size: 4196 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: jeidmeemologegdp.png Type: image/png Size: 25368 bytes Desc: not available URL: From sgougeon at free.fr Sat Feb 29 17:53:16 2020 From: sgougeon at free.fr (Samuel Gougeon) Date: Sat, 29 Feb 2020 17:53:16 +0100 Subject: [Scilab-users] Context error in Xcos Scilab 6.1.0 In-Reply-To: References: Message-ID: <0e66dc9d-2f68-8446-919b-22125b535294@free.fr> Le 29/02/2020 ? 17:41, Samuel Gougeon a ?crit?: > Hello Pierre, > > Le 29/02/2020 ? 11:32, Perrichon a ?crit?: >> >> Hello, >> >> I try to understand and find a reason why my projects done with xcos >> scilab 5.5.2 not run i 6.1.0 >> >> So I isolate at least one reason in a basic test program (see >> attached files) >> >> Here, zcos file are lunched into scilab 5.5.2 or 6.10, with the A.sce >> file which test the version >> >> A.ctx is a context file. Here is a simple variable definition A=50 in >> that case. >> >> Every zcos file contains in its simulation contexte, the instruction >> ??exec("A.ctx")???; accessible with simulation-> context modifying >> >> To run this program, make a directory, a copy of the attached files, >> and change eventually line 4 in A.sce?: >> >> Root="c:\0 - tampon" // R?pertoire de travail pour le test >> >> So run A.sce inside xcos scilab 5.5.2 or 6.1.0 >> >> Scilab 5.5.2 run correctly?: >> >> >> >> Scilab 6.1.0 is bugged?: >> > > Apparently, the problem is that the context is not executed when the > diagram is loaded. > Despite what the context message indicates: > > > Indeed, the message mprintf("Chargement du contexte d''ex?cution > %s\n\n",FichierContexte) > set in the context is not displayed when the diagram is loaded in > 6.1.0 ; only when the context > is updated (or simply edited and revalidated). > > With Scilab 5.5, the context is not executed when loading the > diagram,but when running it. > > So, to me, there are apparently 2 issues: > > 1. The /Set Context/ message should be fixed: "... and every time the > diagram is *run*" (not loaded) > 2. The fact that the context is executed when the diagram is run > should be restored in Scilab 6. > Sorry, i don't know what occurred with my first trial, but now it works: In 6.0.2 and 6.1.0, the message is well displayed when the diagram is/run/. The error message displayed on the icon is the following: Samuel -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image006.jpg Type: image/jpeg Size: 4196 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: dellindhbmajlhoc.png Type: image/png Size: 3199 bytes Desc: not available URL: From perrichon.pierre at wanadoo.fr Sat Feb 29 19:35:20 2020 From: perrichon.pierre at wanadoo.fr (Perrichon) Date: Sat, 29 Feb 2020 19:35:20 +0100 Subject: [Scilab-users] Context error in Xcos Scilab 6.1.0 In-Reply-To: <0e66dc9d-2f68-8446-919b-22125b535294@free.fr> References: <0e66dc9d-2f68-8446-919b-22125b535294@free.fr> Message-ID: Hello Samuel, Glad to see you confirm this bug Context is executed at line 26 of the A.sce file, and not before : ---> xcos_simulate(scs_m, 4); So in scilab 6.1.0, the A.ctx is executed. I also add in A610.zcos the instruction * mprintf("Running context in xcos. ...So A=%i\n",A) And then here is the track in my PC when running A.sce in xcos 6.1.0 : --> exec('C:\0 - tampon\A.sce', -1) Chargement du contexte d'ex?cution A.ctx Running context in xcos. ...So A=50 Where we can see that A=50 inside A610.zcos. We also can see that A is lost a the end of the context execution This bad behavior also explains that my projects don?t migrate from xcos 5.5.2 to 6.1.0 Be sure that in my projects, the ct xis a set of a lot of scilab instructions who generate variables. These variables are use in any bloscks and under blocks of my main shemes BR De : users De la part de Samuel Gougeon Envoy? : samedi 29 f?vrier 2020 17:53 ? : users at lists.scilab.org Objet : Re: [Scilab-users] Context error in Xcos Scilab 6.1.0 Le 29/02/2020 ? 17:41, Samuel Gougeon a ?crit : Hello Pierre, Le 29/02/2020 ? 11:32, Perrichon a ?crit : Hello, I try to understand and find a reason why my projects done with xcos scilab 5.5.2 not run i 6.1.0 So I isolate at least one reason in a basic test program (see attached files) Here, zcos file are lunched into scilab 5.5.2 or 6.10, with the A.sce file which test the version A.ctx is a context file. Here is a simple variable definition A=50 in that case. Every zcos file contains in its simulation contexte, the instruction ? exec("A.ctx") ? ; accessible with simulation-> context modifying To run this program, make a directory, a copy of the attached files, and change eventually line 4 in A.sce : Root="c:\0 - tampon" // R?pertoire de travail pour le test So run A.sce inside xcos scilab 5.5.2 or 6.1.0 Scilab 5.5.2 run correctly : Scilab 6.1.0 is bugged : Apparently, the problem is that the context is not executed when the diagram is loaded. Despite what the context message indicates: Indeed, the message mprintf("Chargement du contexte d''ex?cution %s\n\n",FichierContexte) set in the context is not displayed when the diagram is loaded in 6.1.0 ; only when the context is updated (or simply edited and revalidated). With Scilab 5.5, the context is not executed when loading the diagram,but when running it. So, to me, there are apparently 2 issues: 1. The Set Context message should be fixed: "... and every time the diagram is run" (not loaded) 2. The fact that the context is executed when the diagram is run should be restored in Scilab 6. Sorry, i don't know what occurred with my first trial, but now it works: In 6.0.2 and 6.1.0, the message is well displayed when the diagram is run. The error message displayed on the icon is the following: Samuel -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image003.png Type: image/png Size: 3199 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image004.jpg Type: image/jpeg Size: 4152 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: A610.zcos Type: application/octet-stream Size: 2375 bytes Desc: not available URL: From sgougeon at free.fr Sat Feb 29 20:18:31 2020 From: sgougeon at free.fr (Samuel Gougeon) Date: Sat, 29 Feb 2020 20:18:31 +0100 Subject: [Scilab-users] Context error in Xcos Scilab 6.1.0 In-Reply-To: References: <0e66dc9d-2f68-8446-919b-22125b535294@free.fr> Message-ID: <81e115af-4853-b6a9-9796-0215b5ad53de@free.fr> Le 29/02/2020 ? 19:35, Perrichon a ?crit?: > > Hello Samuel, > > Glad to see you confirm this bug > > Context is executed at line 26 of the A.sce file, and not before?: > > -?xcos_simulate(scs_m, 4); > I did not use your A.sce file. From the xcos GUI, i have just tested if the context set in the diagram is well executed, noticeably exec("A.ctx",-1) and a mprintf() to show a message. Samuel -------------- next part -------------- An HTML attachment was scrubbed... URL: From sgougeon at free.fr Sat Feb 29 20:34:23 2020 From: sgougeon at free.fr (Samuel Gougeon) Date: Sat, 29 Feb 2020 20:34:23 +0100 Subject: [Scilab-users] tlist In-Reply-To: <5ff7d223-3d0b-33c9-d125-86670f06e513@fceia.unr.edu.ar> References: <5ff7d223-3d0b-33c9-d125-86670f06e513@fceia.unr.edu.ar> Message-ID: <0f1e7ae2-3317-50ff-d0a2-5e9c5cb09ef3@free.fr> Le 28/02/2020 ? 22:52, Federico Miyara a ?crit?: > > Dear all, > > The documentation of rationals > (https://help.scilab.org/docs/6.1.0/en_US/rational.html) mentions > > ?R = tlist(['r','num','den','dt'], Num, Den,[]) > > However, if one attempts to create a rational with this syntax the > result is an error message. Is it because the first argument is sort > of protected and cannot be redefined? > > If this is the case it would be great if it were clarified in the > documentation to avoid confusion. You are right, Federico. The message should be * clearer, something like "The reserved typeof 'r' can't be used here. Please use rlist()." * extended to other reserved native overloading type codes or/and typeof : https://help.scilab.org/docs/6.1.0/en_US/overloading.html https://help.scilab.org/docs/6.1.0/en_US/typeof.html But this must be done with care, because some internal objects like state-space systems or Xcos objects, or others, use mlist() or tlist() as we do for true custom external typeof. Such a protection is the aim of the quite old but still alive report #2307 . Regards Samuel -------------- next part -------------- An HTML attachment was scrubbed... URL: From perrichon.pierre at wanadoo.fr Sat Feb 29 20:37:19 2020 From: perrichon.pierre at wanadoo.fr (Perrichon) Date: Sat, 29 Feb 2020 20:37:19 +0100 Subject: [Scilab-users] Context error in Xcos Scilab 6.1.0 In-Reply-To: <81e115af-4853-b6a9-9796-0215b5ad53de@free.fr> References: <0e66dc9d-2f68-8446-919b-22125b535294@free.fr> <81e115af-4853-b6a9-9796-0215b5ad53de@free.fr> Message-ID: Please Samuel If you only run exec("A.ctx",-1) then the xcos file , then A is a global variable !!! Error is a matter of portability of variables So thank to only run A.sce for testing. Because here the bug For recalling, it well run with xcos scilab 5.5.2 and not with xcox 6.1.0 BR Pierre P. De : users De la part de Samuel Gougeon Envoy? : samedi 29 f?vrier 2020 20:19 ? : 'Users mailing list for Scilab' Objet : Re: [Scilab-users] Context error in Xcos Scilab 6.1.0 Le 29/02/2020 ? 19:35, Perrichon a ?crit : Hello Samuel, Glad to see you confirm this bug Context is executed at line 26 of the A.sce file, and not before : ---> xcos_simulate(scs_m, 4); I did not use your A.sce file. >From the xcos GUI, i have just tested if the context set in the diagram is well executed, noticeably exec("A.ctx",-1) and a mprintf() to show a message. Samuel -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image002.jpg Type: image/jpeg Size: 12185 bytes Desc: not available URL: From perrichon.pierre at wanadoo.fr Sat Feb 29 21:05:30 2020 From: perrichon.pierre at wanadoo.fr (Perrichon) Date: Sat, 29 Feb 2020 21:05:30 +0100 Subject: [Scilab-users] Context error in Xcos Scilab 6.1.0 References: <0e66dc9d-2f68-8446-919b-22125b535294@free.fr> <81e115af-4853-b6a9-9796-0215b5ad53de@free.fr> Message-ID: PS Samuel Thanks to do the test as I say with A.sce Executing exec("A.ctx",-1) is a very strange way you do to test the bug In your case, and for your understanding, and to go faster, simply enter A=50 in the console. So we stop exchange to keep the problem as a bug. Too information bring confusion. BR Pierre P. Scilab 5.5.2 run correctly : Scilab 6.1.0 is bugged : It means that A is not seen in xcos scilab 6.1.0 Must I write a bugzilla. De : Perrichon Envoy? : samedi 29 f?vrier 2020 20:37 ? : 'Users mailing list for Scilab' Objet : RE: [Scilab-users] Context error in Xcos Scilab 6.1.0 Please Samuel If you only run exec("A.ctx",-1) then the xcos file , then A is a global variable !!! Error is a matter of portability of variables So thank to only run A.sce for testing. Because here the bug For recalling, it well run with xcos scilab 5.5.2 and not with xcox 6.1.0 BR Pierre P. De : users > De la part de Samuel Gougeon Envoy? : samedi 29 f?vrier 2020 20:19 ? : 'Users mailing list for Scilab' > Objet : Re: [Scilab-users] Context error in Xcos Scilab 6.1.0 Le 29/02/2020 ? 19:35, Perrichon a ?crit : Hello Samuel, Glad to see you confirm this bug Context is executed at line 26 of the A.sce file, and not before : ---> xcos_simulate(scs_m, 4); I did not use your A.sce file. >From the xcos GUI, i have just tested if the context set in the diagram is well executed, noticeably exec("A.ctx",-1) and a mprintf() to show a message. Samuel -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image006.jpg Type: image/jpeg Size: 4189 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image008.jpg Type: image/jpeg Size: 4152 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image009.jpg Type: image/jpeg Size: 12179 bytes Desc: not available URL: