Re: [Scilab-users] Scilab 6 problem with "Prettify"

2017-09-07 Thread Pierre Vuillemin
09-2017 21:25, Samuel Gougeon wrote: Hello Claus, In Scilab, clear is deleterious. As a first hint, i would try commenting it before rerunning the script. Best regards Samuel Le 06/09/2017 à 21:33, Claus Futtrup a écrit : Hi there I've started to use the prettify functions by Pierre Vuille

Re: [Scilab-users] Scilab 6 problem with "Prettify"

2017-09-07 Thread Pierre Vuillemin
;invalid buffer" message may indicate that there is a problem during the first run. I would start by investigating this part. Best regards, Pierre Le 06.09.2017 21:33, Claus Futtrup a écrit : > Hi there > > I've started to use the prettify functions by Pierre Vuillemin. So far

[Scilab-users] C gateway with scilab api

2017-03-28 Thread Pierre Vuillemin
Hi all, I'm trying to call some C code from Scilab. To understand how the scilab api is working, I've tried to reproduce the example described here: https://help.scilab.org/docs/6.0.0/fr_FR/api_scilab_getting_started.html but it does not work for me. The command [c, d] = foo6([2,%pi], [%

Re: [Scilab-users] Replace multiple occurrences of regular expression in string with strsubst

2017-03-27 Thread Pierre Vuillemin
My bad, I didn't see the bug report. Great news though. Regards, Pierre Le 27/03/2017 à 16:43, sgoug...@free.fr a écrit : - Mail original - De: "Pierre Vuillemin", Lundi 27 Mars 2017 09:57:01 Hi all, It seems that when using regular expressions with strsubst,

Re: [Scilab-users] simple plot function

2017-03-27 Thread Pierre Vuillemin
Hi, A dot is missing in the argument of the hyperbolic sin for the division to be performed element-wise, x=0:0.1:1; y=exp((x.^4+x.^2-x+(5).^(0.5))/5)+sinh((x.^3+21*x+9) ./ (21*x+6))-3.0; plot(x,y) Regards, Pierre Le 27.03.2017 13:39, Luciano Andino a écrit : > Hi, doing a

[Scilab-users] Replace multiple occurrences of regular expression in string with strsubst

2017-03-27 Thread Pierre Vuillemin
Hi all, It seems that when using regular expressions with strsubst, only the first occurrence is replaced. For instance, tst_str = 'This is a cow. A cow is funny.' out1 = strsubst(tst_str, 'cow', 'rabbit') out2 = strsubst(tst_str,'/cow/','rabbit','r') disp(out1) // both occurence are

Re: [Scilab-users] A tool for creating formated tables

2017-03-16 Thread Pierre Vuillemin
, Le 15/03/2017 à 18:56, Pierre Vuillemin a écrit : Hi all, I've made a little tool for creating formated tables in Scilab. In particular, it enables to: * display pretty tables in the console, * create github-markdown tables, * create latex tables. Source code (the file tabula

[Scilab-users] A tool for creating formated tables

2017-03-15 Thread Pierre Vuillemin
Hi all, I've made a little tool for creating formated tables in Scilab. In particular, it enables to: * display pretty tables in the console, * create github-markdown tables, * create latex tables. Source code (the file tabular.sci) and some examples are provided here

Re: [Scilab-users] ?==?utf-8?q? Plots for scientific papers

2017-03-10 Thread Pierre Vuillemin
using an empty > one looks ugly. So that's my suggestion. > Kind regards > Jens > -- > Am 08.03.2017 18:28, schrieb Pierre Vuillemin: > > I may c

Re: [Scilab-users] ?==?utf-8?q? Plots for scientific papers

2017-03-09 Thread Pierre Vuillemin
; // Plot smoothed data > plot(shortxlist,blf1_array(boollist,2),'-r'); // Plot original data > t = gca(); > set(t,"grid",[1 1]); > xgrid(color("grey70")); > xtitle("Bl density plot","Bl-value +/- 0.01% range","Quantity / Density&

Re: [Scilab-users] ?==?utf-8?q? Plots for scientific papers

2017-03-08 Thread Pierre Vuillemin
toine Thank you very much for your help. This is very inspiring and encouraging. Best regards, Claus On 08-03-2017 11:41, Pierre Vuillemin wrote: Following Antoine's idea, find enclosed an example on how you can automate the process of improving your plots. This is obviously incomplete but

Re: [Scilab-users] ?==?utf-8?q? Plots for scientific papers

2017-03-08 Thread Pierre Vuillemin
Following Antoine's idea, find enclosed an example on how you can automate the process of improving your plots. This is obviously incomplete but it gives a general idea. Hope it helps, Pierre Le 08.03.2017 10:08, Antoine Monmayrant a écrit : It's definetly possible to do it. In my group, we

[Scilab-users] Extraction of unusual fields of custom mlist in Scilab 6

2017-03-07 Thread Pierre Vuillemin
Hi all, I am encountering some difficulties with overloading in Scilab 6, and I'm wondering if this is a bug or not. Consider the following example, a = mlist(['mytype']); b = mlist(['myothertype']); function out = %mytype_e(varargin) var = varargin($); field = varargin(1); disp(ty

Re: [Scilab-users] Matlab vs Scilab perf

2017-03-04 Thread Pierre Vuillemin
Concerning my assertion that Python outshines Scilab & co in many other areas, * being a general purpose language, I feel that Python has a broader range of application. For instance, for creating a web-app, Scilab would certainly not be my first choice, while Python is commonly used f

[Scilab-users] Arguments of functions in Scilab

2017-03-04 Thread Pierre Vuillemin
Hi all, I'm a bit confused by functions in Scilab and specifically the way they handle their arguments. For instance, in the following code deff('g(x)','disp(x)'); g; // produces an error saying x is not defined x = 1; g; // call the function g and displays x... leads to two questions, * th

Re: [Scilab-users] Matlab vs Scilab perf

2017-03-02 Thread Pierre Vuillemin
My 2 cents, I think that the main advantage of Scilab/Octave/Matlab in comparison to other environments is that they gather various tools in a (somewhat) coherent bundle. I think that most users won't need to look for another library to do what they want as the most common features are already

[Scilab-users] Strange behaviour of the auto-indent ctrl + i

2017-02-24 Thread Pierre Vuillemin
Hello all, I've just realised that block-comments are now available in Scilab 6 and I find it quite convenient. I've noticed strange behaviour when using the auto-indent tool ctrl + i in scinote though. For instance with this code // Author : Pierre Vuillemin (2017) // License

Re: [Scilab-users] About some changes in Scilab 6

2017-02-17 Thread Pierre Vuillemin
This is because the prototype of a extraction overload for A(i1,i2,..,iN) is function R = %typeOfA_e(i1,i2,...,iN,A) The last input argument is the object from which you want to extract some component. If you specify varargin, varargin is a list(), and so you get the given error message. Le 16

[Scilab-users] About some changes in Scilab 6

2017-02-16 Thread Pierre Vuillemin
Hi all, Congratulations to Scilab team for the release, it looks very promising! I have begun to test the compatibility of some of my tools with Scilab 6 and I have some questions: - the way libraries are handled seems to have changed with Scilab 6, and the example provided in 'help li

Re: [Scilab-users] Examples of linear optimisation

2017-02-13 Thread Pierre Vuillemin
b 6.0 (you can > download a nightly build [2]). > "-->exec builder.sce" yielded an error on function save() as it takes strings > as arguments now. > > Best regards, > Paul > > On 02/10/2017 06:09 PM, Pierre Vuillemin wrote: > >> Hi all, >&g

[Scilab-users] Examples of linear optimisation

2017-02-10 Thread Pierre Vuillemin
/Linear%20Programming%20Examples%20in%20Scilab in the demos. I am quite interested in some feedbacks if you have any. Best regards, Pierre Vuillemin ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users

[Scilab-users] COMPleib library for Scilab

2017-01-21 Thread Pierre Vuillemin
Hi all, If you are interested in control or LTI model reduction, I've ported the COMPleib library (see http://www.complib.de/ for further info) to Scilab. You can find it here: https://github.com/pivui/scilabTools/tree/master/COMPleib I've not tested all the models hence some issues might re

Re: [Scilab-users] Anonymous functions

2017-01-20 Thread Pierre Vuillemin
I'm aware that this cannot be done solely in Scilab but requires to fiddle with the C interface, but I'm curious to experiment. Regards, Pierre Le 17.01.2017 14:21, Samuel Gougeon a écrit : Le 17/01/2017 11:46, Pierre Vuillemin a écrit : I have actually implemented a similar solut

Re: [Scilab-users] Anonymous functions

2017-01-17 Thread Pierre Vuillemin
ble to refer to a specific variable in a specific namespace of Scilab (a kind of pointer I guess), but I'm not sure this is possible? Le 17.01.2017 10:38, Serge Steer a écrit : A partial solution should be deff("y=f(x)","a="+sci2exp(a,0)+";y=a*x") but it may cause

[Scilab-users] Anonymous functions

2017-01-17 Thread Pierre Vuillemin
Hi all, I am trying to reproduce the behaviour of anonymous function in Scilab (see the code in lambdaFun here: https://github.com/pivui/scilabTools). At the moment, it works like in Matlab, for instance: a = eye(3,3); lambda 'f(x) = a*x' // the name of the lambda function will be f a = rand(

Re: [Scilab-users] Optim & NelderMead use [closed]

2017-01-16 Thread Pierre Vuillemin
Hi Paul, You should be careful when using the square root function as it is not differentiable at 0 (cf the attached file which illustrates this point in your case). This will leads to issues and prevent optim from "really" (in a sound way) converging towards the solution. To address the issue,

Re: [Scilab-users] Calling a java method in a Scilab function

2016-12-19 Thread Pierre Vuillemin
Glad to know that it has been fixed. Thank you for your answer. Best regards, Pierre Le 10.12.2016 15:09, Samuel Gougeon a écrit : > Hello Pierre, > > Le 07/12/2016 10:04, Pierre Vuillemin a écrit : > >> Hi all, >> >> I have to create unique IDs for s

[Scilab-users] Calling a java method in a Scilab function

2016-12-07 Thread Pierre Vuillemin
Hi all, I have to create unique IDs for some object in Scilab. For that purpose, someone kindly guided me towards the UUID class of java, which lead me to create this function in Scilab, function id = make_id() UUID = jimport("java.util.UUID", %f) tmp = jinvoke(UUID,"randomUUID

Re: [Scilab-users] Creation of a library with macros located in various folders

2016-10-16 Thread Pierre Vuillemin
e master release is still unavailable in the today NB sticking on the 2016-09-22 sources for Windows. Le 12/10/2016 22:00, Pierre Vuillemin a écrit : Hi all, I am trying to make a function similar to genlib but which goes recursively through folders to find .sci files, compile them and p

Re: [Scilab-users] Creation of a library with macros located in various folders

2016-10-15 Thread Pierre Vuillemin
eems to be 'working' but produces warnings due to: - the way binary files are saved (see above), which will change in Scilab 6 if I am correct, - the functions in the library being already loaded in Scilab for some reason. If anyone has an insight concerning the second point, I am interes

Re: [Scilab-users] overloading concat "[ ]" operators

2016-07-01 Thread Pierre Vuillemin
Hi Philippe, You can create another object, a matrix of bing int that stacks your bigint in a list, i.e. x = tlist(["bigint","rep","signe"],[7654321;5678998;1234],1) y = tlist(["bigint","rep","signe"],[3456789;5432112;9876],1) X = tlist(["mbigint","entries"],list(x,y)) Then you can overload

Re: [Scilab-users] Backslash operator with square singular matrix

2015-10-27 Thread Pierre Vuillemin
matrix? Le 27.10.2015 14:53, Stéphane Mottelet a écrit : Hello, Le 27/10/2015 13:27, Pierre Vuillemin a écrit : A = [2 4;1 2]; disp(det(A)) b = [1;1]; x = A \ b; -->A = [2 4;1 2]; -->disp(det(A)) 0. -->b = [1;1]; -->x = A \ b; Attention : La matrice est presque singu

[Scilab-users] Backslash operator with square singular matrix

2015-10-27 Thread Pierre Vuillemin
that one should check if a matrix is singular before trying to invert it, a warning may save some time in a code prototyping phase. Besides, the behaviour of linear solvers is not consistent : umfpack produces an error and linsolve returns an empty solution x. Best regards, P

[Scilab-users] Colours in Scilab terminal

2015-10-22 Thread Pierre Vuillemin
Hello all, I was wondering if it was possible to display coloured text in Scilab terminal with "mprintf" ? It seems to be possible with printf in C : http://stackoverflow.com/questions/3219393/stdlib-and-colored-output-in-c Best regards, Pierre

Re: [Scilab-users] Get back the name of a function given as argument

2015-10-13 Thread Pierre Vuillemin
= x^2'); deff('y = f(x)','y = x'); deff('minimize(f)','disp(evstr(''f(2)''))'); minimize(f) // displays 2 minimize(fun) // displays 4 Le 13.10.2015 08:44, Pierre Vuillemin a écrit : Hi Samuel, Thank you for the answer.

Re: [Scilab-users] Get back the name of a function given as argument

2015-10-13 Thread Pierre Vuillemin
rom being elegant, but it seems to work. Will there be a better way to achieve that with Scilab 6 ? Pierre Le 12.10.2015 21:02, Samuel Gougeon a écrit : Hi Pierre, Le 12/10/2015 16:46, Pierre Vuillemin a écrit : Hi all, I am building some optimisation tools, and in this context, I was won

[Scilab-users] Get back the name of a function given as argument

2015-10-12 Thread Pierre Vuillemin
ludes calls towards numerical derivatives, if needed. Best regards, Pierre Vuillemin ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users

Re: [Scilab-users] Strange behaviour with for loops

2015-09-30 Thread Pierre Vuillemin
My bad, I was only focused on the list part of the help... Thank you, Pierre Le 30.09.2015 09:50, Samuel Gougeon a écrit : Hello Pierre, Le 29/09/2015 16:20, Pierre Vuillemin a écrit : Hello, In the help, it is specified that the syntax 'for e = l ...' when l is a list is authoris

[Scilab-users] Strange behaviour with for loops

2015-09-29 Thread Pierre Vuillemin
r value of the vector idx idx =[1 2 3]; for i = idx disp("newIter") disp(i) end When the vector idx is a column vector now, there is only one loop and i is equal to the vector idx idx = [1 2 3]'; for i = idx disp("newIter") disp(i) end Is this beh

Re: [Scilab-users] Booeleans : irrelevant results ?

2015-08-27 Thread Pierre Vuillemin
Dear Paul, The behaviour of test 2 may come from the order in which the operations are performed : Note that (a & c & b) ~= (b & c & a), indeed : - a & c & b performs a & c which returns [] and then [] & b which returns [], - b & c & a performs b & c which returns %t and then %t & [] whi

Re: [Scilab-users] About the complex inverse tangent function

2014-08-15 Thread Pierre Vuillemin
Le vendredi 15 août 2014 à 11:28 +0200, Samuel Gougeon a écrit : > Hello Pierre, > > Le 15/08/2014 10:52, Pierre Vuillemin a écrit : > > Le jeudi 14 août 2014 à 19:46 +0200, Samuel Gougeon a écrit : > >> With Scilab 5.5.0 on Windows 7 x64: > >> -->z = 2*%i &g

Re: [Scilab-users] About the complex inverse tangent function

2014-08-15 Thread Pierre Vuillemin
Le jeudi 14 août 2014 à 19:46 +0200, Samuel Gougeon a écrit : > Hello, > > Le 14/08/2014 15:12, Pierre Vuillemin a écrit : > > > Hello, > > > > my question concerns the practical implementation of the complex inverse > > tangent function atan(z) in Scilab. &

[Scilab-users] About the complex inverse tangent function

2014-08-14 Thread Pierre Vuillemin
Hello, my question concerns the practical implementation of the complex inverse tangent function atan(z) in Scilab. In the source code of Scilab, the file "watan.f" (in the elementary functions) seems to compute this function as atan(z) = i/2 log((i+z)/(i-z)), where i^2=-1. Yet, when comparing

Re: [Scilab-users] Increment of parameters in optim function

2014-02-25 Thread Pierre Vuillemin
Dear Romain, Just some hints concerning one of the underlying algorithm of optim, the "quasi newton" one with a Wolfe type line search : this algorithm is a descent algorithm, i.e given an initial point, it will find a local minimun of your objective function "near" (in some sense) to the initial

Re: [Scilab-users] Interfacing fortran code with scilab

2014-02-05 Thread Pierre Vuillemin
. But basically, I just would like to see the speed gain I can achieve with a lower level language on some parts of my code. Then depending on the performances of the forthcoming JIT compiler of Scilab, I may consider to translate (or not) my code in fortran. Pierre Vuillemin Le mercredi 05 février

[Scilab-users] Interfacing fortran code with scilab

2014-02-05 Thread Pierre Vuillemin
error message 'matMul is not an entry point' meant) Best regards, Pierre Vuillemin ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users

[Scilab-users] Name of function's input arguments

2013-05-29 Thread pierre vuillemin
Hello, I would like to know if there exists a way to get the name of function's inputs arguments, i.e., if I have the following function function y = f(a,b) .. endfunction and that I call it like y = f(var1,var2), is it possible to know, inside my function f, that the first input argument a is c