From stephane.mottelet at utc.fr Mon Mar 1 09:06:48 2021 From: stephane.mottelet at utc.fr (=?UTF-8?Q?St=c3=a9phane_Mottelet?=) Date: Mon, 1 Mar 2021 09:06:48 +0100 Subject: [Scilab-users] Variable scope in Scilab In-Reply-To: <8ad002b5-ddc8-30b2-943f-5177d85adea7@fceia.unr.edu.ar> References: <8ad002b5-ddc8-30b2-943f-5177d85adea7@fceia.unr.edu.ar> Message-ID: <93aa070c-036f-a279-0c3d-94da25e257fd@utc.fr> Hi Frederico, I do not have any problem with the variable scoping in Scilab and as I said before, even in Julia there is a similar scoping (at least for the particular case of functions). However, the status of formal input and output parameters should prevent the scoping to apply to them. For example, the following does also work (as an addition to my previous example for the input parameter): function y=f(x) endfunction y=1 f -> f ?ans? = ?? 1. Frankly speaking, allowing such a behavior is madness... S. Le 27/02/2021 ? 01:33, Federico Miyara a ?crit?: > > St?phane, > > I agree it shouldn't happen, but the same moment access to outer > variables is granted you can't prevent such thing to happen since > inside the function all variables have a name which is more than just > a symbol or a mute variable, and this includes undefined arguments. > > This scoping feature is dangerous and I don't think it would be > advisable to create a macro for general use exploiting it. > > May be someone can provide an example where it has been used with > profit or explain why it was originally introduced > > Regards, > > Federico Miyara > > On 26/02/2021 10:38, St?phane Mottelet wrote: >> Hi all, >> >> In Scilab the scope of variables is quite permissive but even in >> Julia (really strict rules) we can have the following behavior: >> >> function y=f(x) >> ?y=x+a; >> end >> >> a=1; >> f(2) >> a=2; >> f(3) >> >> -> a=1; >> >> --> f(2) >> ?ans? = >> >> ?? 3. >> >> --> a=2; >> >> --> f(3) >> ?ans? = >> >> ?? 5. >> >> Yesterday afternoon I was my students for a Scilab beginners >> tutorial, and by accident one of them had "x" defined before in the >> main workspace and tried to call f without arguments. I reproduce the >> experiment here by explicitely defining x before the call: >> >> x=1; >> f >> >> --> x=1; >> >> --> f >> ?ans? = >> >> ?? 3. >> >> Allowing the function inner scope to see variables of the outer scope >> is one thing, you may or may not agree this is not the point here, >> but allowing to call f without arguments just because the formal >> input parameter has the same symbol as an outer scope symbol is >> another thing. I knew this was possible even if i never used such a >> feature, but my students were so puzzled by this, particularly those >> who already learned other low-level languages, that I decided to >> propose the suppression of this, that I consider as a serious >> potential source of many bugs. Don't tell me that this would break >> some user code because I frankly have no consideration for this kind >> of crappy shortcut and, sorry if it may sound rude, for programmers >> who use it... >> >> S. >> > > > > Libre de virus. www.avast.com > > > > <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> > > _______________________________________________ > 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 antoine.monmayrant at laas.fr Mon Mar 1 09:37:18 2021 From: antoine.monmayrant at laas.fr (Antoine Monmayrant) Date: Mon, 1 Mar 2021 09:37:18 +0100 Subject: [Scilab-users] Variable scope in Scilab In-Reply-To: <93aa070c-036f-a279-0c3d-94da25e257fd@utc.fr> References: <8ad002b5-ddc8-30b2-943f-5177d85adea7@fceia.unr.edu.ar> <93aa070c-036f-a279-0c3d-94da25e257fd@utc.fr> Message-ID: <5f3ca917-fd5f-2deb-7edb-bd43b0012576@laas.fr> On 01/03/2021 09:06, St?phane Mottelet wrote: > > Hi Frederico, > > I do not have any problem with the variable scoping in Scilab and as I > said before, even in Julia there is a similar scoping (at least for > the particular case of functions). However, the status of formal input > and output parameters should prevent the scoping to apply to them. For > example, the following does also work (as an addition to my previous > example for the input parameter): > > function y=f(x) > endfunction > > y=1 > f > > -> f > ?ans? = > > ?? 1. > > Frankly speaking, allowing such a behavior is madness... > Hello St?phane, Yes, I think both behaviors you described are non intuitive. Antoine > S. > > Le 27/02/2021 ? 01:33, Federico Miyara a ?crit?: >> >> St?phane, >> >> I agree it shouldn't happen, but the same moment access to outer >> variables is granted you can't prevent such thing to happen since >> inside the function all variables have a name which is more than just >> a symbol or a mute variable, and this includes undefined arguments. >> >> This scoping feature is dangerous and I don't think it would be >> advisable to create a macro for general use exploiting it. >> >> May be someone can provide an example where it has been used with >> profit or explain why it was originally introduced >> >> Regards, >> >> Federico Miyara >> >> On 26/02/2021 10:38, St?phane Mottelet wrote: >>> Hi all, >>> >>> In Scilab the scope of variables is quite permissive but even in >>> Julia (really strict rules) we can have the following behavior: >>> >>> function y=f(x) >>> ?y=x+a; >>> end >>> >>> a=1; >>> f(2) >>> a=2; >>> f(3) >>> >>> -> a=1; >>> >>> --> f(2) >>> ?ans? = >>> >>> ?? 3. >>> >>> --> a=2; >>> >>> --> f(3) >>> ?ans? = >>> >>> ?? 5. >>> >>> Yesterday afternoon I was my students for a Scilab beginners >>> tutorial, and by accident one of them had "x" defined before in the >>> main workspace and tried to call f without arguments. I reproduce >>> the experiment here by explicitely defining x before the call: >>> >>> x=1; >>> f >>> >>> --> x=1; >>> >>> --> f >>> ?ans? = >>> >>> ?? 3. >>> >>> Allowing the function inner scope to see variables of the outer >>> scope is one thing, you may or may not agree this is not the point >>> here, but allowing to call f without arguments just because the >>> formal input parameter has the same symbol as an outer scope symbol >>> is another thing. I knew this was possible even if i never used such >>> a feature, but my students were so puzzled by this, particularly >>> those who already learned other low-level languages, that I decided >>> to propose the suppression of this, that I consider as a serious >>> potential source of many bugs. Don't tell me that this would break >>> some user code because I frankly have no consideration for this kind >>> of crappy shortcut and, sorry if it may sound rude, for programmers >>> who use it... >>> >>> S. >>> >> >> >> >> Libre de virus. www.avast.com >> >> >> >> <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> >> >> _______________________________________________ >> 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 Mon Mar 8 02:57:08 2021 From: fmiyara at fceia.unr.edu.ar (Federico Miyara) Date: Sun, 7 Mar 2021 22:57:08 -0300 Subject: [Scilab-users] Why window() provides only symmetric weighting? In-Reply-To: References: Message-ID: <581d4d2d-476e-5bcb-74b7-bb17e4ffe4e0@fceia.unr.edu.ar> Dear all, Just in case somebody finds this useful, I'm attaching a proposal of a modified version of the function window() which includes three new window functions: Blackman, Blackman-Harris and one out of many different flat-top windows. It also allows a new argument, opt, which can be either "per" for periodic option or "sym" or any other value (or no value) for triggering the default symmetric option. If there were interest, several other windows could be easily added. Regards, Federico Miyara On 11/02/2021 04:12, Federico Miyara wrote: > > Dear All, > > I wonder why windowing functions such as Hann, Hamming, etc., provided > by window(), are only symmetric. > > When used for spectral analysis by subsequent use of fft(), the > periodic weighting is better than the symmetric one. The symmetric > window is mainly used in the design of FIR filters, which I guess is a > less frequent application than spectral analysis. > > While it is true that an easy workaround to get a periodic window of > length n is, for instance > > w = window("hn", n+1)(1:$-1); > > a syntax such as this > > w = window("hn", n, "per"); > > would be easier.Setting "sym" as the default option, no backward > compatibility issues would possibly arise. > > Regards, > > Federico Miyara > > > Libre de virus. www.avast.com > > > > <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> > > _______________________________________________ > users mailing list > users at lists.scilab.org > http://lists.scilab.org/mailman/listinfo/users -- El software de antivirus Avast ha analizado este correo electr?nico en busca de virus. https://www.avast.com/antivirus -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab // Copyright (C) INRIA - 1988 - C. Bunks // // Copyright (C) 2012 - 2021 - 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 [win_l,cwp] = window(wtype,n,par,opt) //[win_l,cwp] = window(wtype,n,par) //macro that calculates symmetric window // wtype :window type (re,tr,hn,hm,kr,ch) // n :window length // par :parameter 2-vector (kaiser window: par(1)=beta>0) // : (chebyshev window:par=[dp,df]) // : dp=main lobe width (00) // opt :window option: "sym" (symmetric) // "per" (periodic) // win :window // cwp :unspecified Chebyshev window parameter //! WT = ["re","tr","hm","hn","kr","ch","bl","bh","ft"] if isdef("opt") then if opt=="per" then n = n+1; end end if and(wtype<>WT) then error(msprintf(_("%s: Wrong value for input argument #%d: Must be in the set {%s}.\n"),"window",1,strcat(WT,","))) end if type(n)<>1|size(n,"*")<>1|~isreal(n)|size(n,"*")<>1|int(n)<>n|n<1 then error(msprintf(_("%s: Wrong type for input argument #%d: A positive integer expected.\n"),"window",2)) end if or(wtype==["kr","ch"]) then if type(par)<>1|~isreal(par) then error(msprintf(_("%s: Wrong type for input argument #%d: A %d-by-%d real vector expected.\n"),"window",3,1,2)) end if wtype=="kr" then if size(par,"*")==0| size(par,"*")>2 then error(msprintf(_("%s: Wrong size for input argument #%d: A %d-by-%d real vector expected.\n"),"window",3,1,2)) end Beta = par(1) if Beta<0 then error(msprintf(_("%s: Input argument #%d must be strictly positive.\n"),"window",3)) end else //chebychev if size(par,"*")<>2 then error(msprintf(_("%s: Wrong size for input argument #%d: A %d-by-%d real vector expected.\n"),"window",3,1,2)) end dp = par(1);df = par(2) if dp>0 then if df>0 then error(msprintf(_("%s: Wrong value for input argument #%d: incorrect element #%d\n"),"window",3,2)) end if dp>=0.5 then error(msprintf(_("%s: Wrong value for input argument #%d: incorrect element #%d\n"),"window",3,1)) end unknown = "df"; else if df<=0 then error(msprintf(_("%s: Wrong value for input argument #%d: incorrect element #%d\n"),"window",3,2)) end unknown = "dp"; end end end cwp = -1; //Pre-calculations no2 = (n-1)/2; xt = (-no2:no2); un = ones(1,n); //Design window according to window type select wtype case "re" then //Rectangular window. win_l = un; case "tr" then //Triangular window. win_l = un-2*abs(xt)/(n+1); case "hm" then //Hamming window. win_l = 0.54*un+0.46*cos(2*%pi*xt/(n-1)); case "hn" then //Hann window. win_l = 0.5*un+0.5*cos(2*%pi*xt/(n-1)); case "bl" then //Blackman window win_l = 0.42*un + 0.5*cos(2*%pi*xt/(n-1)) + 0.08*cos(4*%pi*xt/(n-1)); case "bh" then //Blackman-Harris window win_l = 0.35875*un - 0.48829*cos(2*%pi*xt/(n-1)) + ... 0.14128*cos(4*%pi*xt/(n-1)) - ... 0.01168*cos(6*%pi*xt/(n-1)); case "ft" then //Flat-top HFT70 window //https://pure.mpg.de/pubman/faces/ViewItemFullPage.jsp?itemId=item_152164_2 win_l = un - 1.90796*cos(2*%pi*xt/(n-1)) + ... 1.07349*cos(4*%pi*xt/(n-1)) - ... 0.18199*cos(6*%pi*xt/(n-1)); case "kr" then //Kaiser window with parameter beta (n,beta) //http://en.wikipedia.org/wiki/Kaiser_window win_l = besseli(0,Beta*sqrt(1-(2*(0:n-1)/(n-1)-1).^2))/besseli(0,Beta); case "ch" then //Chebyshev window m = (n-1)/2; select unknown case "dp" then dp = 1/cosh((n-1)*acosh(1/cos(%pi*df))); cwp = dp; case "df" then df = real(acos(1/cosh(acosh((1+dp)/dp)/(n-1)))/%pi) cwp = df; end //Pre-calculation np1 = int((n+1)/2); odd = modulo(n,2)==1 x0 = (3-cos(2*%pi*df))/(1+cos(2*%pi*df)); alpha = (x0+1)/2; Beta = (x0-1)/2; c2 = (n-1)/2; //Obtain the frequency values of the Chebyshev window f = (0:n-1)/n; xarg = alpha*cos(2*%pi*f)+Beta; //Evaluate Chebyshev polynomials // / cos(n acos(x), |x| <= 1 // p(x) = | // \ cosh(n acosh(x), |x| > 1 pr = zeros(1,n);//real part pi = zeros(1,n); //imaginary part ind = find(xarg<=1); pr(ind) = dp*cos (c2*acos (xarg(ind))); ind = find(xarg>1); pr(ind) = dp*cosh(c2*acosh(xarg(ind))); pr = real(pr); if ~odd then pr = pr.*cos(%pi*f); pi = -pr.*sin(%pi*f); antisym = [1*ones(1:int(n/2)+1),-1*ones(int(n/2)+2:n)]; pr = pr.*antisym; pi = pi.*antisym; end //Calculate the window coefficients using the inverse DFT twn = 2*%pi/n; xj = (0:n-1); for i = 1:np1; arg = twn*(i-1)*xj w(i) = sum(pr.*cos(arg)+pi.*sin(arg)); end, c1 = w(1); w = w/c1; if odd then win_l(np1:n) = w(1:np1); win_l(1:np1-1) = w(np1-1:-1:1); else, win_l(np1+1:n) = w(1:np1); win_l(1:np1) = w(np1:-1:1); end win_l = real(win_l'); end if isdef("opt") then if opt=="per" then win_l = win_l(1:$-1); end end endfunction From Jean-Yves.Baudais at insa-rennes.fr Mon Mar 8 08:33:08 2021 From: Jean-Yves.Baudais at insa-rennes.fr (Jean-Yves Baudais) Date: Mon, 8 Mar 2021 08:33:08 +0100 Subject: [Scilab-users] interp and memory Message-ID: <87c2fcd8-2ac4-c4c5-43ef-8337ef0ed6a4@insa-rennes.fr> Hello, Is my code wrong or is there a real memory problem with the function interp in the following code? (Scilab fulfills the memory and of course stops.) for i=1:1000 mprintf("%d\n",i); n=1e6; xp=1:n; x=1:100:n; y=rand(x); d=splin(x,y); z=interp(xp,x,y,d); end Thanks, Jean-Yves From fmiyara at fceia.unr.edu.ar Mon Mar 8 09:33:18 2021 From: fmiyara at fceia.unr.edu.ar (Federico Miyara) Date: Mon, 8 Mar 2021 05:33:18 -0300 Subject: [Scilab-users] interp and memory In-Reply-To: <87c2fcd8-2ac4-c4c5-43ef-8337ef0ed6a4@insa-rennes.fr> References: <87c2fcd8-2ac4-c4c5-43ef-8337ef0ed6a4@insa-rennes.fr> Message-ID: Jean-Ives, It seems that the variables are not so huge, xp has 1000000 components as well as z, while x and y have 10000 components. But I guess splin() gets the derivatives through solving a linear equation system of, in this case, 10000 x 10000, and even if the system's matrix is quasi diagonal (it has only the diagonal, sub-diagonal and supra-diagonal components different from 0) and this surely reduces the computational load, it seems quite a large system and probably it gets stuck here. Probably a lighter (and better) way to do what you seem to be looking for is to try to resample your x-y data by a factor of 100 using intdec(). However, doing that 1000 times may take quite a long time (I haven't tested it). If you really need that, it would probably be better to do the oversampling algorithm from scratch in such a way to design only once the smoothing filter instead of letting intdec() design the same filter over and over again. Regards, Federico Miyara On 08/03/2021 04:33, Jean-Yves Baudais wrote: > Hello, > > ? Is my code wrong or is there a real memory problem with the function > interp in the following code? (Scilab fulfills the memory and of > course stops.) > > for i=1:1000 > ? mprintf("%d\n",i); > ? n=1e6; > ? xp=1:n; > ? x=1:100:n; > ? y=rand(x); > ? d=splin(x,y); > ? z=interp(xp,x,y,d); > end > > Thanks, > > Jean-Yves > _______________________________________________ > users mailing list > users at lists.scilab.org > http://lists.scilab.org/mailman/listinfo/users > -- El software de antivirus Avast ha analizado este correo electr?nico en busca de virus. https://www.avast.com/antivirus -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jean-Yves.Baudais at insa-rennes.fr Mon Mar 8 09:56:40 2021 From: Jean-Yves.Baudais at insa-rennes.fr (Jean-Yves Baudais) Date: Mon, 8 Mar 2021 09:56:40 +0100 Subject: [Scilab-users] interp and memory In-Reply-To: References: <87c2fcd8-2ac4-c4c5-43ef-8337ef0ed6a4@insa-rennes.fr> Message-ID: Hi, > But I guess splin() gets the derivatives [...] Oh, maybe I was not clear. The memory issue is not here. There is not problem to compute z. The loop is used to show the problem: it seems that interp doesn't free the used memory after each call. So after hundreds of call Scilab is killed! for i=1:1000 ? mprintf("%d\n",i); ? n=1e6; ? xp=1:n; ? x=1:100:n; ? y=rand(x); ? d=splin(x,y); ? z=interp(xp,x,y,d); end --Jean-Yves From antoine.monmayrant at laas.fr Mon Mar 8 10:28:24 2021 From: antoine.monmayrant at laas.fr (Antoine Monmayrant) Date: Mon, 8 Mar 2021 10:28:24 +0100 Subject: [Scilab-users] interp and memory In-Reply-To: References: <87c2fcd8-2ac4-c4c5-43ef-8337ef0ed6a4@insa-rennes.fr> Message-ID: <77f24b19-f63b-22df-936b-06d0b30f575a@laas.fr> Hello Jean-Yves, Yes, you are right, it does look like a memory leak: the memory increases linearly with the number of iterations (see attached file and modified script below). But keep in mind that the plot might integrate some growing overhead due to the plotting... Antoine ///////// niter=1000; mems=zeros(1:niter+1)*%nan; is=0:niter; h=scf(); mem=evstr(tokens(unix_g('free -b| grep ''Mem:'''))(3)); mems(1)=mem; plot(is,mems,'k.'); xlabel('iteration of splin/interp') ylabel('memory used') for i=1:niter ? mprintf("%d\n",i); ? n=1e6; ? xp=1:n; ? x=1:100:n; ? y=rand(x); ? d=splin(x,y); ? z=interp(xp,x,y,d); ? mem=evstr(tokens(unix_g('free -b| grep ''Mem:'''))(3)); ? mems(i+1)=mem; ? plot(is,mems,'k.'); ? xs2png(h,"memory_leak.png"); end Le 08/03/2021 ? 09:56, Jean-Yves Baudais a ?crit?: > for i=1:1000 > ? mprintf("%d\n",i); > ? n=1e6; > ? xp=1:n; > ? x=1:100:n; > ? y=rand(x); > ? d=splin(x,y); > ? z=interp(xp,x,y,d); > end -------------- next part -------------- A non-text attachment was scrubbed... Name: memory_leak.png Type: image/png Size: 9508 bytes Desc: not available URL: From antoine.monmayrant at laas.fr Mon Mar 8 10:42:05 2021 From: antoine.monmayrant at laas.fr (Antoine Monmayrant) Date: Mon, 8 Mar 2021 10:42:05 +0100 Subject: [Scilab-users] interp and memory In-Reply-To: References: <87c2fcd8-2ac4-c4c5-43ef-8337ef0ed6a4@insa-rennes.fr> Message-ID: <6d8567e2-0fbb-3347-7f71-d15cbb7ab0b7@laas.fr> Hello Jean-Yves, There is a memory leak, in interp, not splin. Could you create a bug report? Antoine /////// test=%t; // no leak if true, leak if false niter=100; mems=zeros(1:niter+1)*%nan; is=0:niter; h=scf(); mem=evstr(tokens(unix_g('free -b| grep ''Mem:'''))(3)); mems(1)=mem; plot(is,mems,'k.'); xlabel('iteration of splin/interp') ylabel('memory used') for i=1:niter ? mprintf("%d\n",i); ? n=1e6; ? xp=1:n; ? x=1:100:n; ? y=rand(x); ? if test then ????? d=splin(x,y); ????? z=rand(xp); ? else ???? d=splin(x,y); ???? z=interp(xp,x,y,d); ? end ? mem=evstr(tokens(unix_g('free -b| grep ''Mem:'''))(3)); ? mems(i+1)=mem; ? plot(is,mems,'k.'); ? if test then ????? xs2png(h,"memory_leak_test.png"); ? else ????? xs2png(h,"memory_leak.png"); ? end end Le 08/03/2021 ? 09:56, Jean-Yves Baudais a ?crit?: > Hi, > > >> But I guess splin() gets the derivatives [...] > > Oh, maybe I was not clear. The memory issue is not here. There is not > problem to compute z. The loop is used to show the problem: it seems > that interp doesn't free the used memory after each call. So after > hundreds of call Scilab is killed! > > for i=1:1000 > ? mprintf("%d\n",i); > ? n=1e6; > ? xp=1:n; > ? x=1:100:n; > ? y=rand(x); > ? d=splin(x,y); > ? z=interp(xp,x,y,d); > end > > --Jean-Yves > _______________________________________________ > users mailing list > users at lists.scilab.org > http://lists.scilab.org/mailman/listinfo/users > From stephane.mottelet at utc.fr Mon Mar 8 11:52:38 2021 From: stephane.mottelet at utc.fr (=?UTF-8?Q?St=c3=a9phane_Mottelet?=) Date: Mon, 8 Mar 2021 11:52:38 +0100 Subject: [Scilab-users] interp and memory In-Reply-To: <6d8567e2-0fbb-3347-7f71-d15cbb7ab0b7@laas.fr> References: <87c2fcd8-2ac4-c4c5-43ef-8337ef0ed6a4@insa-rennes.fr> <6d8567e2-0fbb-3347-7f71-d15cbb7ab0b7@laas.fr> Message-ID: <12db88bb-30b0-06f8-9b48-6b1dba6c6ac5@utc.fr> It has been fixed by Antoine some minutes ago: https://codereview.scilab.org/#/c/21708/ S. Le 08/03/2021 ? 10:42, Antoine Monmayrant a ?crit?: > Hello Jean-Yves, > > There is a memory leak, in interp, not splin. > Could you create a bug report? > > Antoine > > /////// > > test=%t; // no leak if true, leak if false > > niter=100; > mems=zeros(1:niter+1)*%nan; > is=0:niter; > > h=scf(); > mem=evstr(tokens(unix_g('free -b| grep ''Mem:'''))(3)); > mems(1)=mem; > plot(is,mems,'k.'); > xlabel('iteration of splin/interp') > ylabel('memory used') > for i=1:niter > ? mprintf("%d\n",i); > ? n=1e6; > ? xp=1:n; > ? x=1:100:n; > ? y=rand(x); > ? if test then > ????? d=splin(x,y); > ????? z=rand(xp); > ? else > ???? d=splin(x,y); > ???? z=interp(xp,x,y,d); > ? end > ? mem=evstr(tokens(unix_g('free -b| grep ''Mem:'''))(3)); > ? mems(i+1)=mem; > ? plot(is,mems,'k.'); > ? if test then > ????? xs2png(h,"memory_leak_test.png"); > ? else > ????? xs2png(h,"memory_leak.png"); > ? end > > end > > > Le 08/03/2021 ? 09:56, Jean-Yves Baudais a ?crit?: >> Hi, >> >> >>> But I guess splin() gets the derivatives [...] >> >> Oh, maybe I was not clear. The memory issue is not here. There is not >> problem to compute z. The loop is used to show the problem: it seems >> that interp doesn't free the used memory after each call. So after >> hundreds of call Scilab is killed! >> >> for i=1:1000 >> ? mprintf("%d\n",i); >> ? n=1e6; >> ? xp=1:n; >> ? x=1:100:n; >> ? y=rand(x); >> ? d=splin(x,y); >> ? z=interp(xp,x,y,d); >> end >> >> --Jean-Yves >> _______________________________________________ >> users mailing list >> users at lists.scilab.org >> https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/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 From Jean-Yves.Baudais at insa-rennes.fr Wed Mar 10 22:30:02 2021 From: Jean-Yves.Baudais at insa-rennes.fr (Jean-Yves Baudais) Date: Wed, 10 Mar 2021 22:30:02 +0100 (CET) Subject: [Scilab-users] Scilab stops calculus Message-ID: <432866403.116410.1615411802737.JavaMail.zimbra@insa-rennes.fr> Hello, Two times Scilab was stuck after 20 hours of simulation (I used to do simulations that need more than one week with Scilab 5). It was big simulation with many levels of iterations (to evaluate probabilities), with intermediate results written in files (different files with save command and timestamp), and with the iteration numbers written in the Scilab window (so many output lines). All worked fine still Scilab locks with: - no CPU activity (Scilab really stops all calculus, but not exits), - low memory use as expected (no mem leakage), - the Scilab window blocked, showing the intermediate iteration numbers (Scilab is blocked within an iteration, there is no input-output issues in this part of the code), but nothing can be done (CTRL-C, CTRL-D or any control command). I must kill the Scilab process within a Shell terminal. I also executed the "faulty" iteration alone (with 1e4 sub-iterations in more or less 2 hours), but there is no problem. I obtained the result. So I can get around the problem, but not solved it. Is there some known limitations? limited prompt lines for example... Thanks -- Jean-Yves Baudais From brandon.tyoung22 at gmail.com Wed Mar 10 22:40:19 2021 From: brandon.tyoung22 at gmail.com (bty22) Date: Wed, 10 Mar 2021 14:40:19 -0700 (MST) Subject: [Scilab-users] Overarching subplot title for graphic window Message-ID: <1615412419386-0.post@n3.nabble.com> Hello, I have been trying to figure out a way to add an overarching title on the graphic window that goes above the subplots? I have titles over each of my subplots, but I want one that is the title of the graphic window where the subplots are shown. I want to have the title to give a summary of what the subplots are of. I know it can be done in matlab through suptitle, but I couldn't find a respective equivalent for scilab. Thank you for your response in advance. -- Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html From Jean-Yves.Baudais at insa-rennes.fr Thu Mar 11 09:03:16 2021 From: Jean-Yves.Baudais at insa-rennes.fr (Jean-Yves Baudais) Date: Thu, 11 Mar 2021 09:03:16 +0100 (CET) Subject: [Scilab-users] Overarching subplot title for graphic window In-Reply-To: <1615412419386-0.post@n3.nabble.com> References: <1615412419386-0.post@n3.nabble.com> Message-ID: <488496115.133100.1615449796739.JavaMail.zimbra@insa-rennes.fr> Hi, > I have been trying to figure out a way to add an overarching title on the > graphic window that goes above the subplots? I have titles over each of my > subplots, but I want one that is the title of the graphic window where the > subplots are shown. I want to have the title to give a summary of what the > subplots are of. Something like that? scf(0); xtitle("Title") xsetech([0,0.1,0.5,0.45]),plot(1:10,1:10),xtitle("First") xsetech([0.5,0.1,0.5,0.45]),plot(1:10,-(1:10)),xtitle("Second") xsetech([0,0.55,1,0.45]),plot(0:10,sin(0:10)),xtitle("Last") -- Jean-Yves From antoine.monmayrant at laas.fr Thu Mar 11 09:34:39 2021 From: antoine.monmayrant at laas.fr (Antoine Monmayrant) Date: Thu, 11 Mar 2021 09:34:39 +0100 Subject: [Scilab-users] Scilab stops calculus In-Reply-To: <432866403.116410.1615411802737.JavaMail.zimbra@insa-rennes.fr> References: <432866403.116410.1615411802737.JavaMail.zimbra@insa-rennes.fr> Message-ID: <0a92ac47-0476-8b93-d2cf-406686a5652c@laas.fr> Hello Jean-Yves, Are you running scilab under Linux? It might not be related, but I noticed that when my computer resumes from sleep, all the scilab GUI is unresponsive. I don't have this issue when running scilab-cli. Can you run your long simulation without gui? Antoine Le 10/03/2021 ? 22:30, Jean-Yves Baudais a ?crit?: > Hello, > > Two times Scilab was stuck after 20 hours of simulation (I used to do simulations that need more than one week with Scilab 5). It was big simulation with many levels of iterations (to evaluate probabilities), with intermediate results written in files (different files with save command and timestamp), and with the iteration numbers written in the Scilab window (so many output lines). All worked fine still Scilab locks with: > - no CPU activity (Scilab really stops all calculus, but not exits), > - low memory use as expected (no mem leakage), > - the Scilab window blocked, showing the intermediate iteration numbers (Scilab is blocked within an iteration, there is no input-output issues in this part of the code), but nothing can be done (CTRL-C, CTRL-D or any control command). > I must kill the Scilab process within a Shell terminal. I also executed the "faulty" iteration alone (with 1e4 sub-iterations in more or less 2 hours), but there is no problem. I obtained the result. So I can get around the problem, but not solved it. > > Is there some known limitations? limited prompt lines for example... > > Thanks > From Jean-Yves.Baudais at insa-rennes.fr Thu Mar 11 11:08:07 2021 From: Jean-Yves.Baudais at insa-rennes.fr (Jean-Yves Baudais) Date: Thu, 11 Mar 2021 11:08:07 +0100 (CET) Subject: [Scilab-users] Scilab stops calculus In-Reply-To: <0a92ac47-0476-8b93-d2cf-406686a5652c@laas.fr> References: <432866403.116410.1615411802737.JavaMail.zimbra@insa-rennes.fr> <0a92ac47-0476-8b93-d2cf-406686a5652c@laas.fr> Message-ID: <1410174826.153157.1615457287477.JavaMail.zimbra@insa-rennes.fr> Hi Antoine, > Are you running scilab under Linux? Yes. > It might not be related, but I noticed that when my computer resumes > from sleep, all the scilab GUI is unresponsive. I removed all sleep modes on my computer (to maintain VPN access and get around some other problems) and I never use them. > Can you run your long simulation without gui? It was. I tested the following i=0;while 1, i=i+1;mprintf("%d\n",i); end; and there is no problem up to i=2e8 with -nwni option, and up to i=5e7 with gui (I locked my screen during the simulation and unlocked it to stop the simulation, no problem to resume). So, my first feeling was wrong, it's not a prompt limitation. Strange behaviour... -- Jean-Yves From antoine.monmayrant at laas.fr Thu Mar 11 15:56:32 2021 From: antoine.monmayrant at laas.fr (Antoine Monmayrant) Date: Thu, 11 Mar 2021 15:56:32 +0100 Subject: [Scilab-users] Scilab stops calculus In-Reply-To: <1410174826.153157.1615457287477.JavaMail.zimbra@insa-rennes.fr> References: <432866403.116410.1615411802737.JavaMail.zimbra@insa-rennes.fr> <0a92ac47-0476-8b93-d2cf-406686a5652c@laas.fr> <1410174826.153157.1615457287477.JavaMail.zimbra@insa-rennes.fr> Message-ID: <1b0e8421-8fa3-2821-ddff-3ad8e7e8497b@laas.fr> On 11/03/2021 11:08, Jean-Yves Baudais wrote: > Hi Antoine, > >> Are you running scilab under Linux? > Yes. > >> It might not be related, but I noticed that when my computer resumes >> from sleep, all the scilab GUI is unresponsive. > I removed all sleep modes on my computer (to maintain VPN access and get around some other problems) and I never use them. > >> Can you run your long simulation without gui? > It was. I tested the following > > i=0;while 1, i=i+1;mprintf("%d\n",i); end; > > and there is no problem up to i=2e8 with -nwni option, and up to i=5e7 with gui (I locked my screen during the simulation and unlocked it to stop the simulation, no problem to resume). So, my first feeling was wrong, it's not a prompt limitation. It might be java-related as -nwni is shutting off all the java-based elements of Scilab. I don't know whether this bug has been reported yet... Antoine > > Strange behaviour... > > -- Jean-Yves > _______________________________________________ > users mailing list > users at lists.scilab.org > http://lists.scilab.org/mailman/listinfo/users > From stephane.mottelet at utc.fr Thu Mar 11 17:03:43 2021 From: stephane.mottelet at utc.fr (=?UTF-8?Q?St=c3=a9phane_Mottelet?=) Date: Thu, 11 Mar 2021 17:03:43 +0100 Subject: [Scilab-users] Scilab stops calculus In-Reply-To: <1b0e8421-8fa3-2821-ddff-3ad8e7e8497b@laas.fr> References: <432866403.116410.1615411802737.JavaMail.zimbra@insa-rennes.fr> <0a92ac47-0476-8b93-d2cf-406686a5652c@laas.fr> <1410174826.153157.1615457287477.JavaMail.zimbra@insa-rennes.fr> <1b0e8421-8fa3-2821-ddff-3ad8e7e8497b@laas.fr> Message-ID: Hi, Le 11/03/2021 ? 15:56, Antoine Monmayrant a ?crit?: > > On 11/03/2021 11:08, Jean-Yves Baudais wrote: >> Hi Antoine, >> >>> Are you running scilab under Linux? >> Yes. >> >>> It might not be related, but I noticed that when my computer resumes >>> from sleep, all the scilab GUI is unresponsive. >> I removed all sleep modes on my computer (to maintain VPN access and >> get around some other problems) and I never use them. >> >>> Can you run your long simulation without gui? >> It was. I tested the following >> >> i=0;while 1, i=i+1;mprintf("%d\n",i); end; >> >> and there is no problem up to i=2e8 with -nwni option, and up to >> i=5e7 with gui (I locked my screen during the simulation and unlocked >> it to stop the simulation, no problem to resume). So, my first >> feeling was wrong, it's not a prompt limitation. > It might be java-related as -nwni is shutting off all the java-based > elements of Scilab. > > I don't know whether this bug has been reported yet... Did you try without the mprintf ? S; > > Antoine > >> >> Strange behaviour... >> >> -- Jean-Yves >> _______________________________________________ >> users mailing list >> users at lists.scilab.org >> https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/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 From stephane.mottelet at utc.fr Fri Mar 12 08:16:26 2021 From: stephane.mottelet at utc.fr (=?UTF-8?Q?St=c3=a9phane_Mottelet?=) Date: Fri, 12 Mar 2021 08:16:26 +0100 Subject: [Scilab-users] Scilab stops calculus In-Reply-To: <1410174826.153157.1615457287477.JavaMail.zimbra@insa-rennes.fr> References: <432866403.116410.1615411802737.JavaMail.zimbra@insa-rennes.fr> <0a92ac47-0476-8b93-d2cf-406686a5652c@laas.fr> <1410174826.153157.1615457287477.JavaMail.zimbra@insa-rennes.fr> Message-ID: <33a4ddf1-b0f3-f1c7-6ae0-acc26bccc946@utc.fr> Hello Jean-Yves, I am affraid that the problem could be due to the output, because I had no problem to run the loop for almost one day under Linux (with latests? branch-6.1 build): --> unix("date"); jeudi 11 mars 2021, 17:11:48 (UTC+0100) --> i=0;while 1, i=i+1;end; -1-> unix("date"); vendredi 12 mars 2021, 08:13:08 (UTC+0100) -1-> i ?i? = ?? 1.667D+11 -1-> S. Le 11/03/2021 ? 11:08, Jean-Yves Baudais a ?crit?: > Hi Antoine, > >> Are you running scilab under Linux? > Yes. > >> It might not be related, but I noticed that when my computer resumes >> from sleep, all the scilab GUI is unresponsive. > I removed all sleep modes on my computer (to maintain VPN access and get around some other problems) and I never use them. > >> Can you run your long simulation without gui? > It was. I tested the following > > i=0;while 1, i=i+1;mprintf("%d\n",i); end; > > and there is no problem up to i=2e8 with -nwni option, and up to i=5e7 with gui (I locked my screen during the simulation and unlocked it to stop the simulation, no problem to resume). So, my first feeling was wrong, it's not a prompt limitation. > > Strange behaviour... > > -- Jean-Yves > _______________________________________________ > 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 Christophe.Dang at sidel.com Fri Mar 12 09:16:11 2021 From: Christophe.Dang at sidel.com (Dang Ngoc Chan, Christophe) Date: Fri, 12 Mar 2021 08:16:11 +0000 Subject: [Scilab-users] Overarching subplot title for graphic window In-Reply-To: <1615412419386-0.post@n3.nabble.com> References: <1615412419386-0.post@n3.nabble.com> Message-ID: Hello, > De : bty22 > Envoy? : mercredi 10 mars 2021 22:40 > > I have been trying to figure out a way to add an overarching title on the graphic window that goes above the subplots? I suggest to create an additional subplot and then use titlepage(). Something like : ---------- X=1:10; subplot(3, 1, 1); titlepage("My big title"); subplot(3, 1, 2); plot(X, X); xtitle("First plot", "x", "y"); subplot(3, 1, 3); plot(X, X.*X); xtitle("Second plot", "x", "y"); ---------- Hope this helps -- Christophe Dang Ngoc Chan cdang at wanadoo.fr 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 Jean-Yves.Baudais at insa-rennes.fr Fri Mar 12 11:09:41 2021 From: Jean-Yves.Baudais at insa-rennes.fr (Jean-Yves Baudais) Date: Fri, 12 Mar 2021 11:09:41 +0100 (CET) Subject: [Scilab-users] Scilab stops calculus In-Reply-To: <33a4ddf1-b0f3-f1c7-6ae0-acc26bccc946@utc.fr> References: <432866403.116410.1615411802737.JavaMail.zimbra@insa-rennes.fr> <0a92ac47-0476-8b93-d2cf-406686a5652c@laas.fr> <1410174826.153157.1615457287477.JavaMail.zimbra@insa-rennes.fr> <33a4ddf1-b0f3-f1c7-6ae0-acc26bccc946@utc.fr> Message-ID: <1761329799.275606.1615543781064.JavaMail.zimbra@insa-rennes.fr> Hello Stephan, To be honest, I don't know where my problem comes from! If you said it cannot be an output problem, I follow you. So, I don't know why I couldn't wake it up and why it has fallen asleep. I need first to reproduce the problem with simple tests... (to rule out wrong code issue) Thanks, Jean-Yves ----- Original Message ----- > From: "St?phane Mottelet" > To: "Users mailing list for Scilab" scilab.org> > Sent: Friday, 12 March, 2021 08:16:26 > Subject: Re: [Scilab-users] Scilab stops calculus > Hello Jean-Yves, > > I am affraid that the problem could be due to the output, because I had > no problem to run the loop for almost one day under Linux (with latests > branch-6.1 build): > > --> unix("date"); > jeudi 11 mars 2021, 17:11:48 (UTC+0100) > > --> i=0;while 1, i=i+1;end; > > -1-> unix("date"); > vendredi 12 mars 2021, 08:13:08 (UTC+0100) > > -1-> i > i = > > 1.667D+11 > > -1-> > > S. > > > Le 11/03/2021 ? 11:08, Jean-Yves Baudais a ?crit : >> Hi Antoine, >> >>> Are you running scilab under Linux? >> Yes. >> >>> It might not be related, but I noticed that when my computer resumes >>> from sleep, all the scilab GUI is unresponsive. >> I removed all sleep modes on my computer (to maintain VPN access and get around >> some other problems) and I never use them. >> >>> Can you run your long simulation without gui? >> It was. I tested the following >> >> i=0;while 1, i=i+1;mprintf("%d\n",i); end; >> >> and there is no problem up to i=2e8 with -nwni option, and up to i=5e7 with gui >> (I locked my screen during the simulation and unlocked it to stop the >> simulation, no problem to resume). So, my first feeling was wrong, it's not a >> prompt limitation. >> >> Strange behaviour... >> >> -- Jean-Yves >> _______________________________________________ >> 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 -- Jean-Yves Baudais Pour un bon usage de la messagerie https://intranet.univ-rennes2.fr/system/files/UHB/DRH/ACTION-SOCIALE/plaqu_dubonusage.b-1.pdf From stephane.mottelet at utc.fr Fri Mar 12 11:40:13 2021 From: stephane.mottelet at utc.fr (=?UTF-8?Q?St=c3=a9phane_Mottelet?=) Date: Fri, 12 Mar 2021 11:40:13 +0100 Subject: [Scilab-users] Scilab stops calculus In-Reply-To: <1761329799.275606.1615543781064.JavaMail.zimbra@insa-rennes.fr> References: <432866403.116410.1615411802737.JavaMail.zimbra@insa-rennes.fr> <0a92ac47-0476-8b93-d2cf-406686a5652c@laas.fr> <1410174826.153157.1615457287477.JavaMail.zimbra@insa-rennes.fr> <33a4ddf1-b0f3-f1c7-6ae0-acc26bccc946@utc.fr> <1761329799.275606.1615543781064.JavaMail.zimbra@insa-rennes.fr> Message-ID: <2c8d594c-2f5f-502d-9954-ddb68519cf01@utc.fr> Stay tuned, I have relaunched the loop but this time including the mprintf and will keep you informed of the result (freeze or no freeze) S. Le 12/03/2021 ? 11:09, Jean-Yves Baudais a ?crit?: > Hello Stephan, > > To be honest, I don't know where my problem comes from! If you said it cannot be an output problem, I follow you. So, I don't know why I couldn't wake it up and why it has fallen asleep. I need first to reproduce the problem with simple tests... (to rule out wrong code issue) > > Thanks, > > Jean-Yves > > ----- Original Message ----- >> From: "St?phane Mottelet" >> To: "Users mailing list for Scilab" scilab.org> >> Sent: Friday, 12 March, 2021 08:16:26 >> Subject: Re: [Scilab-users] Scilab stops calculus >> Hello Jean-Yves, >> >> I am affraid that the problem could be due to the output, because I had >> no problem to run the loop for almost one day under Linux (with latests >> branch-6.1 build): >> >> --> unix("date"); >> jeudi 11 mars 2021, 17:11:48 (UTC+0100) >> >> --> i=0;while 1, i=i+1;end; >> >> -1-> unix("date"); >> vendredi 12 mars 2021, 08:13:08 (UTC+0100) >> >> -1-> i >> i = >> >> 1.667D+11 >> >> -1-> >> >> S. >> >> >> Le 11/03/2021 ? 11:08, Jean-Yves Baudais a ?crit : >>> Hi Antoine, >>> >>>> Are you running scilab under Linux? >>> Yes. >>> >>>> It might not be related, but I noticed that when my computer resumes >>>> from sleep, all the scilab GUI is unresponsive. >>> I removed all sleep modes on my computer (to maintain VPN access and get around >>> some other problems) and I never use them. >>> >>>> Can you run your long simulation without gui? >>> It was. I tested the following >>> >>> i=0;while 1, i=i+1;mprintf("%d\n",i); end; >>> >>> and there is no problem up to i=2e8 with -nwni option, and up to i=5e7 with gui >>> (I locked my screen during the simulation and unlocked it to stop the >>> simulation, no problem to resume). So, my first feeling was wrong, it's not a >>> prompt limitation. >>> >>> Strange behaviour... >>> >>> -- Jean-Yves >>> _______________________________________________ >>> 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 >> https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/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 From antoine.monmayrant at laas.fr Fri Mar 12 13:05:29 2021 From: antoine.monmayrant at laas.fr (Antoine Monmayrant) Date: Fri, 12 Mar 2021 13:05:29 +0100 Subject: [Scilab-users] Scilab stops calculus In-Reply-To: <1761329799.275606.1615543781064.JavaMail.zimbra@insa-rennes.fr> References: <432866403.116410.1615411802737.JavaMail.zimbra@insa-rennes.fr> <0a92ac47-0476-8b93-d2cf-406686a5652c@laas.fr> <1410174826.153157.1615457287477.JavaMail.zimbra@insa-rennes.fr> <33a4ddf1-b0f3-f1c7-6ae0-acc26bccc946@utc.fr> <1761329799.275606.1615543781064.JavaMail.zimbra@insa-rennes.fr> Message-ID: <18bf5341-790c-20cb-fac6-a07dcc5cae2d@laas.fr> Hello Jean-Yves, I also ran your test under linux (Ubuntu 18.04, Xorg) and did have any problem (I went beyond i=10^8). What is your specific distro and window manager? Antoine Le 12/03/2021 ? 11:09, Jean-Yves Baudais a ?crit?: > Hello Stephan, > > To be honest, I don't know where my problem comes from! If you said it cannot be an output problem, I follow you. So, I don't know why I couldn't wake it up and why it has fallen asleep. I need first to reproduce the problem with simple tests... (to rule out wrong code issue) > > Thanks, > > Jean-Yves > > ----- Original Message ----- >> From: "St?phane Mottelet" >> To: "Users mailing list for Scilab" scilab.org> >> Sent: Friday, 12 March, 2021 08:16:26 >> Subject: Re: [Scilab-users] Scilab stops calculus >> Hello Jean-Yves, >> >> I am affraid that the problem could be due to the output, because I had >> no problem to run the loop for almost one day under Linux (with latests >> branch-6.1 build): >> >> --> unix("date"); >> jeudi 11 mars 2021, 17:11:48 (UTC+0100) >> >> --> i=0;while 1, i=i+1;end; >> >> -1-> unix("date"); >> vendredi 12 mars 2021, 08:13:08 (UTC+0100) >> >> -1-> i >> i = >> >> 1.667D+11 >> >> -1-> >> >> S. >> >> >> Le 11/03/2021 ? 11:08, Jean-Yves Baudais a ?crit : >>> Hi Antoine, >>> >>>> Are you running scilab under Linux? >>> Yes. >>> >>>> It might not be related, but I noticed that when my computer resumes >>>> from sleep, all the scilab GUI is unresponsive. >>> I removed all sleep modes on my computer (to maintain VPN access and get around >>> some other problems) and I never use them. >>> >>>> Can you run your long simulation without gui? >>> It was. I tested the following >>> >>> i=0;while 1, i=i+1;mprintf("%d\n",i); end; >>> >>> and there is no problem up to i=2e8 with -nwni option, and up to i=5e7 with gui >>> (I locked my screen during the simulation and unlocked it to stop the >>> simulation, no problem to resume). So, my first feeling was wrong, it's not a >>> prompt limitation. >>> >>> Strange behaviour... >>> >>> -- Jean-Yves >>> _______________________________________________ >>> 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 From Jean-Yves.Baudais at insa-rennes.fr Fri Mar 12 14:36:06 2021 From: Jean-Yves.Baudais at insa-rennes.fr (Jean-Yves Baudais) Date: Fri, 12 Mar 2021 14:36:06 +0100 (CET) Subject: [Scilab-users] Scilab stops calculus In-Reply-To: <18bf5341-790c-20cb-fac6-a07dcc5cae2d@laas.fr> References: <432866403.116410.1615411802737.JavaMail.zimbra@insa-rennes.fr> <0a92ac47-0476-8b93-d2cf-406686a5652c@laas.fr> <1410174826.153157.1615457287477.JavaMail.zimbra@insa-rennes.fr> <33a4ddf1-b0f3-f1c7-6ae0-acc26bccc946@utc.fr> <1761329799.275606.1615543781064.JavaMail.zimbra@insa-rennes.fr> <18bf5341-790c-20cb-fac6-a07dcc5cae2d@laas.fr> Message-ID: <640255082.310606.1615556166075.JavaMail.zimbra@insa-rennes.fr> > What is your specific distro and window manager? Unbuntu 18.04 and 16.04 (two computers), Gnome on both. -- Jean-Yves From Jean-Yves.Baudais at insa-rennes.fr Fri Mar 12 15:06:51 2021 From: Jean-Yves.Baudais at insa-rennes.fr (Jean-Yves Baudais) Date: Fri, 12 Mar 2021 15:06:51 +0100 (CET) Subject: [Scilab-users] Scilab stops calculus In-Reply-To: References: <432866403.116410.1615411802737.JavaMail.zimbra@insa-rennes.fr> <0a92ac47-0476-8b93-d2cf-406686a5652c@laas.fr> <1410174826.153157.1615457287477.JavaMail.zimbra@insa-rennes.fr> <33a4ddf1-b0f3-f1c7-6ae0-acc26bccc946@utc.fr> <1761329799.275606.1615543781064.JavaMail.zimbra@insa-rennes.fr> <18bf5341-790c-20cb-fac6-a07dcc5cae2d@laas.fr> <640255082.310606.1615556166075.JavaMail.zimbra@insa-rennes.fr> Message-ID: <1498228887.315031.1615558011289.JavaMail.zimbra@insa-rennes.fr> > OK, and you see this issue on both? The fisrt time on 18.04 (laptop) and the second on 16.04 (desktop PC). > Are you using a wayland session or an Xorg one? XDG_SESSION_TYPE=x11 on both -- Jean-Yves From antoine.monmayrant at laas.fr Fri Mar 12 20:38:56 2021 From: antoine.monmayrant at laas.fr (Antoine Monmayrant) Date: Fri, 12 Mar 2021 20:38:56 +0100 Subject: [Scilab-users] Scilab stops calculus In-Reply-To: <1498228887.315031.1615558011289.JavaMail.zimbra@insa-rennes.fr> References: <432866403.116410.1615411802737.JavaMail.zimbra@insa-rennes.fr> <0a92ac47-0476-8b93-d2cf-406686a5652c@laas.fr> <1410174826.153157.1615457287477.JavaMail.zimbra@insa-rennes.fr> <33a4ddf1-b0f3-f1c7-6ae0-acc26bccc946@utc.fr> <1761329799.275606.1615543781064.JavaMail.zimbra@insa-rennes.fr> <18bf5341-790c-20cb-fac6-a07dcc5cae2d@laas.fr> <640255082.310606.1615556166075.JavaMail.zimbra@insa-rennes.fr> <1498228887.315031.1615558011289.JavaMail.zimbra@insa-rennes.fr> Message-ID: <9de3b854-20f0-9bf4-a472-27382eda920e@laas.fr> On 12/03/2021 15:06, Jean-Yves Baudais wrote: >> OK, and you see this issue on both? > The fisrt time on 18.04 (laptop) and the second on 16.04 (desktop PC). > >> Are you using a wayland session or an Xorg one? > XDG_SESSION_TYPE=x11 on both OK, I'll have to check, I think I can get my hands on a 16.04 and 18.04 with X11... Antoine > > -- Jean-Yves > From antoine.monmayrant at laas.fr Tue Mar 16 11:53:57 2021 From: antoine.monmayrant at laas.fr (Antoine Monmayrant) Date: Tue, 16 Mar 2021 11:53:57 +0100 Subject: [Scilab-users] Scilab stops calculus In-Reply-To: <1498228887.315031.1615558011289.JavaMail.zimbra@insa-rennes.fr> References: <432866403.116410.1615411802737.JavaMail.zimbra@insa-rennes.fr> <0a92ac47-0476-8b93-d2cf-406686a5652c@laas.fr> <1410174826.153157.1615457287477.JavaMail.zimbra@insa-rennes.fr> <33a4ddf1-b0f3-f1c7-6ae0-acc26bccc946@utc.fr> <1761329799.275606.1615543781064.JavaMail.zimbra@insa-rennes.fr> <18bf5341-790c-20cb-fac6-a07dcc5cae2d@laas.fr> <640255082.310606.1615556166075.JavaMail.zimbra@insa-rennes.fr> <1498228887.315031.1615558011289.JavaMail.zimbra@insa-rennes.fr> Message-ID: <7b882cfa-bc9f-db70-337c-dc680fe75c0d@laas.fr> Le 12/03/2021 ? 15:06, Jean-Yves Baudais a ?crit?: >> OK, and you see this issue on both? > The fisrt time on 18.04 (laptop) and the second on 16.04 (desktop PC). > >> Are you using a wayland session or an Xorg one? > XDG_SESSION_TYPE=x11 on both OK, I let your test running for a long time on a 18.04 with X11: I reached few 10? without any issue. Did you manage to reproduce this bug 100% of the time? Antoine > > -- Jean-Yves > From david.cheze at cea.fr Tue Mar 16 14:52:39 2021 From: david.cheze at cea.fr (CHEZE David 227480) Date: Tue, 16 Mar 2021 13:52:39 +0000 Subject: [Scilab-users] find and locate local maxima Message-ID: Hi all, I'm looking for function that could find and locate every local maxima of any discrete time signal (timeseries), similar to Matlab or Octave function findpeaks(), scipy find_peaks(). Is anyone aware if something similar is already available in Scilab ? (I already browsed a little bit and it don't seem so...) If not in Scilab macros, any hint to use the Octave or scipy function directly from Scilab? More globally it seems that Octave Forge could be linked with Python (from oct2py import octave # Load the Octage-Forge signal package. octave.eval("pkg load signal")), does someone ever tried to bridge similarly in Scilab ? oct2sci Kind regards, David -------------- next part -------------- An HTML attachment was scrubbed... URL: From Clement.David at esi-group.com Tue Mar 16 16:27:26 2021 From: Clement.David at esi-group.com (=?iso-8859-1?Q?Cl=E9ment_David?=) Date: Tue, 16 Mar 2021 15:27:26 +0000 Subject: [Scilab-users] find and locate local maxima In-Reply-To: References: Message-ID: Hello David, After reading the Matlab documentation page, it seems pretty simple to implement using Scilab : and $ symbols: function [pks, locs]=findpeaks(data) ii = find(d(1:$-2) < d(2:$-1) & d(2:$-1) >= d(3:$)); pks = data(ii+2); locs = ii + 2; endfunction data = [25 8 15 5 6 10 10 3 1 20 7]; plot(data) [pks,locs] = findpeaks(data); plot(locs, pks, 'xr'); Note: using oct2py and pims might also be an option for simple cases but these wrappers are complex to use and data need to be copied at language boundaries. Regards, Cl?ment From: users On Behalf Of CHEZE David 227480 Sent: Tuesday, March 16, 2021 2:53 PM To: Users mailing list for Scilab Subject: [Scilab-users] find and locate local maxima Hi all, I'm looking for function that could find and locate every local maxima of any discrete time signal (timeseries), similar to Matlab or Octave function findpeaks(), scipy find_peaks(). Is anyone aware if something similar is already available in Scilab ? (I already browsed a little bit and it don't seem so...) If not in Scilab macros, any hint to use the Octave or scipy function directly from Scilab? More globally it seems that Octave Forge could be linked with Python (from oct2py import octave # Load the Octage-Forge signal package. octave.eval("pkg load signal")), does someone ever tried to bridge similarly in Scilab ? oct2sci Kind regards, David -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.cheze at cea.fr Tue Mar 16 17:09:47 2021 From: david.cheze at cea.fr (CHEZE David 227480) Date: Tue, 16 Mar 2021 16:09:47 +0000 Subject: [Scilab-users] find and locate local maxima In-Reply-To: References: Message-ID: Hi Cl?ment, Thank you for your quick reply and solution ! Actually it's working for simple data but with noisy experimental timeseries, some filtering is required to get perfect regular signal (between the 'true' extrema) that could be then managed by the routine. I suppose this is something the Matlab/Octave is handling internally, with some parameters as function's argument to tune it, maybe it's not the case . Regards, David De : users De la part de Cl?ment David Envoy? : mardi 16 mars 2021 16:27 ? : Users mailing list for Scilab Objet : Re: [Scilab-users] find and locate local maxima Hello David, After reading the Matlab documentation page, it seems pretty simple to implement using Scilab : and $ symbols: function [pks, locs]=findpeaks(data) ii = find(d(1:$-2) < d(2:$-1) & d(2:$-1) >= d(3:$)); pks = data(ii+2); locs = ii + 2; endfunction data = [25 8 15 5 6 10 10 3 1 20 7]; plot(data) [pks,locs] = findpeaks(data); plot(locs, pks, 'xr'); Note: using oct2py and pims might also be an option for simple cases but these wrappers are complex to use and data need to be copied at language boundaries. Regards, Cl?ment From: users > On Behalf Of CHEZE David 227480 Sent: Tuesday, March 16, 2021 2:53 PM To: Users mailing list for Scilab > Subject: [Scilab-users] find and locate local maxima Hi all, I'm looking for function that could find and locate every local maxima of any discrete time signal (timeseries), similar to Matlab or Octave function findpeaks(), scipy find_peaks(). Is anyone aware if something similar is already available in Scilab ? (I already browsed a little bit and it don't seem so...) If not in Scilab macros, any hint to use the Octave or scipy function directly from Scilab? More globally it seems that Octave Forge could be linked with Python (from oct2py import octave # Load the Octage-Forge signal package. octave.eval("pkg load signal")), does someone ever tried to bridge similarly in Scilab ? oct2sci Kind regards, David -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephane.mottelet at utc.fr Tue Mar 16 17:45:53 2021 From: stephane.mottelet at utc.fr (=?UTF-8?Q?St=c3=a9phane_Mottelet?=) Date: Tue, 16 Mar 2021 17:45:53 +0100 Subject: [Scilab-users] find and locate local maxima In-Reply-To: References: Message-ID: Hi For real life signals you should rather use something like this (Savitsky-Golay filters) https://codereview.scilab.org/#/c/21499/ S. Le 16/03/2021 ? 17:09, CHEZE David 227480 a ?crit?: > > Hi Cl?ment, > > Thank you for your quick reply and solution ! Actually it?s working > for simple data but with noisy experimental timeseries, some filtering > is required to get perfect regular signal (between the ?true? extrema) > that could be then managed by the routine. I suppose this is something > the Matlab/Octave is handling internally, with some parameters as > function?s argument to tune it, maybe it?s not the case . > > Regards, > > David > > *De?:* users *De la part de* Cl?ment > David > *Envoy??:* mardi 16 mars 2021 16:27 > *??:* Users mailing list for Scilab > *Objet?:* Re: [Scilab-users] find and locate local maxima > > Hello David, > > After reading the Matlab documentation page, it seems pretty simple to > implement using Scilab : and $ symbols: > > function[*pks*, *locs*]=_findpeaks_(*data*) > > ii = find(d(1:$-2) < d(2:$-1) & d(2:$-1) >= d(3:$)); > > *pks* = *data*(ii+2); > > *locs* = ii + 2; > > endfunction > > data= [25 8 15 5 6 10 10 3 1 20 7]; > > _plot_(data) > > [pks,locs]= _findpeaks_(data); > > _plot_(locs,pks, 'xr'); > > Note: using oct2py and pims might also be an option for simple cases > but these wrappers are complex to use and data need to be copied at > language boundaries. > > Regards, > > Cl?ment > > *From:*users > *On Behalf Of *CHEZE David 227480 > *Sent:* Tuesday, March 16, 2021 2:53 PM > *To:* Users mailing list for Scilab > > *Subject:* [Scilab-users] find and locate local maxima > > Hi all, > > I?m looking for function that could find and locate every local maxima > of any discrete time signal (timeseries), similar to Matlab or Octave > function findpeaks(), scipy find_peaks(). Is anyone aware if something > similar is already available in Scilab ? (I already browsed a little > bit and it don?t seem so?) > > If not in Scilab macros, any hint to use the Octave or scipy function > directly from Scilab? > > More globally it seems that Octave Forge could be linked with Python > (from oct2py import octave > > # Load the Octage-Forge signal package. > > octave.eval("pkg load signal")), does someone ever tried to bridge > similarly in Scilab ? oct2sci > > Kind regards, > > David > > > _______________________________________________ > 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 cfuttrup at gmail.com Tue Mar 16 19:39:57 2021 From: cfuttrup at gmail.com (Claus Futtrup) Date: Tue, 16 Mar 2021 19:39:57 +0100 Subject: [Scilab-users] find and locate local maxima In-Reply-To: References: Message-ID: <9dce5c0e-4d74-6966-0e94-e8658cb50f9e@gmail.com> Hi St?phane It looks very nice and I hope it will be added to Scilab as proposed by your code review. Why does it say in red print "Cannot Merge" ? /Claus On 16-03-2021 17:45, St?phane Mottelet wrote: > > Hi > > For real life signals you should rather use something like this > (Savitsky-Golay filters) > > https://codereview.scilab.org/#/c/21499/ > > S. > > Le 16/03/2021 ? 17:09, CHEZE David 227480 a ?crit?: >> >> Hi Cl?ment, >> >> Thank you for your quick reply and solution ! Actually it?s working >> for simple data but with noisy experimental timeseries, some >> filtering is required to get perfect regular signal (between the >> ?true? extrema) that could be then managed by the routine. I suppose >> this is something the Matlab/Octave is handling internally, with some >> parameters as function?s argument to tune it, maybe it?s not the case . >> >> Regards, >> >> David >> >> *De?:* users *De la part de* Cl?ment >> David >> *Envoy??:* mardi 16 mars 2021 16:27 >> *??:* Users mailing list for Scilab >> *Objet?:* Re: [Scilab-users] find and locate local maxima >> >> Hello David, >> >> After reading the Matlab documentation page, it seems pretty simple >> to implement using Scilab : and $ symbols: >> >> function[*pks*, *locs*]=_findpeaks_(*data*) >> >> ii = find(d(1:$-2) < d(2:$-1) & d(2:$-1) >= d(3:$)); >> >> *pks* = *data*(ii+2); >> >> *locs* = ii + 2; >> >> endfunction >> >> data= [25 8 15 5 6 10 10 3 1 20 7]; >> >> _plot_(data) >> >> [pks,locs]= _findpeaks_(data); >> >> _plot_(locs,pks, 'xr'); >> >> Note: using oct2py and pims might also be an option for simple cases >> but these wrappers are complex to use and data need to be copied at >> language boundaries. >> >> Regards, >> >> Cl?ment >> >> *From:*users > > *On Behalf Of *CHEZE David >> 227480 >> *Sent:* Tuesday, March 16, 2021 2:53 PM >> *To:* Users mailing list for Scilab > > >> *Subject:* [Scilab-users] find and locate local maxima >> >> Hi all, >> >> I?m looking for function that could find and locate every local >> maxima of any discrete time signal (timeseries), similar to Matlab or >> Octave function findpeaks(), scipy find_peaks(). Is anyone aware if >> something similar is already available in Scilab ? (I already browsed >> a little bit and it don?t seem so?) >> >> If not in Scilab macros, any hint to use the Octave or scipy function >> directly from Scilab? >> >> More globally it seems that Octave Forge could be linked with Python >> (from oct2py import octave >> >> # Load the Octage-Forge signal package. >> >> octave.eval("pkg load signal")), does someone ever tried to bridge >> similarly in Scilab ? oct2sci >> >> Kind regards, >> >> David >> >> >> _______________________________________________ >> 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 Tue Mar 16 20:17:11 2021 From: fmiyara at fceia.unr.edu.ar (Federico Miyara) Date: Tue, 16 Mar 2021 16:17:11 -0300 Subject: [Scilab-users] find and locate local maxima In-Reply-To: References: Message-ID: David: Just in case it is useful for your purpose, I'm attaching a flexible localmax function. To filter out noisy signals you could use a low-pass filter or lsq_splin() which can also remove multivalued data from replicated experiments. Regards, Federico Miyara On 16/03/2021 10:52, CHEZE David 227480 wrote: > > Hi all, > > I?m looking for function that could find and locate every local maxima > of any discrete time signal (timeseries), similar to Matlab or Octave > function findpeaks(), scipy find_peaks(). Is anyone aware if something > similar is already available in Scilab ? (I already browsed a little > bit and it don?t seem so?) > > If not in Scilab macros, any hint to use the Octave or scipy function > directly from Scilab? > > More globally it seems that Octave Forge could be linked with Python > (from oct2py import octave > > # Load the Octage-Forge signal package. > > octave.eval("pkg load signal")), does someone ever tried to bridge > similarly in Scilab ? oct2sci > > Kind regards, > > David > > > _______________________________________________ > users mailing list > users at lists.scilab.org > http://lists.scilab.org/mailman/listinfo/users -- El software de antivirus Avast ha analizado este correo electr?nico en busca de virus. https://www.avast.com/antivirus -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- function [i, y] = localmax(x, s) // This function finds local maxima within vector x // // Usage: // [i, y] = localmax(x, s) // // where x: input vector // s: strict (2), semistrict (1) or loose (0) local maxima // i: vector of indexes where x reaches local maxima // y: vector of values of x at such indexes // // Local maxima are defined as values greater than or equal to the // immediately preceding and immediately following ones. Argument // s is optional. If it is equal to 2, strict maxima are found // (i.e., the values are strictly greater than the neighbouring // ones); if it is equal to 1, semistrict maxima are found (i.e., // the values are strictly greater than at least one neighbouring // value); if it is equal to 0, loose maxima are found (i.e., the // values are greater than or equal to the neighbouring ones). x // may be either a row vector or a column vector. If x is complex, // abs(x) is used instead of x and given as the second output // argument. // // NOTE: In order to assess the first and last elements the vector // x is extended with -inf values // // ------------------------------ // Author: Federico Miyara // Dete: 2007-06-28 // 2008-08-09 // 2010-06-28 // 2010-08-24 // 2020-01-24 // 2020-04-22 // Default value for s (loose maxima) if argn(2)<2 s = 0; end // Ensure x is a column vector if size(x,1)==1 x = x(:); wasrow = 1; else wasrow = 0; end // For complex signals, the maximum will be obtained for // the absolute value if isreal(x)==0 x = abs(x); end // Compute a vector xdec that is positive on indexes where x // is decreasing. To that end, the next value is subtracted // from each value of x xdec = x - [x(2:$); -%inf]; // Compute a vector xinc that is positive on indexes where x // is increasing. To that end, the preceding value is subtracted // from each value of x xinc = x - [-%inf; x(1:$-1)]; // Obtain a vector whose components are 1 if both xdec and xinc // are positive or non-negative according to s. switch s case 2 maxi = (xdec>0).*(xinc>0); case 1 maxi = (xdec>=0).*(xinc>0) + (xdec>0).*(xinc>=0); case 0 maxi = (xdec>=0).*(xinc>=0); end // Find the indexes corresponding to nonzeros i = find(maxi); // If x was a row vector, so must be i if wasrow== 1 i = i(:).'; else i = i(:); end // Provide the second output argument if requested if argn(1)>1 y = x(i); // If x was a row vector, so must be y if wasrow==1 y = y(:).'; else y = y(:); end end endfunction From dms at samersoff.net Tue Mar 16 19:59:18 2021 From: dms at samersoff.net (Dmitry Samersoff) Date: Tue, 16 Mar 2021 21:59:18 +0300 Subject: [Scilab-users] How to specify angle in degree and minutes Message-ID: <9c089b73-413d-117c-ca6e-ce83cbff763d@samersoff.net> Hello Everybody, I need to calculate cosine of bunch of angles that comes as Degree Minutes Seconds (e.g. 44d32m11s). What is the best way to do it in scilab? Does cosd() accept some notation that is similar to one above? Thank you! -Dmitry From Jean-Yves.Baudais at insa-rennes.fr Wed Mar 17 08:07:33 2021 From: Jean-Yves.Baudais at insa-rennes.fr (Jean-Yves Baudais) Date: Wed, 17 Mar 2021 08:07:33 +0100 Subject: [Scilab-users] Scilab stops calculus In-Reply-To: <7b882cfa-bc9f-db70-337c-dc680fe75c0d@laas.fr> References: <432866403.116410.1615411802737.JavaMail.zimbra@insa-rennes.fr> <0a92ac47-0476-8b93-d2cf-406686a5652c@laas.fr> <1410174826.153157.1615457287477.JavaMail.zimbra@insa-rennes.fr> <33a4ddf1-b0f3-f1c7-6ae0-acc26bccc946@utc.fr> <1761329799.275606.1615543781064.JavaMail.zimbra@insa-rennes.fr> <18bf5341-790c-20cb-fac6-a07dcc5cae2d@laas.fr> <640255082.310606.1615556166075.JavaMail.zimbra@insa-rennes.fr> <1498228887.315031.1615558011289.JavaMail.zimbra@insa-rennes.fr> <7b882cfa-bc9f-db70-337c-dc680fe75c0d@laas.fr> Message-ID: Hi, Bad news for me, but good ones for Scilab. I checked the following code i=0; a=getdate(); while 1 then i=i+1; b=getdate()-a; mprintf("%d: %d/%d %d:%d:%d,%d\n",i,b([6,2,7:10])); sleep(1,"s"); end on two computers, desktop Ubuntu 16.04 Gnome X11 and laptop Ubuntu 18.04 Gnome X11, with and without GUI during more than 38 hours, and in the four cases Scilab didn't froze. So, no problem for Scilab. (But the mystery remains, only for me.) --Jean-Yves From david.cheze at cea.fr Wed Mar 17 09:25:56 2021 From: david.cheze at cea.fr (CHEZE David 227480) Date: Wed, 17 Mar 2021 08:25:56 +0000 Subject: [Scilab-users] find and locate local maxima In-Reply-To: References: Message-ID: Thank you all for your quick and rich solutions ! Indeed the Savitsky-Golay filters look especially good to properly smooth the data before hunting the remaining true extrema. Waiting for the coming next Scilab 6.1.0 that will include this feature, meanwhile I will give a try with more common filters. Kind regards, David -------------- next part -------------- An HTML attachment was scrubbed... URL: From Christophe.Dang at sidel.com Wed Mar 17 09:13:39 2021 From: Christophe.Dang at sidel.com (Dang Ngoc Chan, Christophe) Date: Wed, 17 Mar 2021 08:13:39 +0000 Subject: [Scilab-users] find and locate local maxima In-Reply-To: References: Message-ID: Hello, > De : users De la part de CHEZE David > 227480 Envoy? : mardi 16 mars 2021 14:53 > > I'm looking for function that could find and locate every local maxima > of any discrete time signal I suggest you to detect the local minima of the second derivative obtained by the Savitzky-Golay algorithm (to reduce the problem of the noise). You can find an implementation here: https://commons.wikimedia.org/wiki/File:Savitzky-golay_pic_gaussien_bruite.svg HTH 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 Clement.David at esi-group.com Wed Mar 17 10:19:05 2021 From: Clement.David at esi-group.com (=?utf-8?B?Q2zDqW1lbnQgRGF2aWQ=?=) Date: Wed, 17 Mar 2021 09:19:05 +0000 Subject: [Scilab-users] find and locate local maxima In-Reply-To: <9dce5c0e-4d74-6966-0e94-e8658cb50f9e@gmail.com> References: <9dce5c0e-4d74-6966-0e94-e8658cb50f9e@gmail.com> Message-ID: Hello all, I take your question as a way to explain / remind how we validate user contributions into the Scilab source code. Any change to the source code should be pushed to the codereview.scilab.org website (this is a gerrit instant, a git server that help reviewing changes). This help testing on multiple machines/OS/compilers and review the content ; any user can comment and give +1/-1 on a change. After there is no disagreement, we merge it into the Scilab source code. The ?Cannot merge? error is an alert to the reviewer, this commit need to be rebase (refreshed) against the latest source code ; this is not a blocker for the review but rather for a one-click merge ?. Regards, Cl?ment From: users On Behalf Of Claus Futtrup Sent: Tuesday, March 16, 2021 7:40 PM To: users at lists.scilab.org Subject: Re: [Scilab-users] find and locate local maxima Hi St?phane It looks very nice and I hope it will be added to Scilab as proposed by your code review. Why does it say in red print "Cannot Merge" ? /Claus On 16-03-2021 17:45, St?phane Mottelet wrote: Hi For real life signals you should rather use something like this (Savitsky-Golay filters) https://codereview.scilab.org/#/c/21499/ S. Le 16/03/2021 ? 17:09, CHEZE David 227480 a ?crit : Hi Cl?ment, Thank you for your quick reply and solution ! Actually it?s working for simple data but with noisy experimental timeseries, some filtering is required to get perfect regular signal (between the ?true? extrema) that could be then managed by the routine. I suppose this is something the Matlab/Octave is handling internally, with some parameters as function?s argument to tune it, maybe it?s not the case . Regards, David De : users De la part de Cl?ment David Envoy? : mardi 16 mars 2021 16:27 ? : Users mailing list for Scilab Objet : Re: [Scilab-users] find and locate local maxima Hello David, After reading the Matlab documentation page, it seems pretty simple to implement using Scilab : and $ symbols: function [pks, locs]=findpeaks(data) ii = find(d(1:$-2) < d(2:$-1) & d(2:$-1) >= d(3:$)); pks = data(ii+2); locs = ii + 2; endfunction data = [25 8 15 5 6 10 10 3 1 20 7]; plot(data) [pks,locs] = findpeaks(data); plot(locs, pks, 'xr'); Note: using oct2py and pims might also be an option for simple cases but these wrappers are complex to use and data need to be copied at language boundaries. Regards, Cl?ment From: users > On Behalf Of CHEZE David 227480 Sent: Tuesday, March 16, 2021 2:53 PM To: Users mailing list for Scilab > Subject: [Scilab-users] find and locate local maxima Hi all, I?m looking for function that could find and locate every local maxima of any discrete time signal (timeseries), similar to Matlab or Octave function findpeaks(), scipy find_peaks(). Is anyone aware if something similar is already available in Scilab ? (I already browsed a little bit and it don?t seem so?) If not in Scilab macros, any hint to use the Octave or scipy function directly from Scilab? More globally it seems that Octave Forge could be linked with Python (from oct2py import octave # Load the Octage-Forge signal package. octave.eval("pkg load signal")), does someone ever tried to bridge similarly in Scilab ? oct2sci Kind regards, David _______________________________________________ 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 stephane.mottelet at utc.fr Wed Mar 17 10:39:45 2021 From: stephane.mottelet at utc.fr (=?UTF-8?Q?St=c3=a9phane_Mottelet?=) Date: Wed, 17 Mar 2021 10:39:45 +0100 Subject: [Scilab-users] find and locate local maxima In-Reply-To: References: <9dce5c0e-4d74-6966-0e94-e8658cb50f9e@gmail.com> Message-ID: Thanks Cl?ment. Interested users can readily download the files if they want to test the implementation even if it has not been reviewed. Particularly, it has not been discussed if we want to stick to the Matlab's implementation and API for this particular feature. Comments are welcome. S. Le 17/03/2021 ? 10:19, Cl?ment David a ?crit?: > > Hello all, > > I take your question as a way to explain / remind how we validate user > contributions into the Scilab source code. Any change to the source > code should be pushed to the codereview.scilab.org website (this is a > gerrit instant, a git server that help reviewing changes). This help > testing on multiple machines/OS/compilers and review the content ; any > user can comment and give +1/-1 on a change. After there is no > disagreement, we merge it into the Scilab source code. > > The ?Cannot merge? error is an alert to the reviewer, this commit need > to be rebase (refreshed) against the latest source code ; this is not > a blocker for the review but rather for a one-click merge ?. > > Regards, > > Cl?ment > > *From:* users *On Behalf Of *Claus > Futtrup > *Sent:* Tuesday, March 16, 2021 7:40 PM > *To:* users at lists.scilab.org > *Subject:* Re: [Scilab-users] find and locate local maxima > > Hi St?phane > > It looks very nice and I hope it will be added to Scilab as proposed > by your code review. Why does it say in red print "Cannot Merge" ? > > /Claus > > On 16-03-2021 17:45, St?phane Mottelet wrote: > > Hi > > For real life signals you should rather use something like this > (Savitsky-Golay filters) > > https://codereview.scilab.org/#/c/21499/ > > > S. > > Le 16/03/2021 ? 17:09, CHEZE David 227480 a ?crit?: > > Hi Cl?ment, > > Thank you for your quick reply and solution ! Actually it?s > working for simple data but with noisy experimental > timeseries, some filtering is required to get perfect regular > signal (between the ?true? extrema) that could be then managed > by the routine. I suppose this is something the Matlab/Octave > is handling internally, with some parameters as function?s > argument to tune it, maybe it?s not the case . > > Regards, > > David > > *De?:* users > *De la part de* > Cl?ment David > *Envoy??:* mardi 16 mars 2021 16:27 > *??:* Users mailing list for Scilab > > *Objet?:* Re: [Scilab-users] find and locate local maxima > > Hello David, > > After reading the Matlab documentation page, it seems pretty > simple to implement using Scilab : and $ symbols: > > function[*pks*, *locs*]=_findpeaks_(*data*) > > ii = find(d(1:$-2) < d(2:$-1) & d(2:$-1) >= d(3:$)); > > *pks* = *data*(ii+2); > > *locs* = ii + 2; > > endfunction > > data= [25 8 15 5 6 10 10 3 1 20 7]; > > _plot_(data) > > [pks,locs]= _findpeaks_(data); > > _plot_(locs,pks, 'xr'); > > Note: using oct2py and pims might also be an option for simple > cases but these wrappers are complex to use and data need to > be copied at language boundaries. > > Regards, > > Cl?ment > > *From:* users > *On Behalf Of *CHEZE > David 227480 > *Sent:* Tuesday, March 16, 2021 2:53 PM > *To:* Users mailing list for Scilab > > *Subject:* [Scilab-users] find and locate local maxima > > Hi all, > > I?m looking for function that could find and locate every > local maxima of any discrete time signal (timeseries), similar > to Matlab or Octave function findpeaks(), scipy find_peaks(). > Is anyone aware if something similar is already available in > Scilab ? (I already browsed a little bit and it don?t seem so?) > > If not in Scilab macros, any hint to use the Octave or scipy > function directly from Scilab? > > More globally it seems that Octave Forge could be linked with > Python (from oct2py import octave > > # Load the Octage-Forge signal package. > > octave.eval("pkg load signal")), does someone ever tried to > bridge similarly in Scilab ? oct2sci > > Kind regards, > > David > > > > _______________________________________________ > > 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 > > > > _______________________________________________ > 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 david.cheze at cea.fr Thu Mar 18 12:43:47 2021 From: david.cheze at cea.fr (CHEZE David 227480) Date: Thu, 18 Mar 2021 11:43:47 +0000 Subject: [Scilab-users] find and locate local maxima In-Reply-To: References: <9dce5c0e-4d74-6966-0e94-e8658cb50f9e@gmail.com> Message-ID: Hi all, I?d be glad obviously to download the whole package to test it and report my experience : I?m not use with the ?review interface? is there any way to download the whole package or I just retrieve files one by one ? Thanks, David De : users De la part de St?phane Mottelet Envoy? : mercredi 17 mars 2021 10:40 ? : users at lists.scilab.org Objet : Re: [Scilab-users] find and locate local maxima Thanks Cl?ment. Interested users can readily download the files if they want to test the implementation even if it has not been reviewed. Particularly, it has not been discussed if we want to stick to the Matlab's implementation and API for this particular feature. Comments are welcome. S. Le 17/03/2021 ? 10:19, Cl?ment David a ?crit : Hello all, I take your question as a way to explain / remind how we validate user contributions into the Scilab source code. Any change to the source code should be pushed to the codereview.scilab.org website (this is a gerrit instant, a git server that help reviewing changes). This help testing on multiple machines/OS/compilers and review the content ; any user can comment and give +1/-1 on a change. After there is no disagreement, we merge it into the Scilab source code. The ?Cannot merge? error is an alert to the reviewer, this commit need to be rebase (refreshed) against the latest source code ; this is not a blocker for the review but rather for a one-click merge ?. Regards, Cl?ment From: users On Behalf Of Claus Futtrup Sent: Tuesday, March 16, 2021 7:40 PM To: users at lists.scilab.org Subject: Re: [Scilab-users] find and locate local maxima Hi St?phane It looks very nice and I hope it will be added to Scilab as proposed by your code review. Why does it say in red print "Cannot Merge" ? /Claus On 16-03-2021 17:45, St?phane Mottelet wrote: Hi For real life signals you should rather use something like this (Savitsky-Golay filters) https://codereview.scilab.org/#/c/21499/ S. Le 16/03/2021 ? 17:09, CHEZE David 227480 a ?crit : Hi Cl?ment, Thank you for your quick reply and solution ! Actually it?s working for simple data but with noisy experimental timeseries, some filtering is required to get perfect regular signal (between the ?true? extrema) that could be then managed by the routine. I suppose this is something the Matlab/Octave is handling internally, with some parameters as function?s argument to tune it, maybe it?s not the case . Regards, David De : users De la part de Cl?ment David Envoy? : mardi 16 mars 2021 16:27 ? : Users mailing list for Scilab Objet : Re: [Scilab-users] find and locate local maxima Hello David, After reading the Matlab documentation page, it seems pretty simple to implement using Scilab : and $ symbols: function [pks, locs]=findpeaks(data) ii = find(d(1:$-2) < d(2:$-1) & d(2:$-1) >= d(3:$)); pks = data(ii+2); locs = ii + 2; endfunction data = [25 8 15 5 6 10 10 3 1 20 7]; plot(data) [pks,locs] = findpeaks(data); plot(locs, pks, 'xr'); Note: using oct2py and pims might also be an option for simple cases but these wrappers are complex to use and data need to be copied at language boundaries. Regards, Cl?ment From: users > On Behalf Of CHEZE David 227480 Sent: Tuesday, March 16, 2021 2:53 PM To: Users mailing list for Scilab > Subject: [Scilab-users] find and locate local maxima Hi all, I?m looking for function that could find and locate every local maxima of any discrete time signal (timeseries), similar to Matlab or Octave function findpeaks(), scipy find_peaks(). Is anyone aware if something similar is already available in Scilab ? (I already browsed a little bit and it don?t seem so?) If not in Scilab macros, any hint to use the Octave or scipy function directly from Scilab? More globally it seems that Octave Forge could be linked with Python (from oct2py import octave # Load the Octage-Forge signal package. octave.eval("pkg load signal")), does someone ever tried to bridge similarly in Scilab ? oct2sci Kind regards, David _______________________________________________ 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 _______________________________________________ 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 Thu Mar 18 15:08:23 2021 From: Clement.David at esi-group.com (=?utf-8?B?Q2zDqW1lbnQgRGF2aWQ=?=) Date: Thu, 18 Mar 2021 14:08:23 +0000 Subject: [Scilab-users] find and locate local maxima In-Reply-To: References: <9dce5c0e-4d74-6966-0e94-e8658cb50f9e@gmail.com> Message-ID: Hello David, I merged the change, it is now available on Scilab nightly build and on all CI builds after scilab-6.1-windows-64 #4595 [Jenkins] . Feel free to open bugs or reply on this thread if you have comments on this new feature. Thanks, Cl?ment From: users On Behalf Of CHEZE David 227480 Sent: Thursday, March 18, 2021 12:44 PM To: Users mailing list for Scilab Subject: Re: [Scilab-users] find and locate local maxima Hi all, I?d be glad obviously to download the whole package to test it and report my experience : I?m not use with the ?review interface? is there any way to download the whole package or I just retrieve files one by one ? Thanks, David De : users > De la part de St?phane Mottelet Envoy? : mercredi 17 mars 2021 10:40 ? : users at lists.scilab.org Objet : Re: [Scilab-users] find and locate local maxima Thanks Cl?ment. Interested users can readily download the files if they want to test the implementation even if it has not been reviewed. Particularly, it has not been discussed if we want to stick to the Matlab's implementation and API for this particular feature. Comments are welcome. S. Le 17/03/2021 ? 10:19, Cl?ment David a ?crit : Hello all, I take your question as a way to explain / remind how we validate user contributions into the Scilab source code. Any change to the source code should be pushed to the codereview.scilab.org website (this is a gerrit instant, a git server that help reviewing changes). This help testing on multiple machines/OS/compilers and review the content ; any user can comment and give +1/-1 on a change. After there is no disagreement, we merge it into the Scilab source code. The ?Cannot merge? error is an alert to the reviewer, this commit need to be rebase (refreshed) against the latest source code ; this is not a blocker for the review but rather for a one-click merge ?. Regards, Cl?ment From: users On Behalf Of Claus Futtrup Sent: Tuesday, March 16, 2021 7:40 PM To: users at lists.scilab.org Subject: Re: [Scilab-users] find and locate local maxima Hi St?phane It looks very nice and I hope it will be added to Scilab as proposed by your code review. Why does it say in red print "Cannot Merge" ? /Claus On 16-03-2021 17:45, St?phane Mottelet wrote: Hi For real life signals you should rather use something like this (Savitsky-Golay filters) https://codereview.scilab.org/#/c/21499/ S. Le 16/03/2021 ? 17:09, CHEZE David 227480 a ?crit : Hi Cl?ment, Thank you for your quick reply and solution ! Actually it?s working for simple data but with noisy experimental timeseries, some filtering is required to get perfect regular signal (between the ?true? extrema) that could be then managed by the routine. I suppose this is something the Matlab/Octave is handling internally, with some parameters as function?s argument to tune it, maybe it?s not the case . Regards, David De : users De la part de Cl?ment David Envoy? : mardi 16 mars 2021 16:27 ? : Users mailing list for Scilab Objet : Re: [Scilab-users] find and locate local maxima Hello David, After reading the Matlab documentation page, it seems pretty simple to implement using Scilab : and $ symbols: function [pks, locs]=findpeaks(data) ii = find(d(1:$-2) < d(2:$-1) & d(2:$-1) >= d(3:$)); pks = data(ii+2); locs = ii + 2; endfunction data = [25 8 15 5 6 10 10 3 1 20 7]; plot(data) [pks,locs] = findpeaks(data); plot(locs, pks, 'xr'); Note: using oct2py and pims might also be an option for simple cases but these wrappers are complex to use and data need to be copied at language boundaries. Regards, Cl?ment From: users > On Behalf Of CHEZE David 227480 Sent: Tuesday, March 16, 2021 2:53 PM To: Users mailing list for Scilab > Subject: [Scilab-users] find and locate local maxima Hi all, I?m looking for function that could find and locate every local maxima of any discrete time signal (timeseries), similar to Matlab or Octave function findpeaks(), scipy find_peaks(). Is anyone aware if something similar is already available in Scilab ? (I already browsed a little bit and it don?t seem so?) If not in Scilab macros, any hint to use the Octave or scipy function directly from Scilab? More globally it seems that Octave Forge could be linked with Python (from oct2py import octave # Load the Octage-Forge signal package. octave.eval("pkg load signal")), does someone ever tried to bridge similarly in Scilab ? oct2sci Kind regards, David _______________________________________________ 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 _______________________________________________ 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 Christophe.Dang at sidel.com Mon Mar 22 09:16:15 2021 From: Christophe.Dang at sidel.com (Dang Ngoc Chan, Christophe) Date: Mon, 22 Mar 2021 08:16:15 +0000 Subject: [Scilab-users] How to specify angle in degree and minutes In-Reply-To: <9c089b73-413d-117c-ca6e-ce83cbff763d@samersoff.net> References: <9c089b73-413d-117c-ca6e-ce83cbff763d@samersoff.net> Message-ID: Hello, > De : Dmitry Samersoff > Envoy? : mardi 16 mars 2021 19:59 > > I need to calculate cosine of bunch of angles > that comes as Degree Minutes Seconds (e.g. 44d32m11s). > > What is the best way to do it in scilab? If you have a vector of numbers angle = [dd, mm, ss], it is rather easy to convert it into a decimal number, e.g. angle(1) + (angle(2) + angle(3)/60)/60 If you have a character string, this means parsing. Have a look at tokens() https://help.scilab.org/docs/6.1.0/en_US/tokens.html e.g. --> tokens("44d32m11s", ["d", "m", "s"]) ans = "44" "32" "11" > Does cosd() accept some notation that is similar to one above? No, https://help.scilab.org/docs/6.1.0/en_US/cosd.html HTH, 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 dms at samersoff.net Mon Mar 22 14:42:25 2021 From: dms at samersoff.net (Dmitry Samersoff) Date: Mon, 22 Mar 2021 16:42:25 +0300 Subject: [Scilab-users] How to specify angle in degree and minutes In-Reply-To: References: <9c089b73-413d-117c-ca6e-ce83cbff763d@samersoff.net> Message-ID: Hello Christophe, Thank you for your support. tokens + arithmetic conversion did what I was needed. It would be nice to have the support for such notation in a future and avoid extra steps - this kind of data is rather common for many areas of knowledge. -Dmitry On 22/03/2021 11:16, Dang Ngoc Chan, Christophe wrote: > Hello, > >> De : Dmitry Samersoff >> Envoy? : mardi 16 mars 2021 19:59 >> >> I need to calculate cosine of bunch of angles >> that comes as Degree Minutes Seconds (e.g. 44d32m11s). >> >> What is the best way to do it in scilab? > > If you have a vector of numbers angle = [dd, mm, ss], it is rather easy to convert it into a decimal number, e.g. > > angle(1) + (angle(2) + angle(3)/60)/60 > > If you have a character string, this means parsing. > Have a look at tokens() > > https://help.scilab.org/docs/6.1.0/en_US/tokens.html > > e.g. > > --> tokens("44d32m11s", ["d", "m", "s"]) > ans = > > "44" > "32" > "11" > >> Does cosd() accept some notation that is similar to one above? > > No, https://help.scilab.org/docs/6.1.0/en_US/cosd.html > > HTH, > > 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. > _______________________________________________ > users mailing list > users at lists.scilab.org > http://lists.scilab.org/mailman/listinfo/users > From stephane.mottelet at utc.fr Mon Mar 22 14:53:26 2021 From: stephane.mottelet at utc.fr (=?UTF-8?Q?St=c3=a9phane_Mottelet?=) Date: Mon, 22 Mar 2021 14:53:26 +0100 Subject: [Scilab-users] How to specify angle in degree and minutes In-Reply-To: <9c089b73-413d-117c-ca6e-ce83cbff763d@samersoff.net> References: <9c089b73-413d-117c-ca6e-ce83cbff763d@samersoff.net> Message-ID: Hello, The best way would be to use msscanf: --> [x]=msscanf("44d32m11s","%dd%dm%ds") ?x? = ?? 44.?? 32.?? 11. S. Le 16/03/2021 ? 19:59, Dmitry Samersoff a ?crit?: > Hello Everybody, > > I need to calculate cosine of bunch of angles that comes as > Degree Minutes Seconds (e.g. 44d32m11s). > > What is the best way to do it in scilab? > > Does cosd() accept some notation that is similar to one above? > > Thank you! > -Dmitry > _______________________________________________ > 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 j-lan at online.no Mon Mar 22 19:29:38 2021 From: j-lan at online.no (=?UTF-8?Q?Jan-=c3=85ge_Langeland?=) Date: Mon, 22 Mar 2021 19:29:38 +0100 Subject: [Scilab-users] My Scilab 6.1.0 desktop crashes on this line Message-ID: <16ae5005-dc9f-3acf-9b8d-94e1da9f1dba@online.no> I kept getting some crashes, and found it to be caused by a line that can be stripped down to this: disp(ascii(13)+"a;") Is there a logical explanation? Jan From stephane.mottelet at utc.fr Mon Mar 22 19:43:06 2021 From: stephane.mottelet at utc.fr (=?UTF-8?Q?St=c3=a9phane_Mottelet?=) Date: Mon, 22 Mar 2021 19:43:06 +0100 Subject: [Scilab-users] My Scilab 6.1.0 desktop crashes on this line In-Reply-To: <16ae5005-dc9f-3acf-9b8d-94e1da9f1dba@online.no> References: <16ae5005-dc9f-3acf-9b8d-94e1da9f1dba@online.no> Message-ID: Hello, With the latest build on OSX: --> disp(ascii(13)+"a;") a;" No crash. Maybe this was fixed in the meantime ^^ S. Le 22/03/2021 ? 19:29, Jan-?ge Langeland a ?crit?: > I kept getting some crashes, and found it to be caused by a line that > can be stripped down to this: > > disp(ascii(13)+"a;") > > Is there a logical explanation? > > Jan > > > _______________________________________________ > 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 Jean-Yves.Baudais at insa-rennes.fr Mon Mar 22 19:47:06 2021 From: Jean-Yves.Baudais at insa-rennes.fr (Jean-Yves Baudais) Date: Mon, 22 Mar 2021 19:47:06 +0100 (CET) Subject: [Scilab-users] My Scilab 6.1.0 desktop crashes on this line In-Reply-To: <16ae5005-dc9f-3acf-9b8d-94e1da9f1dba@online.no> References: <16ae5005-dc9f-3acf-9b8d-94e1da9f1dba@online.no> Message-ID: <570085529.473798.1616438826874.JavaMail.zimbra@insa-rennes.fr> Hi, It's a known bug that has been solved, but not in Scilab 6.1.0. -- Jean-Yves ----- Original Message ----- > From: "Jan-?ge Langeland" > To: "Users mailing list for Scilab" > Sent: Monday, 22 March, 2021 19:29:38 > Subject: [Scilab-users] My Scilab 6.1.0 desktop crashes on this line > I kept getting some crashes, and found it to be caused by a line that > can be stripped down to this: > > disp(ascii(13)+"a;") > > Is there a logical explanation? > > Jan From arctica1963 at gmail.com Thu Mar 25 17:45:02 2021 From: arctica1963 at gmail.com (arctica1963) Date: Thu, 25 Mar 2021 09:45:02 -0700 (MST) Subject: [Scilab-users] Int3D / Triple integration Message-ID: <1616690702752-0.post@n3.nabble.com> Hello, Following on from a previous query I had on this matter, I am not having much success with int3d for triple integration, largely due to the need to build tetrahedrons. CGLab does have this option (delauney3d) but is not available for 6.1.0, and it is not entirely clear how it would interface with int3d. Monte-Carlo integration is one route - located this online (added xmin xmax etc): function mcInt3d = intg3d(f,xmin,xmax,ymin,ymax,zmin,zmax,N) vol = (xmax-xmin)*(ymax-ymin)*(zmax-zmin) xr = (xmax-xmin)*rand(1,N)+xmin yr = (ymax-ymin)*rand(1,N)+ymin zr = (zmax-zmin)*rand(1,N)+zmin sumf= sum(f(xr,yr,zr)) mcInt3d = vol*sumf/N endfunction It does work but in order to get close to a good approximation, N needs to be quite large. I am sure if we could get int3d to be more user friendly that would be great. More of a shout out to anyone who has used int3d using limits defined for x,y,z and how to vectorise the tetrahedrons. Would love to be able to crack this problem. Thanks Lester -- Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html From marcusvpsouza at yahoo.com.br Thu Mar 25 18:19:36 2021 From: marcusvpsouza at yahoo.com.br (Marcus Vinicius P. de Souza) Date: Thu, 25 Mar 2021 10:19:36 -0700 (MST) Subject: [Scilab-users] xstring + format decimal number. Message-ID: <1616692776328-0.post@n3.nabble.com> Dear all, I am not getting to formate strings using xstring command. For example: Mp=54.5666666 xstring(1,1,'$\LARGE Mp={'+string(Mp)+'}\%$') I want only: Mp=54.56% How do I do? Besides this, it is possible to define some position using "xstring" only by click in figure? "Fontsize" command doesn't work in xstring? Can anybody help me? Best regards. -- Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html From Christophe.Dang at sidel.com Fri Mar 26 09:15:51 2021 From: Christophe.Dang at sidel.com (Dang Ngoc Chan, Christophe) Date: Fri, 26 Mar 2021 08:15:51 +0000 Subject: [Scilab-users] xstring + format decimal number. In-Reply-To: <1616692776328-0.post@n3.nabble.com> References: <1616692776328-0.post@n3.nabble.com> Message-ID: Hello, > De : Marcus Vinicius P. de Souza > Envoy? : jeudi 25 mars 2021 18:20 > > Mp=54.5666666 > [...] > I want only: Mp=54.56% > How do I do? I suggest o use floor() (truncate) or round(), e.g. xstring(1, 1, '$\LARGE Mp={' + string(0.01*floor(100*Mp)) + '}\%$') or use msprintf() (rounding), e.g. xstring(0, 1, '$\LARGE Mp={' + msprintf("%2.2f", Mp) + '}\%$') HTH 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 stephane.mottelet at utc.fr Fri Mar 26 11:45:36 2021 From: stephane.mottelet at utc.fr (=?UTF-8?Q?St=c3=a9phane_Mottelet?=) Date: Fri, 26 Mar 2021 11:45:36 +0100 Subject: [Scilab-users] fmincon 1.0 toolbox release Message-ID: <57bb4f7f-3f64-d5be-2ffc-966a4065b8dd@utc.fr> Hi all, A new release of fmincon is available via the atoms portal: atmomsInstall fmincon The new 1.0 version is now compatible with Scilab 6.1 thanks to the recent upgrade of sci_ipopt, which interfaces IpOpt (https://github.com/coin-or/Ipopt). Former or actual users of fmincon under Matlab should be able to port their code to Scilab with minimal effort. If you give it a try and have some problems please report them by creating an issue at the fmincon page https://gitlab.com/esi-group/scilab/forge/fmincont. Best, -- 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 Fri Mar 26 12:14:16 2021 From: stephane.mottelet at utc.fr (=?UTF-8?Q?St=c3=a9phane_Mottelet?=) Date: Fri, 26 Mar 2021 12:14:16 +0100 Subject: [Scilab-users] xstring + format decimal number. In-Reply-To: <1616692776328-0.post@n3.nabble.com> References: <1616692776328-0.post@n3.nabble.com> Message-ID: <82a9f132-a532-b4f7-102e-df10ae24795a@utc.fr> Hi, Le 25/03/2021 ? 18:19, Marcus Vinicius P. de Souza a ?crit?: > Dear all, > I am not getting to formate strings using xstring command. For example: > > Mp=54.5666666 > > xstring(1,1,'$\LARGE Mp={'+string(Mp)+'}\%$') > > I want only: Mp=54.56% > How do I do? > Besides this, it is possible to define some position using "xstring" only by > click in figure? > "Fontsize" command doesn't work in xstring? > Can anybody help me? For the two last points see my answers on StackOverflow (please avoid cross-posting in the future): https://stackoverflow.com/questions/66808702/xstring-format-decimal-number-scilab S. > Best regards. > > > > > -- > 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 marcusvpsouza at yahoo.com.br Fri Mar 26 16:56:15 2021 From: marcusvpsouza at yahoo.com.br (Marcus Vinicius P. de Souza) Date: Fri, 26 Mar 2021 08:56:15 -0700 (MST) Subject: [Scilab-users] xstring + format decimal number. In-Reply-To: References: <1616692776328-0.post@n3.nabble.com> Message-ID: <1616774175802-0.post@n3.nabble.com> Dear Christophe, Excellent!! Thanks a lot!! Best regards!! MV -- Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html