[Scilab-users] About some changes in Scilab 6

Pierre Vuillemin contact at pierre-vuillemin.fr
Thu Feb 16 18:37:40 CET 2017


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 lib' does not work anymore,

        //define some functions
        function z=myplus(x, y)
           z = x + y
        endfunction

        function z=yourplus(x, y)
           x = x - y
        endfunction

        //create the *.bin files in libdir
        libdir = TMPDIR;
        save(libdir + '/myplus.bin', 'myplus');
        save(libdir + '/yourplus.bin', 'yourplus');

        //create the name file
        mputl(['myplus';'yourplus'],TMPDIR+'/names');

        //build the library containing myplus and yourplus
        mylibfoo = lib(libdir+'/');

    The above code says that the path is not a path to a valid library.
    Could someone explain what 'lib' is expecting? (I would like to
    avoid using 'genlib' as it does not recursively goes through
    subdirectories).


    - when 'error' is called within a function that overload the
    behaviour for some object, then the error message is not displayed, e.g.

        a = mlist(['myType']);
        function %myType_e(varargin)
            error('My error msg')
        endfunction
        a(1)


    only says that the operation is not defined for this type without
    displaying 'My error msg'.


    - I'm not sure that this is specific to Scilab 6, but I've noticed a
    large difference in performance for solving linear systems A*x = b
    in comparison to Octave and Matlab. For instance,

        n = 100;
        N = 1000;
        T = 0;
        for i = 1:n
            A = rand(N,N);
            b = rand(N,1);
            tic();
            x = A\b;
            T = T + toc();
        end
        disp(T/n)


    is (significantly) slower with Scilab (binaries for linux 64bits)
    than with Octave. Is it due to the way the underlying lapack library
    is compiled?


    - In Scilab 5, given a variable 'x', the expression

        x = clear('x')


    was allowed and would clean the variable 'x'. Used together with
    'resume' in a function, that allowed to clean variables from the
    above environment. While it might not be a very safe coding
    practice, is there a way to reproduce this behaviour in Scilab 6 ?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20170216/cf4775d8/attachment.htm>


More information about the users mailing list