Re: [Scilab-users] Scilab compilation from scratch (was Re: spec can crash scilab)

2021-05-10 Thread Antoine Monmayrant


Le 10/05/2021 à 15:35, Clément David a écrit :

-Original Message-
From: users  On Behalf Of Antoine
Monmayrant
Sent: Monday, May 10, 2021 1:02 PM
To: users@lists.scilab.org
Subject: Re: [Scilab-users] Scilab compilation from scratch (was Re: spec can
crash scilab)


Le 10/05/2021 à 09:12, Clément David a écrit :

To fix, remove libstdc++.so and libgfortran.so on the Prerequirements;

Er, OK, I'm glad to do that, but I don't see what you are talking about.
Where are those 'Prerequirements' defined?

(I'm really not versed into compiling, I just barely know the basics...)

What we called Prerequirements (or thirdparties) are binaries used for the Scilab 
compilation but coming from external sources (for example, libxml2 or curl). At configure 
time, a detection is performed to use them rather than using the system's ones. If you 
used the cheatsheet, they are delivered with the svn command and should be located on the 
 "usr" directory.
Ah, OK, so I should just get rid of them after the svn command to rely 
on the binaries provided by my system.


Thanks.

Antoine



Clément
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Scilab compilation from scratch (was Re: spec can crash scilab)

2021-05-10 Thread Antoine Monmayrant


Le 10/05/2021 à 10:25, Stéphane Mottelet a écrit :
I added also 'F77=gfortran-8' in the configure. 

What do you mean?

As a command line option to configure?

Antoine

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Scilab compilation from scratch (was Re: spec can crash scilab)

2021-05-10 Thread Antoine Monmayrant


Le 10/05/2021 à 09:12, Clément David a écrit :

To fix, remove libstdc++.so and libgfortran.so on the Prerequirements;

Er, OK, I'm glad to do that, but I don't see what you are talking about.
Where are those 'Prerequirements' defined?

(I'm really not versed into compiling, I just barely know the basics...)

Antoine

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Scilab compilation from scratch (was Re: spec can crash scilab)

2021-05-09 Thread Antoine Monmayrant

Hello all,

Here is another update: success!
After a lot of LD_PATH, ln & -lrandomstuff dark magic that I don't 
really understand I managed to compile scilab under linux ubuntu 18.04.

Se below what I've done for those interested.
A bit of warning: I tried to remove all the intermediate failures and 
only keep the changes/installs that help me compile scilab.

Maybe there are some bits missing or useless.
I'll be happy to get a feedback from someone trying to build it on a 
vanilla 18.04 vm to see whether this can be reproduced.
If you see some obvious mistake or simplification, do not hesitate to 
let me know...


Hope it helps,

Cheers,

Antoine




# In order to get build-dep scilab
software-properties-gtk
    tick option "Source code"
sudo apt update
sudo apt-get build-dep scilab

# In order to successfully build java stuff with the right jdk
sudo apt install openjdk-8-jdk
sudo update-alternatives --config java
    * 2 /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java   1081  
manual mode

export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64

#     if you tried and failed at compiling with the default jdk 
(openjdk-11-jdk), there are some compiled *.class left behind, even 
after 'make clean'
#    and you'll get     [javac]   bad class file:  ... class file has 
wrong version 55.0, should be 52.0

#    rm -rf your build folder and start again

# getting scilab source code and deps
git clone -b master --depth=1 https://github.com/scilab/scilab.git 
scilab_master

cd scilab_master/scilab/
svn --force checkout 
https://github.com/scilab/scilab-prerequirements.git/trunk/linux_x64/ .


# In order to build using a more modern c/fortran/c++ compiler (default 
is version 7)

sudo apt install gcc-8 g++-8
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 80
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 80
#     I switch to gcc-8 g++-8  to get past this compile error:
#    src/cpp/fullpath.cpp:16:10: fatal error: filesystem: No such file 
or directory

#    #include 

# Somehow libscigfortran does not seem to have the right name for ld to 
be happy:
sudo ln -s 
/home/myhome/softs/scilab-recompile/scilab_master/scilab/lib/thirdparty/redist/libscigfortran.so.5 
/home/myhome/softs/scilab-recompile/scilab_master/scilab/lib/thirdparty/redist/libscigfortran.so

#    The ln -s above is to get past this error:
#    /usr/bin/ld: warning: libscigfortran.so.5, needed by 
/home/myhome/softs/scilab-recompile/scilab_master/scilab/usr/lib/liblapack.so, 
not found (try using -rpath or -rpath-link)


# Populating LDFLAGS and LD_LIBRARY_PATH using random walk and fuzzy 
(really fuzzy) logic. Here be dragons!
./configure LDFLAGS="-L`pwd`/usr/lib/ -L`pwd`/lib/thirdparty 
-L/usr/lib/gcc/x86_64-linux-gnu/8" 
LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/:`pwd`/lib/thirdparty/:$LD_LIBRARY_PATH
export 
LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/:`pwd`/lib/thirdparty/:`pwd`/lib/thirdparty/redist/:$LD_LIBRARY_PATH 
; make


##

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Scilab compilation from scratch (was Re: spec can crash scilab)

2021-05-09 Thread Antoine Monmayrant

Hello all,

Just a quick update:
(1) I installed & configured as default : openjdk-8 gcc-8 g++8
(2) I had to rm everything and restart from scratch: somehow, my first 
try at compiling with openjdk-11 had left some *.class files behind 
(with the wrong version) that make clean is not removing
(3) Now I am stuck at libscigfortran not being found. I'm pretty sure I 
miss some mystery -lrandomlibame flag or someLD_* stuff... :
    /usr/bin/ld: warning: libscigfortran.so.5, needed by 
/home/amonmayr/softs/scilab-recompile/scilab_master/scilab/usr/lib/liblapack.so, 
not found (try using -rpath or -rpath-link)


If anyone who knows more than me about ld flags wants to chime in, I 
could do with a bit of help...


Cheers,


Antoine
PS: I tried to join config.log but the email got too big for the mailing 
list...


On 07/05/2021 18:18, Clément David wrote:

Hello Antoine,

This issue might comes from a wrong jdk version, you should have 
openjdk8 installed on your machine and it should be listed at 
configure time. Could you post the config.log file for further 
investigation ?


Thanks,

Clément

-Original Message-
From: users  On Behalf Of Antoine 
Monmayrant

Sent: Friday, May 7, 2021 5:40 PM
To: users@lists.scilab.org
Subject: [Scilab-users] Scilab compilation from scratch (was Re: spec 
can crash scilab)


Hello all,

In order to try to mitigate bug 15330, I try to compile scilab from 
source on Linux Ubuntu 18.04 64bits.

I follow the explanations from
https://wiki.scilab.org/Compilation%20of%20Scilab [Linux x86_64 cheat 
sheet].

Sadly, I don't go really far as the prebuild of java fails:


    Makefile:756: recipe for target 'java' failed

Am I missing something?
Are there other infos somewhere, in particular concerning the 
dependencies ?

Is there a more detailed tutorial for building scilab?

Cheers,

Antoine


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users




___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] Scilab compilation from scratch (was Re: spec can crash scilab)

2021-05-07 Thread Antoine Monmayrant

Hello all,

In order to try to mitigate bug 15330, I try to compile scilab from 
source on Linux Ubuntu 18.04 64bits.
I follow the explanations from 
https://wiki.scilab.org/Compilation%20of%20Scilab [Linux x86_64 cheat 
sheet].

Sadly, I don't go really far as the prebuild of java fails:


    Makefile:756: recipe for target 'java' failed

Am I missing something?
Are there other infos somewhere, in particular concerning the dependencies ?
Is there a more detailed tutorial for building scilab?

Cheers,

Antoine


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Problem with ascii()

2021-05-07 Thread Antoine Monmayrant

Hello,

On 07/05/2021 08:57, Federico Miyara wrote:


Dear all,

If I run this simple code

ascii([ascii("hello"), 13,10, ascii("world")])

Scilab crashes. I should get something like this:

"hello
world"

Is it a bug?


Well, when Scilab crashes, it's always a bug! :-)

On my system it does not crash:

--> ascii([ascii("hello"), 13, 10, ascii("world")])
 ans  =


world"

Antoine


Regards,

Federico Miyara

 
	Libre de virus. www.avast.com 
 



<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] spec can crash scilab

2021-05-05 Thread Antoine Monmayrant

Hello all,

Well, my workaround works up to a certain point.
When I increase the size of the matrix under study, I face another 
blocking issue:


free(): corrupted unsorted chunks

Antoine

On 05/05/2021 09:23, Antoine Monmayrant wrote:


Hello all,

I might have found a workaround, but I still need to ensure that I get 
exactly the same end results in my code.

It seems that I can replace:

[W2, gammas] = spec(A); //crashes

by

[al,be,W2]=spec(A,eye(A)); //fine
gammas=diag(al./be);

If anyone has a solution with eigs, I'll take it.
Could my workaround help investigate where the bug is in the gateway 
between scilab and lapack?


Cheers,

Antoine

On 05/05/2021 08:22, Antoine Monmayrant wrote:



On 05/05/2021 00:09, Samuel Gougeon wrote:

Le 04/05/2021 à 16:38, Antoine Monmayrant a écrit :


Yes, it does the same

So this bug is still a problem, at least on Ubuntu.
Can you guys try to run spec.tst on his machine and comment on 
https://bugzilla.scilab.org/show_bug.cgi?id=15330 ?





Hello Samuel,


Besides, how confusing and messy the notations on the spec () 
documentation page are! ...


  * R defined twice but differently among arguments
  * L defined among arguments but not used in syntaxes
  * Q and Z used in syntaxes but not described among arguments
  * al, be used in descriptions, instead of alpha and beta listed in
arguments
  * E used in the description, but not in arguments nor in syntaxes...

and so on..
In addition, notations differ from a language version to another one...
Some clarification is urgently required.

Indeed.
It is also a big problem for portability to get such a basic 
functionality (solving eigenvalue problems in a linear algebra 
software!) only working on some platforms!


In next release, eigs() -- mainly based on the former Arnoldi 
module, that becomes internal -- is listed in the same help section. 
Have you tried it?
Well, I might be a bit far from my field of expertise, but it does 
not seem that eigs can compute all the eigenvalues/eigenvectors, does it?
It seems that by default it computes the 6 biggest ones and can go up 
to rank(A)-2.


In my use case, I need all the eigenvalues...

Antoine



Samuel


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] spec can crash scilab

2021-05-05 Thread Antoine Monmayrant

Hello all,

I might have found a workaround, but I still need to ensure that I get 
exactly the same end results in my code.

It seems that I can replace:

[W2, gammas] = spec(A); //crashes

by

[al,be,W2]=spec(A,eye(A)); //fine
gammas=diag(al./be);

If anyone has a solution with eigs, I'll take it.
Could my workaround help investigate where the bug is in the gateway 
between scilab and lapack?


Cheers,

Antoine

On 05/05/2021 08:22, Antoine Monmayrant wrote:



On 05/05/2021 00:09, Samuel Gougeon wrote:

Le 04/05/2021 à 16:38, Antoine Monmayrant a écrit :


Yes, it does the same

So this bug is still a problem, at least on Ubuntu.
Can you guys try to run spec.tst on his machine and comment on 
https://bugzilla.scilab.org/show_bug.cgi?id=15330 ?





Hello Samuel,


Besides, how confusing and messy the notations on the spec () 
documentation page are! ...


  * R defined twice but differently among arguments
  * L defined among arguments but not used in syntaxes
  * Q and Z used in syntaxes but not described among arguments
  * al, be used in descriptions, instead of alpha and beta listed in
arguments
  * E used in the description, but not in arguments nor in syntaxes...

and so on..
In addition, notations differ from a language version to another one...
Some clarification is urgently required.

Indeed.
It is also a big problem for portability to get such a basic 
functionality (solving eigenvalue problems in a linear algebra 
software!) only working on some platforms!


In next release, eigs() -- mainly based on the former Arnoldi module, 
that becomes internal -- is listed in the same help section. Have you 
tried it?
Well, I might be a bit far from my field of expertise, but it does not 
seem that eigs can compute all the eigenvalues/eigenvectors, does it?
It seems that by default it computes the 6 biggest ones and can go up 
to rank(A)-2.


In my use case, I need all the eigenvalues...

Antoine



Samuel


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] spec can crash scilab

2021-05-05 Thread Antoine Monmayrant


On 05/05/2021 00:09, Samuel Gougeon wrote:

Le 04/05/2021 à 16:38, Antoine Monmayrant a écrit :


Yes, it does the same

So this bug is still a problem, at least on Ubuntu.
Can you guys try to run spec.tst on his machine and comment on 
https://bugzilla.scilab.org/show_bug.cgi?id=15330 ?





Hello Samuel,


Besides, how confusing and messy the notations on the spec () 
documentation page are! ...


  * R defined twice but differently among arguments
  * L defined among arguments but not used in syntaxes
  * Q and Z used in syntaxes but not described among arguments
  * al, be used in descriptions, instead of alpha and beta listed in
arguments
  * E used in the description, but not in arguments nor in syntaxes...

and so on..
In addition, notations differ from a language version to another one...
Some clarification is urgently required.

Indeed.
It is also a big problem for portability to get such a basic 
functionality (solving eigenvalue problems in a linear algebra 
software!) only working on some platforms!


In next release, eigs() -- mainly based on the former Arnoldi module, 
that becomes internal -- is listed in the same help section. Have you 
tried it?
Well, I might be a bit far from my field of expertise, but it does not 
seem that eigs can compute all the eigenvalues/eigenvectors, does it?
It seems that by default it computes the 6 biggest ones and can go up to 
rank(A)-2.


In my use case, I need all the eigenvalues...

Antoine



Samuel


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] spec can crash scilab

2021-05-04 Thread Antoine Monmayrant

Yes, it does the same

So this bug is still a problem, at least on Ubuntu.
Can you guys try to run spec.tst on his machine and comment on 
https://bugzilla.scilab.org/show_bug.cgi?id=15330 ?


Antoine

On 04/05/2021 16:32, Stéphane Mottelet wrote:


Hi,

it  seems to be the same bug as

https://bugzilla.scilab.org/show_bug.cgi?id=15330

S.

Le 04/05/2021 à 16:27, Antoine Monmayrant a écrit :

Hello all,

I've been fighting during the last few days to nail down a 
segmentation fault in scilab, that seems to plague linux but not 
windows.


Could you try to reproduce it?
Just save the two attached file in a folder, cd to it and run the 
script.
On my machine¹, the call to spec with one output argument is OK, but 
the second one with two output arguments leads to a seg fault.


Can you let me know how it goes on your system?

Here
¹scilab 6.1.0 on Linux Ubuntu 18.04 64bits


___
users mailing list
users@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@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] spec can crash scilab

2021-05-04 Thread Antoine Monmayrant

Hello all,

I've been fighting during the last few days to nail down a segmentation 
fault in scilab, that seems to plague linux but not windows.


Could you try to reproduce it?
Just save the two attached file in a folder, cd to it and run the script.
On my machine¹, the call to spec with one output argument is OK, but the 
second one with two output arguments leads to a seg fault.


Can you let me know how it goes on your system?

Here
¹scilab 6.1.0 on Linux Ubuntu 18.04 64bits



A_kills_spec.sod
Description: Binary data


bug_spec.sce
Description: application/scilab-sce
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] save and load

2021-04-20 Thread Antoine Monmayrant

Hello Anna,

3 points:

(1) Could you post a minimum working example?
Because your code below cannot run, many variables are missing.

(2) Usually, you'd better use xload/xsave to save & restore graphics

(3) There seems to be a bug, as the following code:

   h=scf()
   plot()
   h.children(1).x_ticks.labels="Anna"+h.children(1).x_ticks.labels;
   sleep(100)// just in case it's a race condition
   xsave(TMPDIR+"/tata.sod",h);
   xdel(winsid())
   xload(TMPDIR+"/tata.sod")

Does not restore the modified x_ticks properly...

Does anyone know whether this is a known bug?

Antoine

Le 20/04/2021 à 13:09, anna28 a écrit :

scf();
f=gcf;
f.figure_position=[10,10]
f.figure_size=[1000,700]
clf;
title(plane+" mean POSITIONS - ccode "+ccEn+" - particle "+particle,
'fontsize',4);

xsetech([0,0,1,0.95]);

for j=1:size(puName,'c')
 plot(loc(:),orbitMean(:,j),mark(j),'thickness',2);
 // usando 'loc' come asse x, plotta le misure distanziate correttamente
nel tempo
end

xgrid(33);
xlabel('measurement date [mmdd_hh]','fontsize',3);
ylabel(posRange+" position [mm]",'fontsize',3);
legend(puNames_and_stat(:),-4);
a=gca();
a.x_ticks = tlist(["ticks" "locations", "labels"],loc(:),labels_rot(:));
a.font_size=3;

save("foo6.scg", "a");
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Filled polygons from polylines

2021-04-14 Thread Antoine Monmayrant



On 14/04/2021 14:21, arctica1963 wrote:

Sorry, I did not make it clear.

Instead of the following which updates the existing graphic to generate the
final plot (y1 to y10);

plot(-[t(n) t], [0 y1])
plot(-[t(n) t], [0 y2])
plot(-[t(n) t], [0 y3])
plot(-[t(n) t], [0 y4])
plot(-[t(n) t], [0 y5])
plot(-[t(n) t], [0 y6])
plot(-[t(n) t], [0 y7])
plot(-[t(n) t], [0 y8])
plot(-[t(n) t], [0 y9])
plot(-[t(n) t], [0 y10])

Can a loop (y) be made to simplify the above for clarity as a single plot
command? Not a big issue but would be good to know.


Sure:

plot(-[t(n) t], [[0 y1];[0 y2];[0 y3];[0 y4];[0 y5];[0 y6];[0 y7];[0 y8];[0 
y9];[0 y10]])

Antoine



Lester



--
Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Filled polygons from polylines

2021-04-14 Thread Antoine Monmayrant

Hello Lester,

On 14/04/2021 12:17, arctica1963 wrote:

Is there a way to do a loop over the curves to save multiple plots

What do you want to do exactly?
Do you want to get several image files with only part of the lines or 
surfaces visible?


Because you can do that by playing with the "visible" field of the 
different curves in your graph...


Antoine

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] Précision DRE

2021-04-12 Thread Antoine Monmayrant

Hello Nicolas,

J'ai une un retour en direct de la troposphère du CNRS:

- Oui, il y a la volonté d'ouverture à des postes DR extérieurs.
- Il faut candidater dans une section, typiquement une section qui 
correspond bien au labo que tu vises.
- Si tu es classé sur la liste principale lors du jury d'admissibilité, 
ta candidature passeras devant le jury d'admission DR, qui est commun à 
tous les institutes (ie toutes les sections)
- Il est d'usage d'informer en avance de phase le DAS de l'institut de 
rattachement du labo que tu vises, en envoyant un mail+CV.


Voilà pour les informations que j'ai pu glaner.

Allez, je retourne à la non préparation de mon concours DR que je 
prévois de bien foirer la semaine prochaine! :-)


Antoine

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] xfpoly: would wish that the filling colour could be made transparent.

2021-04-12 Thread Antoine Monmayrant


On 10/04/2021 23:58, Heinz Nabielek wrote:

On 10.04.2021, at 08:10, Antoine Monmayrant  wrote:


On 09/04/2021 23:55, Heinz Nabielek wrote:

xfpoly does generally a good job for me, sometimes I would wish that the 
filling colour could be made transparent.

This is a much needed improvement of the scilab graphical stack that currently 
does not provide any transparency.
I think this is not an easy improvement.
At the moment, my workaround is to plot everything I need, export as svg and 
than add the transparency I need in the svg using inkscape or directly editing 
the svg file with a text editor...

Heinz

PS 1: Is there a new version of the 2011 BetweenCurves around?

Er, no, it was just a dirty hack I needed for my own publications and I think 
2011 is the most recent one.
I can try to see how to improve it if this can improve scilab...




I had initiated by log vs lin plot with

plot2d([0 80],[1 100], style=0,logflag = "nl");

but BetweenCurves starts with its own plot and here I would not know, what to 
do...


Hello,

There are two options:

(1) If you already have a handle "h0" to a plot and want BetweenCurves 
to use it, you can do:


   [h,epoly,ey1,ey2]=BetweenCurves(x,y1,y2,handle, h0)

(2) you can also do:

   [h,epoly,ey1,ey2]=BetweenCurves(x,y1,y2,handle, h0)

 and then use

   h.children(1).log_flags='nln'

to change from linear to log y axis.

Is this what you have in mind?

Antoine


Heinz

BTW, how do the French infection rates look like?

I must admit it is not a metric I track.
For the trend in France I go here 
https://coronavirus.politologue.com/coronavirus-france.FR and for a more 
global view there: https://coronavirus.politologue.com/100k-habitants/



PS 2: Any suggestion to make my clumsy coding more elegent, is highly welcome

PS 2: BTW, since the recent lockdown, infection rates are coming down in 
Austria.


A=[12.62813.94217.07717.05415.59414.97614.79611.875 
   13.44816.50417.71719.44716.09913.30213.76216.032 
   19.49222.09820.42521.08720.64914.26819.40222.525 
   26.86223.51427.60323.85115.83021.57028.68226.109 
   29.97428.72724.70521.45827.08728.40133.67035.119 
   33.96228.12021.30127.24437.46737.71539.49037.569 
   30.48027.09838.36636.95135.09743.75939.299]';
d=(1:length(A))';
up=10^(d/53);
M=[ones(up) up];
aa=M\A;
B=inv(M'*M);
DD=(1:110)';
U=10^(DD/53);
MM=[ones(U) U];
yh = M*aa; //Fitted values yh to approximate measured y's
e=A-yh; //Errors or residuals
SSE=e'*e; //Sum of squared errors
ybar=mean(A); R2=1-SSE/sum((A-ybar)^2);
[m n]=size(M);
MSE = SSE/(m-n-1); //Mean square error
C=MSE*B  // covariance matrix
sig=sqrt(MSE);
seb=sqrt(diag(C));
[aa seb]
[n pp]=size(M);
CONF=.95; alpha=1-CONF;
ta2 = cdft('T',n-pp,1-alpha/2,alpha/2); //t-value for alpha/2
yhh= MM*aa;
p=sig*sqrt(diag(1+MM*B*MM'));
N=[yhh+ta2*p  yhh-ta2*p];
polyX = [DD;flipdim(DD,1)];
polyY = [N(:,1);flipdim(N(:,2),1)];
plot2d([0 80],[1 100], style=0,logflag = "nl");
xgrid;
xfpoly(polyX, polyY,6);
plot(DD,MM*aa,'g.-');
plot(d,A,'b.') ;
title('AUSTRIA daily infection rates per 100,000','fontsize',5);
xlabel('days since 1 Feb 2021','fontsize',3);
ylabel('number of infections per day per 100,000','fontsize',3);
legend('data from Johns Hopkins GitHub','95% confidence range','model 
prediction','AUSTRIA recorded',4);




___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] xfpoly: would wish that the filling colour could be made transparent.

2021-04-10 Thread Antoine Monmayrant


On 09/04/2021 23:55, Heinz Nabielek wrote:
xfpoly does generally a good job for me, sometimes I would wish that 
the filling colour could be made transparent.
This is a much needed improvement of the scilab graphical stack that 
currently does not provide any transparency.

I think this is not an easy improvement.
At the moment, my workaround is to plot everything I need, export as svg 
and than add the transparency I need in the svg using inkscape or 
directly editing the svg file with a text editor...

Heinz

PS 1: Is there a new version of the 2011 BetweenCurves around?
Er, no, it was just a dirty hack I needed for my own publications and I 
think 2011 is the most recent one.

I can try to see how to improve it if this can improve scilab...


PS 2: Any suggestion to make my clumsy coding more elegent, is highly 
welcome


PS 2: BTW, since the recent lockdown, infection rates are coming down 
in Austria.



A=[12.628 13.942 17.077 17.054 15.594 14.976 14.796 
11.875 13.448 16.504 17.717 19.447 16.099 13.302 
13.762 16.032 19.492 22.098 20.425 21.087 20.649 
14.268 19.402 22.525 26.862 23.514 27.603 23.851 
15.830 21.570 28.682 26.109 29.974 28.727 24.705 
21.458 27.087 28.401 33.670 35.119 33.962 28.120 
21.301 27.244 37.467 37.715 39.490 37.569 30.480 
27.098 38.366 36.951 35.097 43.759 39.299]';
d=(1:length(A))';
up=10^(d/53);
M=[ones(up)  up];
aa=M\A;
B=inv(M'*M);
DD=(1:110)';
U=10^(DD/53);
MM=[ones(U)  U];
yh  =  M*aa;  //Fitted values yh to approximate measured y's
e=A-yh;  //Errors or residuals
SSE=e'*e;  //Sum of squared errors
ybar=mean(A);  R2=1-SSE/sum((A-ybar)^2);
[m  n]=size(M);
MSE  =  SSE/(m-n-1);  //Mean square error
C=MSE*B   // covariance matrix
sig=sqrt(MSE);
seb=sqrt(diag(C));
[aa  seb]
[n  pp]=size(M);
CONF=.95;  alpha=1-CONF;
ta2  =  cdft('T',n-pp,1-alpha/2,alpha/2);  //t-value for alpha/2
yhh=  MM*aa;
p=sig*sqrt(diag(1+MM*B*MM'));
N=[yhh+ta2*p   yhh-ta2*p];
polyX  =  [DD;flipdim(DD,1)];
polyY  =  [N(:,1);flipdim(N(:,2),1)];
plot2d([0  80],[1  100],  style=0,logflag  =  "nl");
xgrid;
xfpoly(polyX,  polyY,6);
plot(DD,MM*aa,'g.-');
plot(d,A,'b.')  ;
title('AUSTRIA daily infection rates per 100,000','fontsize',5);
xlabel('days since 1 Feb 2021','fontsize',3);
ylabel('number of infections per day per 100,000','fontsize',3);
legend('data from Johns Hopkins GitHub','95% confidence range','model 
prediction','AUSTRIA recorded',4);



___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Precedence rules for concurrent native and external builtin homonymous functions?

2021-04-09 Thread Antoine Monmayrant


On 09/04/2021 17:57, Samuel Gougeon wrote:


Dear all,

I am wondering about precedence rules when a user's defined builtin 
(possibly from an ATOMS external module) has the same name than a 
native Scilab builtin function.
The case appeared (and maybe still) when using the scicv external 
module, that redefined a write() function that already exists in Scilab.


Does anyone know how such conflicts are managed by Scilab?

Poorly or not at all according to my own painful experience with grocer 
and scicv that caused weird behaviours by overloading existing functions...


Qntoine


Thanks

Samuel


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Filled polygons from polylines

2021-04-07 Thread Antoine Monmayrant

Hello all,

I think I answered this question before on this mailing list...

Ah, yes I did:

http://mailinglists.scilab.org/Reg-Area-Between-two-curves-td3393261.html#a4026721

Get the source for "[h,epoly,ey1,ey2]=BetweenCurves(x,y1,y2,varargin)" 
in the thread.


Hope it helps,

Antoine

On 07/04/2021 10:57, CRETE Denis wrote:

Hello,
The filled area is defined by 2 curves apparently; one is the top border and 
one is the lower border. Is it possible to construct a closed polygon using the 
points of both curves (something like C=[C1;C2] ) ?
HTH
Denis

-Message d'origine-
De : users  De la part de arctica1963
Envoyé : mercredi 7 avril 2021 09:26
À : users@lists.scilab.org
Objet : [Scilab-users] Filled polygons from polylines

Hello,

I have script that reads a csv file containing the data and uses that to 
calculate subsidence from well information. This all works fine, but it is not 
the best way to display the result. Is it possible to take the polyline output 
and generate filled polygons (similar to attached image)?

I am not sure how it is possible from the existing code to close the output 
result used in the plot function to create a closed polygon. Essentially it 
needs extra points otherwise you would just tie the end point and start point 
of the polyline.

It would be good to get some other ideas and whether it is actually possible. 
Original code was in Matlab and had all of the data within the script, so I 
took that out and stored in a separate data file for ease of use.

Thanks for any suggestions.

Lester

Backstrip_1D_v1.sce

A1-NC198.csv 
Backstrip_1D_filled-plot.jpg




--
Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] plotplots() in Scilab

2021-04-02 Thread Antoine Monmayrant


On 02/04/2021 12:16, CRETE Denis wrote:


Hello,

I am also in favour of including this function in Scilab, with an 
“improved” name. However, as far as I know, an inset has very 
frequently its own pair of axes, as opposed to a ticks-switching in 
(only one of) the axes. Thus, I would not recommend a name with 
“inset” and reserve it for a function more closely implementing an inset.


Zoom is quite appealing.

I was wondering about “non-linear”_something…


Hello Denis,

I'm with you here: this should be included, but the name is not well 
matching the features of the function.

Indeed, 'inset' is not at all what 'plot_plot' is offering.
I was also thinking about "non-linear-axis" or something like that, but 
I am not sure such a name will improve discoverability of the function.

But you are right: this is about having non-regular or non-linear axis.

nonlinear-plot ? non-regular-plot ? All this is not convincing for me...

By the way, we have developed some ugly hacks in the past to get 
'non-linear' or 'non-regular' colormaps for the same reason than Samuel.
The idea was to rescale the data to Sgrayplot such that one could map 
exact intermediate Z_values to some colors of existing or new colormap:


[0, 0.1, 1, 2, 100] -> [black, red, orange, yellow, white]

One of the key advantage is that you could be sure that a certain value 
(like z=0) was exactly corresponding to a certain color (like white) 
which is sometime necessary (for plotting  asymmetric waves or fields 
with a red-white-blue colormap for example).


Antoine


Thank you for your developments

Denis

*De :*users  *De la part de* Clément David
*Envoyé :* vendredi 2 avril 2021 11:20
*À :* sgoug...@free.fr; Users mailing list for Scilab 


*Objet :* Re: [Scilab-users] plotplots() in Scilab

Hello Samuel, hello all,

First thanks for the request for inclusion, that’s always good to have 
more features into Scilab itself. However, I have a few remarks 
regarding this function.


1.The function name plotplots() does not seem well known nor easy to 
find ; after a few research I found similar behavior for Matlab and 
Matplotlib worded as “zoomed” or “zoomed_inset_axes” which better 
represent the behavior.


·https://stackoverflow.com/questions/13583153/how-to-zoomed-a-portion-of-image-and-insert-in-the-same-plot-in-matplotlib

·https://fr.mathworks.com/matlabcentral/fileexchange/59857-zoomplot

·https://fr.mathworks.com/matlabcentral/answers/349042-zoomed-plot-in-the-same-figure

What about using `plot_zoomed()`, `plot_inset()` or `plot_inside()` ?

2.I found the need to have a second axe (example 1) different to 
recompute ticks (example 2). I might have miss something, could you 
clarify these two usage ?


Thanks,

Clément

*From:*users > *On Behalf Of *Samuel Gougeon

*Sent:* Thursday, April 1, 2021 10:07 PM
*To:* International users mailing list for Scilab. 
mailto:users@lists.scilab.org>>

*Subject:* [Scilab-users] plotplots() in Scilab

Dear all,

I would like to propose to include the plotplots() graphical function 
into Scilab.


For now 3 years, plotplots() is distributed alone in its own external 
module , with a fair 
number of downloads for a single function.


Its embedded documentation is as well provided online as PDF, in 
english 
and 
in french 
.


As soon as a function has a local singularity or/and an asymptotical 
behavior (that's quite common), plotplots() is very helpful to 
illustrate its specific behaviors without masking more "regular" 
features with a crushing graphical scale.


Every comment is welcome about the current plotplots status, and about 
the proposal to include it as a native Scilab function.



Hope reading you,

Best regards

Samuel


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Scilab stops calculus

2021-03-16 Thread Antoine Monmayrant


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


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Scilab stops calculus

2021-03-12 Thread Antoine Monmayrant



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


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Scilab stops calculus

2021-03-12 Thread Antoine Monmayrant

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@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@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Scilab stops calculus

2021-03-11 Thread Antoine Monmayrant



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@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Scilab stops calculus

2021-03-11 Thread Antoine Monmayrant

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


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] interp and memory

2021-03-08 Thread Antoine Monmayrant

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@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] interp and memory

2021-03-08 Thread Antoine Monmayrant

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 
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Variable scope in Scilab

2021-03-01 Thread Antoine Monmayrant


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@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@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Scilab 5.5.2 in Debian 10 - segmentation fault

2021-02-25 Thread Antoine Monmayrant

Hello Clément,

I forgot that detail.
But this will not help Andrei use parallel_run, as it does not work 
under linux, right?


Cheers,

Antoine

On 25/02/2021 16:10, Clément David wrote:


Hello Andrei,

To launch the Scilab 5.5.2 binary on new Linux version, you might need 
to remove some libraries (so files) provided by your system. 
Especially, you could remove the scilab-5.5.2/lib/thirdparty/libz.so.1 
file which is provided by your system.


Regards,

Clément

*From:* users  *On Behalf Of *Andrei Lomov
*Sent:* Thursday, February 18, 2021 11:00 AM
*To:* users@lists.scilab.org
*Subject:* [Scilab-users] Scilab 5.5.2 in Debian 10 - segmentation fault

Hi All,

In order to use Scilab’ parallel_run in Debian 10 (x86_64),

i download

https://www.scilab.org/download/5.5.2/scilab-5.5.2.bin.linux-x86_64.tar.gz

unpack it to

~/foo/scilab-5.5.2

then

cd ~/foo/scilab-5.5.2/bin

and run …

$./scilab

Segmentation fault

:((

? What am I doing wrong ...

--
WBR,

Andrei


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Some details on the documentation of log(), log10(), etc.

2021-02-22 Thread Antoine Monmayrant

Hello all,

On 22/02/2021 10:12, Stéphane Mottelet wrote:


Hi,

Le 22/02/2021 à 09:43, Clément David a écrit :


Hello all,

Thanks for opening the discussion on this “new user”-related topic, 
this is always good to improve our help for existing user and new 
comers ; to let them havie a clear understanding of Scilab-lingua.


One important point to me is to have a proper distinction between 
“array” (as values organized in multiple dimensions) and more precise 
terms with more constraints on dimensions “horizontal vector”, 
“matrix”, etc… For keeping the rationale up to date, I suggest you to 
edit the Localization wiki page [1].


In term of code update, I can help you finding duplicated messages 
but keep in mind that the build-system create .pot files from the 
source code. To look for duplicate, the more important is to upgrade 
the source code.


[1]: https://wiki.scilab.org/Localization in English - Standard messages

Note: AFAK the “constant” term has been removed on 6.0.0 
documentation/error message as this is the default datatype, in case 
of advanced type management the term “decimal” can be used instead.


I think that the "decimal" term has to be discussed. In no way the 
default number type in Scilab is decimal 
(https://en.wikipedia.org/wiki/Decimal). Scilab actually displays 
rounded decimal approximations but internally they are IEEE754 
double-precision floating point numbers. I think that the "floating 
point numbers" instead of "decimal" would be more suitable as is does 
not make any mention of the basis. As far as I am concerned, I don't 
have any problem with


"array of floating point numbers"


I agree with Stéphane here, "decimal" does not make sense.
It is even deceiving as some languages implement proper base10 "decimal" 
data type, whereas scilab is defaulting to double (float64) data 
representation.

But I think we should go further: "array of double" is even better.


In some contexts, typically when describing the type of arguments in 
the documentation of functions, we could be more precise by making 
reference to the actual internal object type, i.e. "double" or 
"Double", i.e.


array of type double
array of double


Yes, that's exactly what I find best.
For comparison, python3 mentions "float" and julia "float64" when 
inquiring about the default type of "a=1.1".


Scilab users are mature enough to accept a bit of technical (but 
precise) terms. But this is my personal opinion...


I agree, I don't see the point in mentioning something vague that a true 
beginner will have to learn anyway: it's better to start right away with 
learning the proper term to name the default datatype of scilab...


Antoine


S.


Regards,

Clément

*From:* users  *On Behalf Of 
*Stéphane Mottelet

*Sent:* Saturday, February 20, 2021 5:35 PM
*To:* users@lists.scilab.org
*Subject:* Re: [Scilab-users] Some details on the documentation of 
log(), log10(), etc.


By looking into the documentation messages I realized that we already 
use "array" :


./locale/de_DE/LC_MESSAGES/scilab.po-e:msgid "%s: Wrong type for 
input argument #%d: Array of double expected.\n"


S.

Le 20/02/2021 à 17:21, Stéphane Mottelet a écrit :

Hi Frederico,

In almost all other numerical software the object defined in
Scilab by a=zeros(3,3,3) is called an "array", m=zeros(3,3) a
"matrix" and x=zeros(1,3) or y=zeros(3,1) "vectors", and all of
them are called "arrays". BTW, now the "hyper" prefix sounds like
when it is used in "hyperspace"... To me, the documentation
should be revamped to always use "array" when the denoted object
can have any number of dimensions and use "matrix" only when the
array has to be a matrix. Concerning your remark about the
"constant vector or constant matrix", yes, this should be changed
by something more explicit, like "array of double". We already
use similar terms in error messages, i.e.

"%s: Wrong type for input argument #%d: A matrix of double
expected.\n"

Hence we could synchonize the uses of localized messages with the
documentation. When I say "we" it also includes "you", Frederico.
If you feel that Scilab could be improved by a better
documentation, please contribute. If you need some help to start
using the relevant tools (git, codereview) I would be glad to
help you.

S.

Le 20/02/2021 à 01:29, Federico Miyara a écrit :


Dear all,

In an old script where I needed to apply log10 to an
hyperarray I had implemented it as log(A)/log(10) with a
comment indicating that in that version log10() didn't work
for hyperarrays (unfortunately I don't recall what version it
was).

In Version 6.1.0 it does work for hyperarrays, but the
documentation still says that it applies to vectors or matrices:

https://help.scilab.org/docs/6.1.0/en_US/log10.html


Re: [Scilab-users] Scilab 5.5.2 in Debian 10 - segmentation fault

2021-02-18 Thread Antoine Monmayrant

Hello Andrei,

I think this is a dead end.
As far as I remember, parallel_run only works on Windows, on 1 core and 
is an ugly hack.

From https://help.scilab.org/doc/5.5.2/en_US/parallel_run.html :

"In this current version of Scilab, |parallel_run| uses only one core on 
Windows platforms."


Can you tell us a bit more about what you try to do?

Cheers,

Antoine

On 18/02/2021 10:59, Andrei Lomov wrote:

Hi All,
In order to use Scilab’ parallel_run in Debian 10 (x86_64),
i download
https://www.scilab.org/download/5.5.2/scilab-5.5.2.bin.linux-x86_64.tar.gz
unpack it to
~/foo/scilab-5.5.2
then
cd ~/foo/scilab-5.5.2/bin
and run …
$./scilab
Segmentation fault
:((
? What am I doing wrong ...
--
WBR,
Andrei

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] slight bug in exists()

2021-02-08 Thread Antoine Monmayrant

Hello Federico,

I agree with you that this would make more sense.
Could such a change be implemented for a point release?
I assume it would introduce some bugs in existing code relying on the 
(unusual) double output...


Antoine

On 09/02/2021 03:24, Federico Miyara wrote:


Dear all,

I had already mentioned this a while ago 
(http://mailinglists.scilab.org/Scilab-users-exists-yields-double-tt4039853.html), 
but as I guess we are in the update season, it would be good 
opportunity to fix this (if there isn't strong opposition, or a good 
reason for this behavior, of course).


I'm referring to the fact that the function exists() should by nature 
yield a Boolean result such as T or F. However, it yields 1 or 0. 
While this is not a big deal, similar functions performing a binary 
decision on their arguments, such as isreal(), isvector(), isfile() 
and many others, yield Boolean results.


Regards,

Federico Miyara

 
	Libre de virus. www.avast.com 
 



<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Default x|y|z labels and title font size = 2?

2021-02-02 Thread Antoine Monmayrant

Hello Samuel,


Le 01/02/2021 à 23:26, Samuel Gougeon a écrit :


Dear all,

After having changed the default grid style in Scilab 6.1.0, i propose 
to go on, tuning more carefully the default font size of axes labels.


Each time that i define a xlabel, ylabel or sometimes zlabel, and a 
title, i have also to set explicitly their fontsize property, because 
i find the default size=1 always too small.

Is it also your usage?


Yes!


Indeed, the font size = 1 is fine for ticks labels. From here, axes 
labels must be displayed with a bigger font size.
Sometime size=2 is still not enough, noticeably with a LaTeX content. 
But well, then we can actually use an explicit fontsize setting.



Indeed, I usually use font_size=4 or 5 when using LaTeX strings.



This proposal impacts everybody and frequently, because making plots 
is a basic task in Scilab

Every comment is welcome, before implementing this simple change.


I have a comment concerning the syntax.
I'm not particularly fan of the "inline" syntax without parenthesis.

Is your:

    xlabel "Title for abscissas" fontsize 2

syntaxic sugar for

    xlabel( "Title for abscissas", fontsize=2)

or something equivalent?

Antoine



Hope reading you soon.

Samuel Gougeon

clf
subplot(1,3,1)
plot2d
xlabel  "Title for abscissas"
ylabel  "Title for ordinates"

subplot(1,3,2)
xlabel  "Title for abscissas"  fontsize  2
ylabel  "Title for ordinates"  fontsize  2
plot2d

subplot(1,3,3)
xlabel  "$\alpha\text{ coefficient }[m^{-1}]$"  fontsize  2
ylabel  "$\beta\text{ result }[lm^{-1}]$"  fontsize  2
plot2d



___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] users@ interruptions?

2021-01-22 Thread Antoine Monmayrant

me too!

Antoine

On 22/01/2021 22:11, P M wrote:

Yes, I did receive that message.

Best Regards,
Philipp

Am Fr., 22. Jan. 2021 um 21:05 Uhr schrieb Samuel Gougeon 
mailto:sgoug...@free.fr>>:


Hello,
Has anyone received the recent message archived @

http://mailinglists.scilab.org/Scilab-users-Update-library-and-help-tt4041262.html

?
I have not.
BR
Samuel

___
users mailing list
users@lists.scilab.org 
http://lists.scilab.org/mailman/listinfo/users


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Problems arising from truncation of %pi

2021-01-06 Thread Antoine Monmayrant

Hello Frederico,

Like Christophe, I am not sure this has anything to do with the 
implementation of sin().
It seems to be a known limitation of numerical calculations using 
floating numbers.
In particular, even with en hypothetical ideal value of %pi, because of 
the conversion to a double, %pi*1e15 is converted to the nearest 
available double and this "shift" or error as compared to the ideal 
infinitely-precise value is increasing with the size of your number.
Thus you make a x1e15 bigger error when using "%pi*1e15" than when using 
"%pi".
As Christophe as said, there is not much you can do, apart from 
resorting to symbolic calculation (what Alpha does).


You can see that by using nearfloat to get the distance between two doubles:

   nearfloat("succ", %pi)-%pi
 ans  =   4.441D-16
   nearfloat("succ", %pi*1e15)-%pi*1e15
 ans  =   0.5

As I said, the error on the sin() argument is getting x1e15 bigger!

I'm sorry if my explanation of floating point numbers is not really good.
This one was a revelation for me: 
https://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html .
It helped me understand why it's usually a good idea to use "reduced 
units" for your calculations (ie keep everything close to 1 when possible).


I hope it helps,

Cheers,

Antoine
On 05/01/2021 09:19, Federico Miyara wrote:


Dear all,

In order to test the FFT on a periodic signal whose period is an exact 
submultiple of the FFT length I found a frequency fo satisfying this 
for the chosen sample rate and window length, and generated the 
following signal:


x = sin(2*%pi*fo*t);

where t is a time vector. This should be a perfectly periodic discrete 
signal but it isn't because the sin() function has a (virtually) exact 
period of pi, while %pi is exact to 16 digits only.


For instance, we have (23 digits shown)

--> sin(%pi)
 ans  =
   0.0001224647

--> sin(1e10*%pi)
 ans  =
  -0.022393627619559233

--> sin(1e15*%pi)
 ans  =
  -0.2362090532517409080526

The Wolfram Alpha site yields the correct value 0 in all cases (using 
their own pi).


Questions:

1) How is the sin() function extended to very large values of the 
argument? My first guess would be to compute a quarter cycle using 
Taylor and then extend it by symmetry and periodicity, but with which 
period? The best approximation available is 2*%pi. Or it is possible 
to use extended precision internally?


2) Is there a way to get a periodic discrete sine other than extending 
it periodically with the desired period?

Wouldn't this create a slight glitch at the frontier between cycles?

Regards,

Federico Miyara

 
	Libre de virus. www.avast.com 
 



<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] New constant %chars to get sets of symbols

2020-12-31 Thread Antoine Monmayrant


On 31/12/2020 15:43, Samuel Gougeon wrote:

Le 31/12/2020 à 15:27, Antoine Monmayrant a écrit :

.../...


I am not sure that implementing the Julia solution with LaTeX would 
improve a lot the situation:


  * first, we still have to remember a code, the latex one ; this is
simple for common characters, but get harder and harder for less
frequent ones. While a selection among displayed/rendered
characters do not need to remember any code. I have written 700
pages in LaTeX without wysiwym software like LyX, and hopefully
i had always a hand on "A Guide to LaTeX-2e"  and its tables of
illustrated codes to get the right one.
  * Moreover, we can put in %chars some characters that have no
LaTeX code.
  * Finally, implementing a LaTeX shortcut could not be used when
editing the documentation out of the console and Scinotes,
except to render the character in order to then, anyway,
copy/paste it wherever needed.

So, to me, the main purposes are

  * to stop having to remember any code for the -- say 500 or 1000
-- most used characters, when no complex expression is required.


Well, I don't see how this should work then.
How do I select λ in your proposed solution? Should I have to 
visually scan a 500-symbol long list?

I think I missed something in your proposal.


We enter and display
--> %chars   // (OK not here. See the proposed documentation for the 
full display)


or for a chosen class

--> %chars.greek
 ans  =
  lower = "αβδεϵζηθικλμνξοπρστυφϕχψωάϐέήϑίϊϰόϱςύϋΰϖώ"
  upper = "ΑΒΓΔΕΖΗΘϴΙΪΚΛΜΝΞΟΠΡΣΤΥΫΦΧΨΩ KΩ℧"

OK, I see better what you propose.
But you are trading remembering a code (ie \lambda for λ) for 
remembering which class the symbol you are looking for belongs to...
Again, for some of them, it might be obvious (ie \lambda is easy, so is 
%chars.greek for a Greek symbol) but for some others it's far from obvious.

Like where would you put your \Diamond or \vdash?
I've used my share of LaTeX IDEs and all the symbols assistants failed 
me in the same way: they give you easy and obvious access to symbols you 
already know by heart (ie \alpha is in Greek, top first element) but are 
a useless mess when looking for more obscure symbols (why is \bigstar in 
Misc-Math, between \blacklozenge and \spadsuit ?)



Then we select λ, and copy/paste it where needed.


  * to stop having to search in an external document when working
with Scilab
  * and possibly, to present classes of characters, what can help
finding the required one.

Beyong this current topic and the trivial implementation of %chars, 
it could then even be useful to have an easy way to get the LaTeX 
code from a selected character, instead of the opposite!


Well, here is my assumption (that might be wrong): most of the people 
trying to use λ or ∆ might be aware that they are called lambda and 
Delta and from there, the LaTeX naming convention is usually quite 
sensible: \lambda, \Delta.




Yes, these are the frequent easy characters to remember.

I think there is quite a difference between remembering 
Ctrl+Maj+Alt+u+03BB and remembering \lambda+Tab to get λ!

For me, the second solution is way more user friendly... :-)

For sure, but, still, i won't remember \Diamond (why with a capital?), 
\diamondsuit (all in lowercases), \vdash, etc etc codes without 
_/first/ sawing_ them rendered.




___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] New constant %chars to get sets of symbols

2020-12-31 Thread Antoine Monmayrant


On 31/12/2020 13:44, Samuel Gougeon wrote:

Le 31/12/2020 à 10:36, Antoine Monmayrant a écrit :

On 29/12/2020 16:39, Samuel Gougeon wrote:
As well, i must confess that having a ALT+X or any other keys 
shortcut able to convert a series of 2 to 4 input unicodes to the 
corresponding character -- as proposed in wish #16505 -- would be of 
almost no help to me, because i do not remember unicodes of any 
non-ascii characters. Who does? Such a ALT-X shortcut is used for 
instance in the -- yet great -- /Inskscape/ free drawing software. 
Then, each time that a greek letter or another symbol must be used, 
we need to find its unicodes in an extra document (most often on 
internet). It's definitely not handy.

I agree with you here.
It is not a good idea to use such a shortcut that replicates what is 
already present at the OS level: on linux for example Crtl+Alt+Maj+u 
allows to type the unicode of a character (like 3BB for λ). 
Equivalent shortcuts exist under Windows and MacOS.


From my personal experience, my preferred implementation is the one 
used by Julia: type the LaTeX macro (like \lambda for λ) then Tab and 
you get the unicode character.
I assume implementation something like that in Scilab is quite a lot 
of work...


Your proposition might be a good compromise between ease of 
implementation and usefulness.




Thank you for your input and for supporting the proposal, Antoine.

About any shortcut proposal, may i add that, yes it would be a more 
general solution than the selected characters in %chars. But while 
getting an external document referencing unicodes of some requested 
symbols, i don't see any reason to get the unicodes and use the 
shortcut, instead of directly copying the character from this external 
document and copying it wherever it is needed in Scilab or elsewhere, 
as in a documentation page edited with Notepadd++ for instance.
Therefore, the right external document to select is not a document 
listing unicodes, but more simply a document listing characters sets 
rendered without gif or other images. Before implementing this %chars, 
it was what i used to do.


I am not sure that implementing the Julia solution with LaTeX would 
improve a lot the situation:


  * first, we still have to remember a code, the latex one ; this is
simple for common characters, but get harder and harder for less
frequent ones. While a selection among displayed/rendered
characters do not need to remember any code. I have written 700
pages in LaTeX without wysiwym software like LyX, and hopefully i
had always a hand on "A Guide to LaTeX-2e"  and its tables of
illustrated codes to get the right one.
  * Moreover, we can put in %chars some characters that have no LaTeX
code.
  * Finally, implementing a LaTeX shortcut could not be used when
editing the documentation out of the console and Scinotes, except
to render the character in order to then, anyway, copy/paste it
wherever needed.

So, to me, the main purposes are

  * to stop having to remember any code for the -- say 500 or 1000 --
most used characters, when no complex expression is required.


Well, I don't see how this should work then.
How do I select λ in your proposed solution? Should I have to visually 
scan a 500-symbol long list?

I think I missed something in your proposal.


 *


  * to stop having to search in an external document when working with
Scilab
  * and possibly, to present classes of characters, what can help
finding the required one.

Beyong this current topic and the trivial implementation of %chars, it 
could then even be useful to have an easy way to get the LaTeX code 
from a selected character, instead of the opposite!


Well, here is my assumption (that might be wrong): most of the people 
trying to use λ or ∆ might be aware that they are called lambda and 
Delta and from there, the LaTeX naming convention is usually quite 
sensible: \lambda, \Delta.


I think there is quite a difference between remembering 
Ctrl+Maj+Alt+u+03BB and remembering \lambda+Tab to get λ!

For me, the second solution is way more user friendly... :-)


Antoine


Regards
Samuel



___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] New constant %chars to get sets of symbols

2020-12-31 Thread Antoine Monmayrant


On 29/12/2020 16:39, Samuel Gougeon wrote:
As well, i must confess that having a ALT+X or any other keys shortcut 
able to convert a series of 2 to 4 input unicodes to the corresponding 
character -- as proposed in wish #16505 -- would be of almost no help 
to me, because i do not remember unicodes of any non-ascii characters. 
Who does? Such a ALT-X shortcut is used for instance in the -- yet 
great -- /Inskscape/ free drawing software. Then, each time that a 
greek letter or another symbol must be used, we need to find its 
unicodes in an extra document (most often on internet). It's 
definitely not handy.

I agree with you here.
It is not a good idea to use such a shortcut that replicates what is 
already present at the OS level: on linux for example Crtl+Alt+Maj+u 
allows to type the unicode of a character (like 3BB for λ). Equivalent 
shortcuts exist under Windows and MacOS.


From my personal experience, my preferred implementation is the one 
used by Julia: type the LaTeX macro (like \lambda for λ) then Tab and 
you get the unicode character.
I assume implementation something like that in Scilab is quite a lot of 
work...


Your proposition might be a good compromise between ease of 
implementation and usefulness.



Cheers,

Antoine

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Increasing Scilab default Java heap memory to 512 MB?

2020-12-20 Thread Antoine Monmayrant


On 19/12/2020 16:24, Samuel Gougeon wrote:

Le 16/12/2020 à 14:16, Antoine Monmayrant a écrit :


That's the very first thing we change after installing scilab on all 
the computers in our group, so I agree we need to change it.


I conclude that 512 MB is enough. Otherwise you would not have 
experienced and reported the issue.

Wait, what?
I don't see how you conclude 512 is enough?

In my case, I set it to 2GB:



A patch with this value is submitted for Scilab 6.1.1 @ 
https://codereview.scilab.org/21650


Cool!

Antoine



Samuel

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Increasing Scilab default Java heap memory to 512 MB?

2020-12-16 Thread Antoine Monmayrant
That's the very first thing we change after installing scilab on all the 
computers in our group, so I agree we need to change it.
Is there a way to make people aware of this settings and tell them that 
it's related to plotting?
Like displaying a tip saying that they can crank it up when they need to 
display/export large plots and that it will add up to the memory used by 
scilab?


Antoine

On 15/12/2020 19:09, Samuel Gougeon wrote:

Opening a new thread after
http://mailinglists.scilab.org/Scilab-users-Headless-graphics-in-scilab-time-memory-issues-tp4041133p4041160.html

Le 15/12/2020 à 18:58, Samuel Gougeon a écrit :

Le 03/12/2020 à 09:59, Antoine Monmayrant a écrit :


Hello again,

Just to add to my previous message: increasing nx or ny in my script 
can crash scilab during the call to xend().

On my small local machine, this occurs for:

nx=4000;
ny=3000;

for which scilab takes ~7 seconds to create the png in "normal" mode...

Can any of you confirm this bug?



The crash is due to a too small Java Heap of memory.
When increasing it through the user's Preferences from 256 MB to 1 
GB, the PNG export works as fast as expected.


By the way, everyone, what do you think about increasing the default 
Scilab java Heap from 256 MB to 512 MB?
This default 256 MB was set a long time ago, when on computers the 
average RAM what much smaller than today...


Samuel


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] unicode in variable names and Scinotes syntax highlighting

2020-12-09 Thread Antoine Monmayrant

Ah, and of course, there is a stupid bug in one of my functions!
A virtual croissant to the first one to spot it!

Antoine
PS: BTW, it's one of the errors that should be easy to catch with a 
proper argument highlighting...


On 09/12/2020 15:09, Antoine Monmayrant wrote:


Hi all,

Scilab can use unicode characters (at least some) as variable names.
However, this does not play well with Scinotes syntax highlighting in 
functions.
In particular, input/output arguments are no longer highlighted and 
local line number inside the function does no longer work as expected.

You can see the attached screenshot to better see what I mean.

Here is a bunch of function definitions that shows the issue:

function [Sum, Diff] = AddSubs(arga, argb)

    Sum=arga+argb;

    Diff=arga-argb;

endfunction


function [Sum, Diff] = AddSubs2(argα, argb)

    Sum=argα+argb;

    Diff=argα-argb;

endfunction


function [Sum, Δ] = AddSubs(arga, argb)

    Sum=arga+argb;

    Diff=arga-argb;

endfunction

Can anyone reproduce the issue?

Cheers,

Antoine



___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] unicode in variable names and Scinotes syntax highlighting

2020-12-09 Thread Antoine Monmayrant

Hi all,

Scilab can use unicode characters (at least some) as variable names.
However, this does not play well with Scinotes syntax highlighting in 
functions.
In particular, input/output arguments are no longer highlighted and 
local line number inside the function does no longer work as expected.

You can see the attached screenshot to better see what I mean.

Here is a bunch of function definitions that shows the issue:

   function [Sum, Diff] = AddSubs(arga, argb)

    Sum=arga+argb;

    Diff=arga-argb;

   endfunction


   function [Sum, Diff] = AddSubs2(argα, argb)

    Sum=argα+argb;

    Diff=argα-argb;

   endfunction


   function [Sum, Δ] = AddSubs(arga, argb)

    Sum=arga+argb;

    Diff=arga-argb;

   endfunction

Can anyone reproduce the issue?

Cheers,

Antoine


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] ipcv vs scicv

2020-12-03 Thread Antoine Monmayrant


On 03/12/2020 02:10, TanCL wrote:

Hi, my previous message seems like not able to get posted due to some reason,
just to add some comment on this, I think the functions with same name under
2 different modules could be possibly called by:


That is exactly how things are working in Ada:

   myfunc : local definition in the current file
   somepackage.myfunc : definition one can find in somepackage that is
   included in the current file by "with somepackage;"

And one can rename the package with "package S renames somepackage" 
which allow writting "s.myfunc"

I assume it's similar in Python too.

Antoine


moduleA.myfunc

moduleB.myfunc


__

Start Toolbox A
Load macros

Start Toolbox B
Load macros


--> toolboxAlib.scilab_sum(2,1)

   "This is function from ToolboxA"
  ans  =

3.

--> toolboxBlib.scilab_sum(2,1)

   "This is function from ToolboxB"
  ans  =

3.





--
Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Headless graphics in scilab: time & memory issues

2020-12-03 Thread Antoine Monmayrant

Hello again,

Just to add to my previous message: increasing nx or ny in my script can 
crash scilab during the call to xend().

On my small local machine, this occurs for:

   nx=4000;
   ny=3000;

for which scilab takes ~7 seconds to create the png in "normal" mode...

Can any of you confirm this bug?

Antoine

On 03/12/2020 09:48, Antoine Monmayrant wrote:


Hello all,

In these days of remote working, I need to use again scilab in 
headless mode to generate graphics.


In other words, I connect  in command line only to a remote server 
where scilab is installed and I want it to generate graphics using a 
combination of driver, xinit and xend.


There seems to be some issues with driver/xinit/xend: huge memory 
overhead and long computation time that makes it impossible to 
generate some plots in headless mode.


For example, a simple Sgrayplot that takes ~1 second to plot and save 
to a png in normal mode takes more than 200 seconds and huge amount of 
ram in headless mode (see attached test script).


I also have some plots that works without a problem in normal mode, 
but fail in headless mode because of some memory limitation:


xend: An error occurred: Unable to create export file, not enough
memory. Decreasing the number of elements or the size of the
figure should fix this error.

Is there a way to get around these problems?

Thanks for your help,

Antoine







___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] Headless graphics in scilab: time & memory issues

2020-12-03 Thread Antoine Monmayrant

Hello all,

In these days of remote working, I need to use again scilab in headless 
mode to generate graphics.


In other words, I connect  in command line only to a remote server where 
scilab is installed and I want it to generate graphics using a 
combination of driver, xinit and xend.


There seems to be some issues with driver/xinit/xend: huge memory 
overhead and long computation time that makes it impossible to generate 
some plots in headless mode.


For example, a simple Sgrayplot that takes ~1 second to plot and save to 
a png in normal mode takes more than 200 seconds and huge amount of ram 
in headless mode (see attached test script).


I also have some plots that works without a problem in normal mode, but 
fail in headless mode because of some memory limitation:


   xend: An error occurred: Unable to create export file, not enough
   memory. Decreasing the number of elements or the size of the figure
   should fix this error.

Is there a way to get around these problems?

Thanks for your help,

Antoine








xend_test.sce
Description: application/scilab-sce
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] pathsep() returns ':' under linux ?

2020-11-27 Thread Antoine Monmayrant

Thank you all, I mixed up filesep() & pathsep().

Antoine


On 27/11/2020 09:58, Stéphane Mottelet wrote:
It’s the char to separate paths in the PATH environment variable. 
Different from filesep().


S.

Le 27 nov. 2020 à 09:55, Antoine Monmayrant 
 a écrit :




Hello all,

I just found this today, on a linux machine (scilab 6.1.0 ubuntu 
18.04 LTS):


--> pathsep()
 ans  =

  ":"

it definitely sounds like a bug to me, no?

As anyone else experience some issues with pathsep ?

Cheers,

Antoine

___
users mailing list
users@lists.scilab.org
https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] pathsep() returns ':' under linux ?

2020-11-27 Thread Antoine Monmayrant

Hello all,

I just found this today, on a linux machine (scilab 6.1.0 ubuntu 18.04 LTS):

   --> pathsep()
 ans  =

  ":"

it definitely sounds like a bug to me, no?

As anyone else experience some issues with pathsep ?

Cheers,

Antoine

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] callback delay

2020-10-18 Thread Antoine Monmayrant


On 18/10/2020 10:43, Stefan Du Rietz wrote:

Hello Antoine,

thank you very much for your replies, especially your hint about Java. 
The problem is that my GUI is rather complex with several levels and 
the delay is not always happening. However, when it does, it is 
extremely annoying!  It never happened in Scilab 6.0.2.


OK, that's a thing you can try: can you test 6.1.0 & 6.0.2 on the same 
computer, with everything else being identical but for the version of 
scilab?


Antoine



I will try to analyze the issue deeper according to your propositions, 
and if I manage to isolate it, I will provide an example.


Stefan


On 2020-10-18 10:10, Antoine Monmayrant wrote:
Even If you cannot measure the issue, if you have a minimum working 
example that triggers this bug, it would be helpful to share it with 
us so we can try to reproduce the issue and maybe link it to some 
version of java or your os.


By the way, did you try to take another computer and do a vanilla 
install of scilab and try to reproduce the issue?
Maybe trying different os/java jdk might give some hint at the source 
for this bug...


Antoine

On 17/10/2020 21:00, Stefan Du Rietz wrote:

Hello Stephane and Antoine,

I tried to explain why I cannot. After I have pressed the button 
with the callback, I can see that it takes a long time until the 
toc() message from the start of myfunction arrives. I don't know how 
to get the time from my button-press. Any idea?


Stefan



On 2020-10-17 17:10, Stéphane Mottelet wrote:

Hello Stefan,

Do you have a complete example using e.g. an uicontrol or else ?

S.


Le 17 oct. 2020 à 16:49, Stefan Du Rietz  a écrit :

Hello,

in the latest version Scilab 6.1.0, I have noticed that sometimes 
there is a long delay before the execution of a callback, If I try 
to measure it, e.g. by using tic()


  "callback","tic();myfunction()"

and then, in the beginning of myfunction(), having

  disp(toc())

the time is very short despite a delay of half a minute! Can 
anybody explain this and tell me how to find out what is going on?


Thanks in advance
Stefan
___
users mailing list
users@lists.scilab.org
https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users 



___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] callback delay

2020-10-18 Thread Antoine Monmayrant
Even If you cannot measure the issue, if you have a minimum working 
example that triggers this bug, it would be helpful to share it with us 
so we can try to reproduce the issue and maybe link it to some version 
of java or your os.


By the way, did you try to take another computer and do a vanilla 
install of scilab and try to reproduce the issue?
Maybe trying different os/java jdk might give some hint at the source 
for this bug...


Antoine

On 17/10/2020 21:00, Stefan Du Rietz wrote:

Hello Stephane and Antoine,

I tried to explain why I cannot. After I have pressed the button with 
the callback, I can see that it takes a long time until the toc() 
message from the start of myfunction arrives. I don't know how to get 
the time from my button-press. Any idea?


Stefan



On 2020-10-17 17:10, Stéphane Mottelet wrote:

Hello Stefan,

Do you have a complete example using e.g. an uicontrol or else ?

S.


Le 17 oct. 2020 à 16:49, Stefan Du Rietz  a écrit :

Hello,

in the latest version Scilab 6.1.0, I have noticed that sometimes 
there is a long delay before the execution of a callback, If I try 
to measure it, e.g. by using tic()


  "callback","tic();myfunction()"

and then, in the beginning of myfunction(), having

  disp(toc())

the time is very short despite a delay of half a minute! Can anybody 
explain this and tell me how to find out what is going on?


Thanks i advance
Stefan
___
users mailing list
users@lists.scilab.org
https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users 



___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] callback delay

2020-10-18 Thread Antoine Monmayrant


On 17/10/2020 21:00, Stefan Du Rietz wrote:

Hello Stephane and Antoine,

I tried to explain why I cannot. After I have pressed the button with 
the callback, I can see that it takes a long time until the toc() 
message from the start of myfunction arrives. I don't know how to get 
the time from my button-press. Any idea?

No, I'm afraid it goes beyond my field of expertise.
It seems to me that the issue is that java is taking for ever to tell 
scilab to call the callback function after you pressed the button.
I don't see how you can catch it using "callback","tic();myfunction()"as 
for me I think the time-line is like:


[Java] ButtonHasBeenReleased ... wait forever for unknown reason ... oh, 
by the way, I'm supposed to register that the ButtonHasBeenReleased 
[Java] > [Scilab] ButtonHasBeenReleased, I call  "tic();myfunction()" 
[Scilab].


I think you need a way to measure this delay for within Java. I am not 
sure you can do it from within Scilab.


Sorry I cannot help more,

Antoine



Stefan



On 2020-10-17 17:10, Stéphane Mottelet wrote:

Hello Stefan,

Do you have a complete example using e.g. an uicontrol or else ?

S.


Le 17 oct. 2020 à 16:49, Stefan Du Rietz  a écrit :

Hello,

in the latest version Scilab 6.1.0, I have noticed that sometimes 
there is a long delay before the execution of a callback, If I try 
to measure it, e.g. by using tic()


  "callback","tic();myfunction()"

and then, in the beginning of myfunction(), having

  disp(toc())

the time is very short despite a delay of half a minute! Can anybody 
explain this and tell me how to find out what is going on?


Thanks i advance
Stefan
___
users mailing list
users@lists.scilab.org
https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users 



___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] How to zoom in correctly

2020-10-07 Thread Antoine Monmayrant


Le 07/10/2020 à 04:24, jaipur a écrit :

Hello,

Following your suggestion, gce().clip_state = 'off' could succeed zoom in.

While I continue to zoom in to watch the detail of a hill top, the top is
clipped by another something.
Could someone teach me the cause of this clipping and how to avoid it?




Hello,

It seems that you are zooming in both x,y and z.
The clipping you see for the hill (and similarly for the valley in the 
upper left corner is likely due to your curve going beyond the zoomed z 
axis.


Zooming in 3D on a 2D screen is not that straight forward.
As a text-based alternative, you can try to set gca().data_bounds by hand.

Antoine




--
Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] {EXT} Fwd: plotting dots vs xfarc

2020-10-01 Thread Antoine Monmayrant


On 01/10/2020 09:05, Dang Ngoc Chan, Christophe wrote:

Hello,


De la part de P M
Envoyé : mercredi 30 septembre 2020 16:50

exact dot-coordinates, drawn as filled circles.
All pixel coordinates of such an area would have to have exactly one single 
pixel value.
The resulting graphic right now is stored via:  xs2bmp.
[...]
- It seems that the resulting pixels of the dot in the final image are not 
equally colored.

I suspect the following thing: pixels are squares, not dots.

So it may be that xs2bmp somehow inter-/extrapolate the colours.
You then have a "leak" between the coloured pixel and its neighbours.

You may try to draw squares of the exact size of the final pixel (e.g. 1/320 
width and 1/200 height of the graphical window for a 320 × 200 raster picture).

You may also try some functions from the image processing toolboxes.

Well, another approach would be to:
- use Matplot to display your image as a matrix, let's say [0:255] range.
- modify the data in the matrix to be displayed where you went to get 
your "dot": like your change your data to 256
- use a colormap that is grayscale from [0:255] and has a fancy color 
for 256 (blue?).


If you do this, you should get a perfect co-registration of your image 
and your "overlayed" markers.
Of course, your markers will not be circular dots, just a single pixel 
with what I described above, but you can also generate your own shapes 
(bigger squares, crosses, ~circles), provided that you use an odd number 
of pixels.


Hope it helps,

Antoine



Hope this helps

Regards

--
Christophe Dang Ngoc Chan
cd...@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.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] xsave or save

2020-09-28 Thread Antoine Monmayrant

Hello all,

Just wondering what is the normal way to save graphics nowadays.
I just had a look at 'help xsave' to see whether it is deprecated or 
whether this is the official way to do it.

This page reads:

"For graphics xsave(file_name,win_num) use preferably 
save(file_name,scf(win_num))."


Hmm, I don't get it.
Does it mean that I should better use "save(file_name,scf(win_num))" for 
graphics objects?

If it's the case, what is the point of xsave?

I'm a bit lost...

Antoine

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] scilab -f file : can it uses an existing instance of scilab?

2020-09-28 Thread Antoine Monmayrant

Hello all,

During teaching, I usually run a bunch of scilab demos using "scilab -f 
demofile1", "scilab -f demofile2", etc ...

Sadly, every call to "scilab -f file" opens a new instance of scilab.
Is this possible to reuse an existing instance of scilab?
Or even better: reuse an instance of scilab or open scilab if none exists?

Cheers,

Antoine

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] plot(x,y,':') & dotted line : is this a bug?

2020-09-14 Thread Antoine Monmayrant


On 15/09/2020 07:32, Samuel Gougeon wrote:

Le 14/09/2020 à 16:14, Antoine Monmayrant a écrit :

Hello all,

For some reason, I don't understand the output of:

    plot(rand(1:10),':')

This should be a 'dotted line', as explained on the page:
    https://help.scilab.org/docs/6.1.0/en_US/LineSpec.html

But I get a line_style==5 which is some kind of 1dash-2dots line.
Looking at what's on page:
https://help.scilab.org/docs/6.1.0/en_US/polyline_properties.html
I think it would make more sense to get line_style==7, 9 or 10, no?

I have the same behaviour with 5.5.2.
Do you think this is worth a bug report?



Please see http://bugzilla.scilab.org/16366
The bug was fixed on last April 16th, for 6.1.1


Thanks a lot Samuel.

Antoine



Samuel



___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] plot(x,y,':') & dotted line : is this a bug?

2020-09-14 Thread Antoine Monmayrant


Le 14/09/2020 à 16:23, Heinz Nabielek a écrit :


I get a perfect dotted line.



What?
I tested this under linux (ubuntu 18.04) & Windows10, with both 5.5.2 
and the 6.1 and I don't get a dotted line...


I attached the output of:

    scf();plot(1:10,':')



Antoine

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] plot(x,y,':') & dotted line : is this a bug?

2020-09-14 Thread Antoine Monmayrant

Hello all,

For some reason, I don't understand the output of:

    plot(rand(1:10),':')

This should be a 'dotted line', as explained on the page:
    https://help.scilab.org/docs/6.1.0/en_US/LineSpec.html

But I get a line_style==5 which is some kind of 1dash-2dots line.
Looking at what's on page:
https://help.scilab.org/docs/6.1.0/en_US/polyline_properties.html
I think it would make more sense to get line_style==7, 9 or 10, no?

I have the same behaviour with 5.5.2.
Do you think this is worth a bug report?

Antoine

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] {EXT} Re: Weird error with leastsq()

2020-08-27 Thread Antoine Monmayrant


On 27/08/2020 17:55, Dang Ngoc Chan, Christophe wrote:

Hello,


De : Antoine Monmayrant
Envoyé : jeudi 27 août 2020 17:25

   n=real(n);

Now it works.

Basic.
I thought about this and I know I tested some isreal(sellmeier(lambda)) stuff 
during the development but I did not thought it would happen during the 
regression process with some parameter values.


Well, been there, done that: if you think your function can only be fed 
cats and dogs, you can be sure that leastsq will send it giraffes and 
unicorns! :-)


Antoine



Thanks a lot.

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@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Weird error with leastsq()

2020-08-27 Thread Antoine Monmayrant

OK, forget my previous answer.

Use this:

function [n] = sellmeier(KL, lambda)
    K1 = KL(1); K2 = KL(2); K3 = KL(3);
    L1 = KL(4); L2 = KL(5); L3 = KL(6);
    lambdacarre = lambda.*lambda;
    foo1 = lambdacarre - L1;
    foo2 = lambdacarre - L2;
    foo3 = lambdacarre - L3;
    foo = 1./(foo1.*foo2.*foo3);
    n = sqrt(1 +...
    lambdacarre.*(K1*foo.*foo2.*foo3 + K2*foo.*foo1.*foo3 + 
K3*foo.*foo1.*foo2));

    n=real(n);
endfunction

Now it works.

Antoine

PS: Here is the issue: your sellmeier function should be bulletproof and 
gracefully return real values no matter what parameters you feed to it.


Le 27/08/2020 à 16:52, Dang Ngoc Chan, Christophe a écrit :

Hello all,

Let's talk about optics.
I have a glass, its refraction index n varies with the wavelength lamba.
I have a CSV file with the corresponding data (verre_HOQ.cvs attached), 52 
points.

I want to model this with the Sellmeier model
https://en.wikipedia.org/wiki/Sellmeier_equation
and use for this the attached script (regression_sellmeier.sce).

Mind to set the path at line 7 of the script if you want to run it.

My problem:
I can run piecewise regression,
i.e. it runs when I work with the points 1 to 25, 13 to 39, or 32 to 52;
e.g. at lines 11 and 12, it works when I use

// --

lambda = 1e-3*donnees(1:25, 1); // en µm

nexp = donnees(1:25, 2);

// --

but when I try to extend these ranges (and of course when I try to use all the 
points),
it fails with the following error:

5215700pt: Wrong type for output argument #1: Real scalar expected.

Can anyone tell me what goes on here?

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@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Weird error with leastsq()

2020-08-27 Thread Antoine Monmayrant

Hello,

I can tell you what happened: for some values of lambda and some values 
of K(4,5,6), your function is undefined and the leastsq goes kaboom!


It is never a good idea to fit a function that can become undefined for 
some parameters/xvalues.

Try to redefine the function you fit to avoid any undefined values.

Antoine

I was able to use the range [1:51], but not  [1:52].

Le 27/08/2020 à 16:52, Dang Ngoc Chan, Christophe a écrit :

Hello all,

Let's talk about optics.
I have a glass, its refraction index n varies with the wavelength lamba.
I have a CSV file with the corresponding data (verre_HOQ.cvs attached), 52 
points.

I want to model this with the Sellmeier model
https://en.wikipedia.org/wiki/Sellmeier_equation
and use for this the attached script (regression_sellmeier.sce).

Mind to set the path at line 7 of the script if you want to run it.

My problem:
I can run piecewise regression,
i.e. it runs when I work with the points 1 to 25, 13 to 39, or 32 to 52;
e.g. at lines 11 and 12, it works when I use

// --

lambda = 1e-3*donnees(1:25, 1); // en µm

nexp = donnees(1:25, 2);

// --

but when I try to extend these ranges (and of course when I try to use all the 
points),
it fails with the following error:

5215700pt: Wrong type for output argument #1: Real scalar expected.

Can anyone tell me what goes on here?

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@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] xload doesn't work with accented letters in file names on W10

2020-08-27 Thread Antoine Monmayrant

Hello Pierre,

Exactly like last time, its seems to be Windows10-specific as your 
script does work as expected under Linux.


Antoine

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Erroneous file name for the "scg" file with accented characters when using xsave instruction

2020-08-26 Thread Antoine Monmayrant

Hello,


It seems to be Windows specific as your script works as expected under 
linux:


ls /tmp/SCI_TMP_21007_Y24sfl/
Test ùùééêë.scg  Test ùùééêë.txt

Could this be some encoding issues?

Antoine

Le 26/08/2020 à 09:28, Perrichon a écrit :

Rep=TMPDIR
chdir(Rep)
Name=Rep + "\Test ùùééêë"
fd=mopen(Name + ".txt","w+")
mfprintf(fd,"Fichier %s + ".txt"\n",Name)
mclose(fd)
num=1
f=scf(num);
plot2d()
f.figure_name=Name
xsave(Name + ".scg",num)
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Question

2020-08-21 Thread Antoine Monmayrant


On 21/08/2020 09:38, perrichon.pie...@wanadoo.fr wrote:


Hello Federico

Enter « abort » on your keyboard


Or "resume", depending on what you want to do and how you arrived here.
Adding some "pause" inside some buggy function is the most basic way of 
debugging: the -1-> prompt gives access to all the local variables of 
your function at the "pause". You can then investigate what's wrong with 
them and either "abort" (forget what you where doing in the function) or 
"resume" (finish the execution of the function) to return to the usual 
prompt.


Hope it helps,

Antoine


Regards

*De :*users  *De la part de* Federico 
Miyara

*Envoyé :* vendredi 21 août 2020 03:58
*À :* Users mailing list for Scilab 
*Objet :* [Scilab-users] Question


Dear all,

After trying to kill a process (don't remember how, the process was a 
repetitve sound using sound(), now I know why) the prompt became


-1->

I couldn't find out what this means and how to get back to the normal 
prompt (other than closing the program).


Thanks.

Regards,

Federico Miyara





Libre de virus. www.avast.com 
 




___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] the linear least-squares fitting problem

2020-08-19 Thread Antoine Monmayrant

Hello Heinz,

Please see the attached tutorial¹ I wrote for the other physicists in my 
lab on how to use scilab to fit data with a model and calculate the 
confidence interval.
The reference paper mentioned in the comments is worth reading, it 
helped me a lot understanding how the confidence interval relates to the 
covariance matrix.


Hope it helps,

Antoine
¹I made a poor choice for the data/model to fit as sin(x) is not really 
nice (multiple parameters work equally well). I should have used a 
gaussian or lorentzian curve...


Le 01/08/2020 à 16:45, Heinz Nabielek a écrit :

Dear Scilabers,

for mathematicians, the linear least-squares fitting is a trivial 
problem, but as an experimental physicist I had problems finding the 
right correlations for predicting the Confidence Limits of the fitted 
functional relationship. For a trivial set of experimental data, I 
wrote a few lines of Scilab code and have 2 questions:


- is the computation of confidence limits correct?

- for large data sets and higher degree polynomials, can we make the 
computations more efficient and reliable?


Thanks in advance
Heinz
_
x=[0.1269868 0.135477 0.221034 0.45 0.8350086 0.9057919 0.9133759 
0.9688678]'; y=[0.0695843 0.0154644 0.0893982 0.5619441 1.3879476 
1.5639274 1.6570076 1.9061488]'; 
plot(x,y,'m.','markersize',14);xgrid(1,1,1); X=[ones(x) x x^2]; // 
matrix of independent vectors b=X\y; // parameters of linear LSFIT 
with a 2nd degree polynomial yh = X*b; //Fitted values yh to 
approximate measured y's e=y-yh; //Errors or residuals SSE=e'*e; //Sum 
of squared errors ybar=mean(y); R2=1-SSE/sum((y-ybar)^2); [m 
n]=size(X); MSE = SSE/(m-n-1); //Mean square error se=sqrt(MSE); 
C=MSE*inv(X'*X); seb=sqrt(diag(C)); CONF=.95; alpha=1-CONF; ta2 = 
cdft('T',m-n,1-alpha/2,alpha/2); //t-value for alpha/2 
xx=(0.1:.025:1)'; // cover the whole abscissa range in detail 
XX=[ones(xx) xx xx^2]; yhh=XX*b; // predicted extended LSFIT curve 
plot(xx,yhh,'kd-','MarkerSize',8); [mm n]=size(XX); sY = []; sYp = []; 
//Terms involved in Confidence Interval for Y, Ypred for i=1:mm; sY = 
[sY; sqrt(XX(i,:)*C*XX(i,:)')]; // standard error in fit sYp = [sYp; 
se*sqrt(1+XX(i,:)*(C/se)*XX(i,:)')]; // standard error in spread in 
population distribution end; plot(xx, yhh+ta2*sYp,'rd-'); plot(xx, 
yhh+ta2*sY,'bd-'); plot(xx, yhh-ta2*sY,'gd-'); plot(xx, 
yhh-ta2*sYp,'md-'); title('LINEAR LEAST-SQUARES FIT WITH 95% 
CONFIDENCE BOUNDS ON FIT AND ON THE POPULATION SPREAD','fontsize',2); 
xlabel('x-values','fontsize',5); ylabel('y-values','fontsize',5); 
legend('measurement data','LSFIT of 2nd order polynomial','upper 95% 
CL population','upper 95% CL fit','lower 95% CL fit','lower 95% CL 
population',2);







___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


tuto_fit.sce
Description: application/scilab-sce
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] calendar does not work

2020-08-19 Thread Antoine Monmayrant

Hello,

It works as expected here (6.1.0 under linux).
Is this an encoding issue?
It looks like all the spaces are replaced by Âs...

Antoine

Le 19/08/2020 à 00:10, Heinz Nabielek a écrit :

--> calendar
  
  AugÂ2020

  MonÂÂTueÂÂWedÂÂThuÂÂFriÂÂSatÂÂSun
  ÂÂ12
  Â3456789
  10ÂÂÂ11ÂÂÂ12ÂÂÂ13ÂÂÂ14ÂÂÂ15ÂÂÂ16
  17ÂÂÂ18ÂÂÂ19ÂÂÂ20ÂÂÂ21ÂÂÂ22ÂÂÂ23
  24ÂÂÂ25ÂÂÂ26ÂÂÂ27ÂÂÂ28ÂÂÂ29ÂÂÂ30
  31ÂÂ

What had happened? Scilab 6.1 under macOS Catalina 10.15.6

Heinz
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Request for suggestions with plotting.

2020-07-25 Thread Antoine Monmayrant

Hello Adrian,

Here is what I would do:

(1) use 'tag' property field of your curve together with findobj to get 
access to the plot to be updated, without passing the handle.
(2) instead of deleting the curve and recreating it, I would directly 
modify its content (data property) and then ask for a replot/rescale if 
needed.


You can have a look at the content of function 'replot()' for a typical 
example.
It get called when the user changes the top slider in the GUI or presses 
Re-run.
It is far from perfect, but it does something that might look like what 
you want.


Hope it helps,

Antoine

On 24/07/2020 19:11, Adrian Weeks wrote:


Hi All,

I wonder if anyone could suggest a solution to this problem?

I want to:

    Create a figure. This remains fixed.  This I 
can do.


    Create four axes within the 
figure.    These remain 
fixed.    This I can do.


    In each of the four axes plot two reference 
curves.   These remain fixed.    This I can do.


    Repeatedly call a function A

which calls an inner function B

which plots a curve in each of the four axes having deleted the ones 
it plotted on the previous call of A.   
This I can’t do.


The idea is that the figure, axes and reference curves remain in place 
while the temporary curves are repeatedly deleted and re-plotted to 
allow an ‘animation’ showing the progression of the curves.


I can’t see a way to pass and delete the handles to the polylines 
produced by plot2d / gce.  I’ve tried passing as parameters, using 
global variables, all to no avail.  The most common error is from 
‘delete’, complaining that “The handle is not valid”.


Many thanks in anticipation.

Adrian Weeks
Development Engineer, Hardware Engineering EMEA
Office: +44 (0)2920 528500 | Desk: +44 (0)2920 528523 | Fax: +44 
(0)2920 520178

awe...@hidglobal.com 

HID Global Logo 

Unit 3, Cae Gwyrdd,
Green meadow Springs,
Cardiff, UK,
CF15 7AB.
www.hidglobal.com 


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


decay_rate_gui.sce
Description: application/scilab-sce
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] Fwd: Re: scilab and tif-files

2020-07-13 Thread Antoine Monmayrant

Houps,

I mailed Philipp directly, so here is a copy of my answer and available 
script to read a subset of TIFF.

It might be useful for some of you...

Antoine



 Forwarded Message 
Subject:Re: [Scilab-users] scilab and tif-files
Date:   Sun, 12 Jul 2020 20:39:20 +0200
From:   Antoine Monmayrant 
To: P M 



Hello Philipp,

I played a bit with tiff format a while ago (as none of the image 
processing toolboxes could be installed on my work computers).
The long story short: one of our microscope is storing data in a format 
(*.ols) that is just tiff file with some metadata.
I hacked a bit of the tiff specification to only support the subset of 
tiff used by this microscope.
So it might not be exactly what you need, it depends on the tiff files 
you are using.

But maybe it can help you design your own homemade solution.

Cheers,

Antoine

On 10/07/2020 11:52, P M wrote:

Dear experts,

I do have a tif-filein fact: lot's of them and of different size.

Pixel values are:
- red
- green
- white
- black

Now, I want to convert these files in Black/white images, such as:

- red pixels --> black
- green pixels --> white
- black pixels --> black
- white pixels --> black

in other words:    Only the green pixels are of interest.

Now, as I use IPCV:

- imread()...does not handle tif-files correctly
--> it does read the files, but the output is a 
boolean-matrix..that doesn't help


- tifread()...does only handle images with size 1024x1024 ... doesn't help

Is there a way to read TIF-files into Scilab and keep the R-G-B-channels?


Thank you,
Philipp





___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


readOLS.sci
Description: application/scilab-sci


testOLS_TIFF_scilabusers.sce
Description: application/scilab-sce
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] ?==?utf-8?q? scilab 6.1 crashes when trying to load big matfile (loadmatfile)

2020-06-19 Thread Antoine Monmayrant
Le Vendredi, Juin 19, 2020 15:59 CEST, Rafael Guerra 
 a écrit: 
 
> Script runs fine on Win10, Scilab 6.1, 64 GB RAM.
> But btw, the file a28.mat seems to have only 342MB.

I suspect that it does work fine with 64GB of ram: that's how I managed to work 
around my initial problem.
This script should be adapted to your available ram: you should try to increase 
n.
But in your case, I think you have enough ram to reach scilab maximum variable 
size (is it something like 2^31-1 maximum elements?) before triggering this bug.
Ideally, this should be tested on a ram-limited hardware (~8GB).
The issue is that there might be some malloc() somewhere that fails, while the 
code tries to use the memory without checking whether the malloc() was 
successful or not.
If you have gazillion's of GB of available ram, you never face this problem.

Antoine

> 
> 
> -Original Message-
> From: users  On Behalf Of Stéphane Mottelet
> Sent: Friday, June 19, 2020 10:15 AM
> To: users@lists.scilab.org
> Subject: Re: [Scilab-users] scilab 6.1 crashes when trying to load big 
> matfile (loadmatfile)
> 
> it's the loadmatfile that crashes (here on Scilab-branch-6.1 under OSX, 
> with 16Gb ram)
> 
>    "savematfile('a28.mat','a28');"
> scilab-cli-bin(3310,0x115f1f5c0) malloc: can't allocate region
> *** mach_vm_map(size=18446744071562067968) failed (error code=3)
> scilab-cli-bin(3310,0x115f1f5c0) malloc: *** set a breakpoint in 
> malloc_error_break to debug
> 
> Same crash with Scilab-branch-6.1 under Ubuntu 18.04, with 128Gb ram:
> 
>    "a28=[1:2^28];"
> ATTENTION : Option -v7 ajoutée.
> 
>    "savematfile('a28.mat','a28');"
> Segmentation fault (core dumped)
> 
> S.
> 
> Le 19/06/2020 à 08:57, Antoine Monmayrant a écrit :
> > Hello all,
> >
> >
> > Here is a small script that systematically crashes scilab on my machine:
> >
> >
> > 
> >
> > // on my machine with 8Gb or ram and usual workload, n=28 crashes scilab
> > n=[24,26,28];
> >
> > for i=n
> >
> >     disp(' '+string(i)+' ');
> >     execstr('a'+string(i)+'=[1:2^'+string(i)+'];')
> >     disp('a'+string(i)+'=[1:2^'+string(i)+'];')
> > execstr("savematfile(''a"+string(i)+".mat'',''a"+string(i)+"'');")
> > disp("savematfile(''a"+string(i)+".mat'',''a"+string(i)+"'');")
> >     execstr("loadmatfile(''a"+string(i)+".mat'');")
> >     disp("loadmatfile(''a"+string(i)+".mat'');")
> >     disp(' OK ');
> >
> > end
> >
> 
> ___
> users mailing list
> users@lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] ?==?utf-8?q? Plotting a New Xpoly Directly Inside a Compound

2020-06-19 Thread Antoine Monmayrant
> Again, it is not clear why you just do not fuse all data together into one
> matrix and use plot2d() to plot all data at once.

>From my own experience, this might be the case when you want to track the 
>progression of a lengthy calculation: you periodically add the new data on top 
>of the previous results. This is also the case when you work with experimental 
>data that arrives slowly, by successive batches: you receiver a batch of let's 
>say ~10 curves every couple of minutes for example.

Antoine

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] scilab 6.1 crashes when trying to load big matfile (loadmatfile)

2020-06-19 Thread Antoine Monmayrant

Hello all,


Here is a small script that systematically crashes scilab on my machine:




// on my machine with 8Gb or ram and usual workload, n=28 crashes scilab
n=[24,26,28];

for i=n

    disp(' '+string(i)+' ');
    execstr('a'+string(i)+'=[1:2^'+string(i)+'];')
    disp('a'+string(i)+'=[1:2^'+string(i)+'];')
execstr("savematfile(''a"+string(i)+".mat'',''a"+string(i)+"'');")
disp("savematfile(''a"+string(i)+".mat'',''a"+string(i)+"'');")
    execstr("loadmatfile(''a"+string(i)+".mat'');")
    disp("loadmatfile(''a"+string(i)+".mat'');")
    disp(' OK ');

end



You'll have to adapt the maximum value for n depending on your available 
ram.


Antoine


On 18/06/2020 13:06, Stéphane Mottelet wrote:

Hello Antoine,

I made a 4Gb file with Matlab:

>> a=rand(645,645,645);
>> b=rand(645,645,645);
>> c={a,b};
>> save("c.mat","-7.3","c")

and managed to load it successfully in Scilab:

--> loadmatfile("c.mat");

--> c
 c  =

  [645x645x645 constant]  [645x645x645 constant]

Maybe the structure I tried is too simple (just two hypermatrices in a 
cell) so please give us a representative failing example.


S.

Le 17/06/2020 à 13:22, Antoine Monmayrant a écrit :

Hello All,

I cannot open large matfile in scilab (~3.4Gb).
Scilab is always dying with an error message that is extremely 
instructive: "Killed".


It's a bit cumbersome to share this big fie, so do you have any idea 
on how to investigate this issue and try to locate the root cause?


As a side note, it might be a problem related to either the size of 
the variables or their nature: cells containing hypermatrices.
The file itself is not corrupted (I managed to open it in matlab and 
to save each hypermatrix into individual files that got imported in 
scilab with no problem.


Cheers,

Antoine

___
users mailing list
users@lists.scilab.org
https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users 




___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] scilab 6.1 crashes when trying to load big matfile (loadmatfile)

2020-06-17 Thread Antoine Monmayrant


On 17/06/2020 13:51, Stéphane Mottelet wrote:

Hello Antoine,

Did you to save a single "hypermatrix in a cell" in matlab and then 
load in Scilab ?

No, just the hypermatrix, not a cell containing only one hypermatrix.


S.

Le 17/06/2020 à 13:22, Antoine Monmayrant a écrit :

Hello All,

I cannot open large matfile in scilab (~3.4Gb).
Scilab is always dying with an error message that is extremely 
instructive: "Killed".


It's a bit cumbersome to share this big fie, so do you have any idea 
on how to investigate this issue and try to locate the root cause?


As a side note, it might be a problem related to either the size of 
the variables or their nature: cells containing hypermatrices.
The file itself is not corrupted (I managed to open it in matlab and 
to save each hypermatrix into individual files that got imported in 
scilab with no problem.


Cheers,

Antoine

___
users mailing list
users@lists.scilab.org
https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users 




___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] scilab 6.1 crashes when trying to load big matfile (loadmatfile)

2020-06-17 Thread Antoine Monmayrant

Hello All,

I cannot open large matfile in scilab (~3.4Gb).
Scilab is always dying with an error message that is extremely 
instructive: "Killed".


It's a bit cumbersome to share this big fie, so do you have any idea on 
how to investigate this issue and try to locate the root cause?


As a side note, it might be a problem related to either the size of the 
variables or their nature: cells containing hypermatrices.
The file itself is not corrupted (I managed to open it in matlab and to 
save each hypermatrix into individual files that got imported in scilab 
with no problem.


Cheers,

Antoine

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Pong contest

2020-06-05 Thread Antoine Monmayrant


On 05/06/2020 14:48, Stéphane Mottelet wrote:

Hello all,

As you may have noticed, there is now a little game in the 
Gaphics/Animation section of the demonstrations. As the speed and 
responsiveness seems to be similar under all platforms, it would be 
funny to launch a little contest. In the next Scilab version it would 
be interesting to implement a high score online record, but until 
then, you can answer this message with the same kind of screenshot I 
joined, showing you score and just taken after the game end with and 
with the last dialog on the figure.


Cheers,


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] exporting Matplot RGB image to vector formats : BUG ?

2020-05-28 Thread Antoine Monmayrant

OK, just tested on my real plot: it does work!
Samuel: how did you come up with this fix?

Antoine

On 28/05/2020 00:37, Samuel Gougeon wrote:

Hello Antoine,

Just add
gce().image_type = "rgba";

immediately after the Matplot() instruction, without adding a fourth 
layer to gce().data.

This makes the three .svg .pdf and .ps conversions working.

Best regards.
Samuel

Le 27/05/2020 à 08:58, Antoine Monmayrant a écrit :


Hi all,


It seems there is a bug in the export of graphics to vector formats 
(svg, pdf, ps): it fails for elements in your graphic windows that 
were generated using Matplot on an RGB hypermatrix:




img(:,:,1)=[ 1 0 0 ; 0 1 0 ; 0 0 1]*255;
img(:,:,2)=[ 0 0 1 ; 0 1 0 ; 1 0 0]*255;
img(:,:,3)=[ 0 1 0 ; 0 1 0 ; 0 1 0]*255;

h=scf();
Matplot(img);

xs2png(h,"img.png"); // correct
xs2svg(h,"img.svg"); // wrong
xs2pdf(h,"img.pdf"); // wrong again
xs2ps(h,"img.ps"); // wrong again






___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] exporting Matplot RGB image to vector formats : BUG ?

2020-05-28 Thread Antoine Monmayrant

Yep, I've just seen your message on bugzilla.
I confirm it solves the problem on my mwe.
I'll try to use it on maximum-nonworking-example today.

Thanks!

Antoine

On 28/05/2020 00:37, Samuel Gougeon wrote:

Hello Antoine,

Just add
gce().image_type = "rgba";

immediately after the Matplot() instruction, without adding a fourth 
layer to gce().data.

This makes the three .svg .pdf and .ps conversions working.

Best regards.
Samuel

Le 27/05/2020 à 08:58, Antoine Monmayrant a écrit :


Hi all,


It seems there is a bug in the export of graphics to vector formats 
(svg, pdf, ps): it fails for elements in your graphic windows that 
were generated using Matplot on an RGB hypermatrix:




img(:,:,1)=[ 1 0 0 ; 0 1 0 ; 0 0 1]*255;
img(:,:,2)=[ 0 0 1 ; 0 1 0 ; 1 0 0]*255;
img(:,:,3)=[ 0 1 0 ; 0 1 0 ; 0 1 0]*255;

h=scf();
Matplot(img);

xs2png(h,"img.png"); // correct
xs2svg(h,"img.svg"); // wrong
xs2pdf(h,"img.pdf"); // wrong again
xs2ps(h,"img.ps"); // wrong again






___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] exporting Matplot RGB image to vector formats : BUG ?

2020-05-27 Thread Antoine Monmayrant

Hi all,


It seems there is a bug in the export of graphics to vector formats 
(svg, pdf, ps): it fails for elements in your graphic windows that were 
generated using Matplot on an RGB hypermatrix:




img(:,:,1)=[ 1 0 0 ; 0 1 0 ; 0 0 1]*255;
img(:,:,2)=[ 0 0 1 ; 0 1 0 ; 1 0 0]*255;
img(:,:,3)=[ 0 1 0 ; 0 1 0 ; 0 1 0]*255;

h=scf();
Matplot(img);

xs2png(h,"img.png"); // correct
xs2svg(h,"img.svg"); // wrong
xs2pdf(h,"img.pdf"); // wrong again
xs2ps(h,"img.ps"); // wrong again



I've reported it: http://bugzilla.scilab.org/show_bug.cgi?id=16447

Do any of you know a workaround to avoid this bug?
On more complex RGB images then the small example above, the RGB image 
is not rendered at all (just white emptiness)...
I really need to export to svg to produce publication quality graphics 
and I have a bunch of bitmap+line plots on top of them...


Thanks for you help,


Antoine

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] h5mv / h5flush

2020-05-24 Thread Antoine Monmayrant


On 24/05/2020 15:28, paul francedixhuit wrote:

Thanks Antoine for answering

The datasets work fine.

yes I'm under a loop in order to automate datasets moving/renaing; if 
I use "h5mv" for a single dataset (whatever it is) that's ok. As said 
previously, the issue occurs immediately after using the first "h5mv" 
without closing the file.

OK. I am not sure I understand the issue than.
Is the first call to h5mv OK, then the second one failling?
If it is, did you try h5copen/h5mv/h5close before the next call to h5mv ?

Do you have a minimum working example with an hdf5 file you could share 
with us?




I'm under Linux (Ubuntu); I've ever tested h5copy but it failed as well.

I'll test your suggestion in using hdf5 package outside Scilab or 
through "unix_g" ino Scilab
There is also the python api for hdf5 that is really nice and not really 
difficult to use if you are already familiar with the scilab one.
You could try from python to assess whether you are trying to do 
something inherently wrong or whether it's a bug in scilab.


Paul



Le dim. 24 mai 2020 à 14:38, Antoine Monmayrant 
mailto:antoine.monmayr...@laas.fr>> a écrit :


Hello Paul,


This is not a solution, but just tests to assert that the problem
does come from scilab and not from your datasets.

(1) Can you try to use command-line tool h5copy (that comes with
the hdf5-tools pacakge on a Debian/Ubuntu Linux distribution) to
do it outside of scilab?
If you succeed, that might be a bug in h5mv in scilab.
If you are under windows, there might be an equivalent tool, or
you can use WSL if under Windows10.

(2) I get that you are running this code inside some sort of loop,
right? Can you try to do it step-by-step on one of the file that
fails? By step-by-step I mean either Ctrl+E line by line in your
code or one command at a time in the console. This might help if
it's a race condition bug. I faced similar issues when
manipulating the graphic handle hierarchy within a loop.

Hope it helps,


Antoine

On 24/05/2020 12:22, paul francedixhuit wrote:

Hi all

I'm trying to reorganize my hdf5 file by moving/renaming dozens
of datasets, using mainly h5mv (loops are used to pass through
all  groups and datasets)

My code is typically, where:

  * Source = the path+name of the original dataset
  * Destination= the path + the new dataset name

h5flush(h5);  
h5mv(h5,  Source,  h5,  Destination);


Trouble I'm confront to:

  * It works only ounce and I do not understand why, even
flushing hdf5 object
  * I can note that after /h5mv/, /h5flush/ does not work anymore
  * hdf5 object becomes "invalide"

What am I doing wrong?

Thanks for any advice

Paul

___
users mailing list
users@lists.scilab.org  <mailto:users@lists.scilab.org>
http://lists.scilab.org/mailman/listinfo/users

___
users mailing list
users@lists.scilab.org <mailto:users@lists.scilab.org>
http://lists.scilab.org/mailman/listinfo/users


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] h5mv / h5flush

2020-05-24 Thread Antoine Monmayrant

Hello Paul,


This is not a solution, but just tests to assert that the problem does 
come from scilab and not from your datasets.


(1) Can you try to use command-line tool h5copy (that comes with the 
hdf5-tools pacakge on a Debian/Ubuntu Linux distribution) to do it 
outside of scilab?

If you succeed, that might be a bug in h5mv in scilab.
If you are under windows, there might be an equivalent tool, or you can 
use WSL if under Windows10.


(2) I get that you are running this code inside some sort of loop, 
right? Can you try to do it step-by-step on one of the file that fails? 
By step-by-step I mean either Ctrl+E line by line in your code or one 
command at a time in the console. This might help if it's a race 
condition bug. I faced similar issues when manipulating the graphic 
handle hierarchy within a loop.


Hope it helps,


Antoine

On 24/05/2020 12:22, paul francedixhuit wrote:

Hi all

I'm trying to reorganize my hdf5 file by moving/renaming dozens of 
datasets, using mainly h5mv (loops are used to pass through all  
groups and datasets)


My code is typically, where:

  * Source = the path+name of the original dataset
  * Destination= the path + the new dataset name

h5flush(h5);  
h5mv(h5,  Source,  h5,  Destination);


Trouble I'm confront to:

  * It works only ounce and I do not understand why, even flushing
hdf5 object
  * I can note that after /h5mv/, /h5flush/ does not work anymore
  * hdf5 object becomes "invalide"

What am I doing wrong?

Thanks for any advice

Paul

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] unique instruction

2020-05-12 Thread Antoine Monmayrant

Hello Paul,

You want to keep "unique" values along the first column of M.
Here is how you can get this result:

//

M = [ 0 2; 0 6; 1 8;2 9]
firstCol=M(:,1);
[dum,ind]=unique(firstCol);
MuniqueFirstCol=M(ind,:);

//


Hope it helps,


Antoine


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] CsvRead function

2020-05-12 Thread Antoine Monmayrant


On 12/05/2020 10:20, Daniel Stringari wrote:

Good Morning,

The file exists ... Every time the code is run, it tries to create a 
series of files inside the address "C: \ Temp \ PGC \ ..." using the 
functions FULLFILE, CSVWRITE, CSVREAD and MDELETE to create and 
manipulate the data. This tool always worked in version 6.0.2 and when 
upgrading to version 6.1, it started to give an error with the code 
identical to the previous version, so my first suspicion was in 
relation to the mentioned functions.


OK, it's a bit weird.
Are you sure this file exists with the exact same name and 
capitalization (Windows file system should not car about capitalization, 
but just to be sure) ?

Can you give us the ouptut of "ls(Sai_Lot3v3)" ?

Can you:

(1) Provide us with a copy of the csv file Sai_Lot3v3 ?
(2) Generate a minimum working example that trigger this bug and share 
it with us?


This will help us helping you!

Cheers,

Antoine



On Mon, May 11, 2020 at 6:55 AM Stéphane Mottelet 
mailto:stephane.motte...@utc.fr>> wrote:


Hi

Le 11/05/2020 à 11:45, Daniel Stringari a écrit :
> Dear colleagues,
>
> I am using a code in the version of Scilab 6.1 that was made in
version
> Scilab 6.0.2. However, the same code that works in version
6.0.2, gives an
> error when executed in version 6.1. The function pointed on the
error screen
> is always 'csvRead'.
>
>


>
>


>
> any suggestion ?

Yes. Are you sure your file exists (considering the error message) ?

S.

>
>
>
> --
> Sent from:

https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
> ___
> users mailing list
> users@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@lists.scilab.org 
http://lists.scilab.org/mailman/listinfo/users


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] CsvRead function

2020-05-11 Thread Antoine Monmayrant

Hello Daniel,

It seems to me that the error is more the absence of the file 
"C:\Temp\PGC\Sai_Lot1v3.txt".


You can try to check just before line 206 whether the file is present or 
not:

ls("C:\Temp\PGC\Sai_Lot1v3.txt") or isfile("C:\Temp\PGC\Sai_Lot1v3.txt") .

Hope it helps,

Antoine


On 11/05/2020 11:45, Daniel Stringari wrote:

Dear colleagues,

I am using a code in the version of Scilab 6.1 that was made in version
Scilab 6.0.2. However, the same code that works in version 6.0.2, gives an
error when executed in version 6.1. The function pointed on the error screen
is always 'csvRead'.





any suggestion ?



--
Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Variables visibility in functions

2020-05-07 Thread Antoine Monmayrant

Hello,

I am not sure to understand what you want to achieve here.
It is not really clear for me.
You might be able to hack something using 'exists" but I am not sure 
that it would fit nicely with the way Scilab is designed...



Antoine


On 07/05/2020 14:01, kjubo wrote:

Dear all,

I would like to ask you, how can I disable visibility of variables from
workspace for functions.

I need to be sure, that function which I convert from script file, will not
use any variable, which is not in it input, or defined inside the function
itself.

Please see examples below.

Is this possible?
 
Thank you
 
BR
 
JK


 example 1:

 a = 3
 function fx = some_fun(x,a)
 fx = x+a
 endfunction

 calling some_fun(5) now return 3+5, but I need to be an error.


 example 2:

 a = 3
 function fx = some_fun(x)
 fx = x+a
 endfunction

 I need also error, as variable a should be passed as input argument
or defined inside some_fun body



--
Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Problem starting scilab on Ubuntu 18.04

2020-05-06 Thread Antoine Monmayrant

OK,


Stay tuned as what xristosp69 is describing is the same issue.
So all the workaround we will set up will apply to you.


Antoine

On 06/05/2020 12:09, Jeffrey Layton wrote:

Antoine,

I added the Scilab list back to the thread in case anyone else has 
this problem.


I agree with you. the Ubuntu packages do NOT work. I will try 
downloading from Scilab.org.


Thank you for your suggestion!

Jeff


On Wed, May 6, 2020 at 6:12 AM Antoine Monmayrant 
mailto:antoine.monmayr...@laas.fr>> wrote:


Hello Jeff,

It seems I have the same problem (see below).
I just don't use the version provided by apt-get and install
directly the one available on scilab.org <http://scilab.org> (6.1).
I assume this is a bug for the maintainer of the package for
ubuntu, no?
Does anyone know how to report it?

Antoine

 CRASH LOG 

/usr/bin/scilab
Picked up _JAVA_OPTIONS:

-Djava.class.path=/usr/share/java/flexdock.jar:/usr/share/java/skinlf.jar:/usr/share/java/looks.jar:/usr/share/java/commons-logging.jar:/usr/share/java/jhall.jar:/usr/share/java/lucene-core-4.10.4.jar:/usr/share/java/lucene-analyzers-common-4.10.4.jar:/usr/share/java/lucene-queryparser-4.10.4.jar:/usr/share/maven-repo/org/freehep/freehep-util/debian/freehep-util-debian.jar:/usr/share/maven-repo/org/freehep/freehep-io/debian/freehep-io-debian.jar:/usr/share/maven-repo/org/freehep/freehep-graphicsio/debian/freehep-graphicsio-debian.jar:/usr/share/java/freehep-graphicsio-emf-2.1.jar:/usr/share/java/freehep-graphics2d-2.1.1.jar:/usr/share/java/jrosetta-API.jar:/usr/share/java/jrosetta-engine-1.0.4.jar:/usr/share/java/jgraphx.jar:/usr/share/java/jogl2.jar:/usr/share/java/gluegen2-rt.jar:/usr/share/java/jeuclid-core.jar:/usr/share/java/jlatexmath-fop-1.0.7.jar:/usr/share/java/fop.jar:/usr/share/java/saxon.jar:/usr/share/java/batik.jar:/usr/share/java/xml-apis-ext.jar:/usr/share/java/commons-io.jar:/usr/share/java/xmlgraphics-commons.jar:/usr/share/java/avalon-framework.jar:/usr/share/java/jlatexmath-1.0.7.jar:/usr/share/java/ecj.jar:/usr/share/java/javax.activation.jar:/usr/share/java/jaxb-runtime.jar:/usr/share/scilab/modules/action_binding/jar/org.scilab.modules.action_binding.jar:/usr/share/scilab/modules/helptools/jar/scilab_ru_RU_help.jar:/usr/share/scilab/modules/helptools/jar/org.scilab.modules.helptools.jar:/usr/share/scilab/modules/helptools/jar/scilab_en_US_help.jar:/usr/share/scilab/modules/helptools/jar/scilab_images.jar:/usr/share/scilab/modules/types/jar/org.scilab.modules.types.jar:/usr/share/scilab/modules/graphic_objects/jar/org.scilab.modules.graphic_objects.jar:/usr/share/scilab/modules/xcos/jar/org.scilab.modules.xcos.jar:/usr/share/scilab/modules/jvm/jar/org.scilab.modules.jvm.jar:/usr/share/scilab/modules/ui_data/jar/org.scilab.modules.ui_data.jar:/usr/share/scilab/modules/javasci/jar/org.scilab.modules.javasci.jar:/usr/share/scilab/modules/renderer/jar/org.scilab.modules.renderer.jar:/usr/share/scilab/modules/history_browser/jar/org.scilab.modules.history_browser.jar:/usr/share/scilab/modules/external_objects_java/jar/org.scilab.modules.external_objects_java.jar:/usr/share/scilab/modules/scirenderer/jar/scirenderer.jar:/usr/share/scilab/modules/completion/jar/org.scilab.modules.completion.jar:/usr/share/scilab/modules/graph/jar/org.scilab.modules.graph.jar:/usr/share/scilab/modules/preferences/jar/org.scilab.modules.preferences.jar:/usr/share/scilab/modules/history_manager/jar/org.scilab.modules.history_manager.jar:/usr/share/scilab/modules/console/jar/org.scilab.modules.console.jar:/usr/share/scilab/modules/localization/jar/org.scilab.modules.localization.jar:/usr/share/scilab/modules/gui/jar/org.scilab.modules.gui.jar:/usr/share/scilab/modules/core/jar/org.scilab.modules.core.jar:/usr/share/scilab/modules/graphic_export/jar/org.scilab.modules.graphic_export.jar:/usr/share/scilab/modules/scinotes/jar/org.scilab.modules.scinotes.jar:/usr/share/scilab/modules/commons/jar/org.scilab.modules.commons.jar:
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by
org.scilab.modules.jvm.LibraryPath
(file:/usr/share/scilab/modules/jvm/jar/org.scilab.modules.jvm.jar)
to field java.lang.ClassLoader.sys_paths
WARNING: Please consider reporting this to the maintainers of
org.scilab.modules.jvm.LibraryPath
WARNING: Use --illegal-access=warn to enable warnings of further
illegal reflective access operations
WARNING: All illegal access operations will be denied in a future
release
Could not access to the Main Scilab Class:
Exception in thread "main" java.lang.ExceptionInInitializerError
    at
org.scilab.modules.localization.Messages.gettext(Unknown Source)
    at
org.scilab.modules.commons.xml.XConfiguration.(Unknown Source)
    at org.scilab.modules.core.Scilab.(Unknown Source)
Caused by: java.lang.NullPointerException
  

Re: [Scilab-users] Cant start Scilab on linux (pop_os) 20.04

2020-05-06 Thread Antoine Monmayrant

OK, I can confirm that the same bug is present in

ubuntu 18.04
ubuntu 20.04
pop_os 20.04


Antoine

On 06/05/2020 11:17, Antoine Monmayrant wrote:

Hello,

It seems to be the same issue than for ubuntu 18.04: the packaged 
version of scilab is just not working.
You should download the last version of scilab ( 
https://www.scilab.org/download/6.1.0/scilab-6.1.0.bin.linux-x86_64.tar.gz 
), untar it and launch it.


Hope it helps,

Antoine


On 06/05/2020 10:19, xristosp69 wrote:

Hello,
yesterday i downloaded scilab and 3 apps popped up, scilab, scilab 
advanced

and scilab cli.
Scilab cli opens a terminal but the other 2 do nothing, but when i type
"scilab" in a normal terminal i get this:
https://pastebin.com/VTVYbrmt
could anyone help me out with this?



--
Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Cant start Scilab on linux (pop_os) 20.04

2020-05-06 Thread Antoine Monmayrant

Hello,

It seems to be the same issue than for ubuntu 18.04: the packaged 
version of scilab is just not working.
You should download the last version of scilab ( 
https://www.scilab.org/download/6.1.0/scilab-6.1.0.bin.linux-x86_64.tar.gz 
), untar it and launch it.


Hope it helps,

Antoine


On 06/05/2020 10:19, xristosp69 wrote:

Hello,
yesterday i downloaded scilab and 3 apps popped up, scilab, scilab advanced
and scilab cli.
Scilab cli opens a terminal but the other 2 do nothing, but when i type
"scilab" in a normal terminal i get this:
https://pastebin.com/VTVYbrmt
could anyone help me out with this?



--
Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Really headless figure generation in scilab

2020-04-30 Thread Antoine Monmayrant
 available).





On 29/04/2020 15:18, Stéphane Mottelet wrote:

You should start Scilab this way:

SCI_DISABLE_TK=1 SCI_JAVA_ENABLE_HEADLESS=1 
_JAVA_OPTIONS='-Djava.awt.headless=true' bin/scilab-adv-cli


You will be able to use graphic commands (without visible output) and 
then export directy with e.g. xs2pdf.


S.

Le 29/04/2020 à 14:51, Antoine Monmayrant a écrit :

Hello All,

Here is a Covid19 & forced remote work issue.
One of my students has to run some of his simulations and generate 
png/svg figures on a linux workstation we don't have physical access 
to given the current lockdown.


The problem is that from his Windows laptop without X server, he 
cannot "ssh -YC" to the linux workstation but only "ssh -X".
He thus only have access to "-nogui" or "-nwni" modes were all the 
graphics macros are deactivate.


Any of you ever faced a similar situation and found a solution?

Thanks in advance,


Antoine

PS: it's a pity that scilab is not able to do real headless figure 
generation.


___
users mailing list
users@lists.scilab.org
https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users 





___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Really headless figure generation in scilab

2020-04-29 Thread Antoine Monmayrant


On 29/04/2020 15:18, Stéphane Mottelet wrote:


SCI_DISABLE_TK=1 SCI_JAVA_ENABLE_HEADLESS=1 
_JAVA_OPTIONS='-Djava.awt.headless=true' 



Thanks Stéphane for this dark magic!
It works.
Is this documented somewhere?


Antoine

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] Really headless figure generation in scilab

2020-04-29 Thread Antoine Monmayrant

Hello All,

Here is a Covid19 & forced remote work issue.
One of my students has to run some of his simulations and generate 
png/svg figures on a linux workstation we don't have physical access to 
given the current lockdown.


The problem is that from his Windows laptop without X server, he cannot 
"ssh -YC" to the linux workstation but only "ssh -X".
He thus only have access to "-nogui" or "-nwni" modes were all the 
graphics macros are deactivate.


Any of you ever faced a similar situation and found a solution?

Thanks in advance,


Antoine

PS: it's a pity that scilab is not able to do real headless figure 
generation.


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] [EXT] parsing TSV (or CSV) file with scilab is a nightmare

2020-04-27 Thread Antoine Monmayrant

Hello Adrian,


In essence, your extremely useful solution is similar to what Samuel and 
Jan proposed: grab the whole file once.
I must admit I did not even consider it given the length of the files 
involved and how easily I managed to crash scilab on small files.



Thanks,


Antoine

On 27/04/2020 18:58, Adrian Weeks wrote:


Hi Antoine,

I often have to read csv files with odd lines that trip functions like 
csvRead so I often use the method below.  It may solve your problem.


dataread = mgetl(readfile); // Read everything

a = [];

b = [];

…

for i = 1: size(dataread, 'r') do

line = dataread(i);

if length(line) ~= 0 
then // Ignore blank lines


line = tokens(line, [' ', ',', ascii(9)]);    // Accept 
spaces, commas or tabs


if and(isnum(line)) then    // If the line 
is all-numeric


line = strtod(line);

a = [a; line(1)];

b = [b; line(2)];

…

end

end

end

Adrian Weeks
Development Engineer, Hardware Engineering EMEA
Office: +44 (0)2920 528500 | Desk: +44 (0)2920 528523 | Fax: +44 
(0)2920 520178

awe...@hidglobal.com <mailto:awe...@hidglobal.com>

HID Global Logo <http://www.hidglobal.com/>

Unit 3, Cae Gwyrdd,
Green meadow Springs,
Cardiff, UK,
CF15 7AB.
www.hidglobal.com <http://www.hidglobal.com>

*From:*users  *On Behalf Of *Antoine 
Monmayrant

*Sent:* 27 April 2020 16:41
*To:* Users mailing list for Scilab 
*Subject:* [EXT] [Scilab-users] parsing TSV (or CSV) file with scilab 
is a nightmare


 Please use caution this is an externally originating email. *** ***

Hi all,

This is both a rant and desperate cry for help.
I'm trying to parse some TSV data (tab separated data file) with 
scilab and I cannot find a way to navigate around the minefield of 
bugs present in meof/mgetl/mgetstr/csvRead.


A bit of context: I need to load into scilab data generated by a 
closed source software.
The data is in the form of many TSV files (that I cannot share in 
full, just some redacted bits) with a header and a footer.
I don't want to hand modify these files or edit them in any way (I 
need to keep this as portable as possible, so no sed/awk/grep...)



OPTION 1: csvRead

That's the most intuitive solution, however, because of 
http://bugzilla.scilab.org/show_bug.cgi?id=16391 
<https://nam02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fbugzilla.scilab.org%2Fshow_bug.cgi%3Fid%3D16391=02%7C01%7Caweeks%40hidglobal.com%7C958a9bb7c76f40cef22108d7eac3d120%7Cf0bdc1c951484f86ac40edd976e1814c%7C0%7C0%7C637235999087304170=Myj7OkrpbGfSl3LD4QAoYzifF80drUrz6nPjP9H7xC8%3D=0> 
and the presence of more than 1 empty line in my header/footer, this 
crashes Scilab.



OPTION 2: hand parsing line by line using mgetl/meof

I tried:

filename="tsv.txt";
[fd, err] = mopen(filename, 'rt');
while ~meof(fd) do
    txtline=mgetl(fd,1);
end
mclose(fd)

Saddly, and contrary to what's written in "help mgetl", meof keeps on 
returning 0, well passed the end of the file and the while never ends!



OPTION 3: hand parsing chunk by chunk using mgetstr/meof

"help meof" does not confirm that meof should work with mgetl, but 
mgetstr is specifically listed.

I thus tried:

filename="tsv.txt";
[fd, err] = mopen(filename, 'rt');
while ~meof(fd) do
    txtchunk=mgetstr(80,fd);
end
mclose(fd)

But thanks to http://bugzilla.scilab.org/show_bug.cgi?id=16419 
<https://nam02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fbugzilla.scilab.org%2Fshow_bug.cgi%3Fid%3D16419=02%7C01%7Caweeks%40hidglobal.com%7C958a9bb7c76f40cef22108d7eac3d120%7Cf0bdc1c951484f86ac40edd976e1814c%7C0%7C0%7C637235999087304170=BOnmop38zy8wUtFRwrPSoVl9HTsJT6NcQAY23qPK8f8%3D=0> 
this is also crashing Scilab.



OPTION 4: Can anyone here help me with this?

I am really running out of ideas.
Did I miss some -hmm- obvious combination of available file parsing 
scilab functions to achieve my goal?
I have the feeling that it would have been faster for me to just learn 
a totally new language that does not suck at parsing files than trying 
to get it to work with scilab


Antoine

(depressed)

http://bugzilla.scilab.org/show_bug.cgi?id=16419 
<https://nam02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fbugzilla.scilab.org%2Fshow_bug.cgi%3Fid%3D16419=02%7C01%7Caweeks%40hidglobal.com%7C958a9bb7c76f40cef22108d7eac3d120%7Cf0bdc1c951484f86ac40edd976e1814c%7C0%7C0%7C637235999087314165=hrLO7KWziAoacs9ytFJzziqv89FCY46SUNdZEUgvKNQ%3D=0>



___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] parsing TSV (or CSV) file with scilab is a nightmare

2020-04-27 Thread Antoine Monmayrant

Hello David,


Thanks.
No I did not have a look at fscanfMat, as I had in mind to also import 
the header and footer.


Samuel and Jan also proposed to simply use "mgetl(fd)" to grab the whole 
file at once.
Their solution seems to work (or at least does not crash scilab on the 
first file I tested!).



Thank you all for your kind help,


Antoine



On 27/04/2020 18:06, CHEZE David 227480 wrote:


Hi Antoine,

did you also look at fscanfMat ? It's handy when  space or tab separators.

regards,

David


*De :* users [users-boun...@lists.scilab.org] de la part de Antoine 
Monmayrant [antoine.monmayr...@laas.fr]

*Envoyé :* lundi 27 avril 2020 17:40
*À :* Users mailing list for Scilab
*Objet :* [Scilab-users] parsing TSV (or CSV) file with scilab is a 
nightmare


Hi all,


This is both a rant and desperate cry for help.
I'm trying to parse some TSV data (tab separated data file) with 
scilab and I cannot find a way to navigate around the minefield of 
bugs present in meof/mgetl/mgetstr/csvRead.


A bit of context: I need to load into scilab data generated by a 
closed source software.
The data is in the form of many TSV files (that I cannot share in 
full, just some redacted bits) with a header and a footer.
I don't want to hand modify these files or edit them in any way (I 
need to keep this as portable as possible, so no sed/awk/grep...)



OPTION 1: csvRead

That's the most intuitive solution, however, because of 
http://bugzilla.scilab.org/show_bug.cgi?id=16391 and the presence of 
more than 1 empty line in my header/footer, this crashes Scilab.



OPTION 2: hand parsing line by line using mgetl/meof

I tried:

filename="tsv.txt";
[fd, err] = mopen(filename, 'rt');
while ~meof(fd) do
    txtline=mgetl(fd,1);
end
mclose(fd)

Saddly, and contrary to what's written in "help mgetl", meof keeps on 
returning 0, well passed the end of the file and the while never ends!



OPTION 3: hand parsing chunk by chunk using mgetstr/meof

"help meof" does not confirm that meof should work with mgetl, but 
mgetstr is specifically listed.

I thus tried:

filename="tsv.txt";
[fd, err] = mopen(filename, 'rt');
while ~meof(fd) do
    txtchunk=mgetstr(80,fd);
end
mclose(fd)

But thanks to http://bugzilla.scilab.org/show_bug.cgi?id=16419 this is 
also crashing Scilab.



OPTION 4: Can anyone here help me with this?

I am really running out of ideas.
Did I miss some -hmm- obvious combination of available file parsing 
scilab functions to achieve my goal?
I have the feeling that it would have been faster for me to just learn 
a totally new language that does not suck at parsing files than trying 
to get it to work with scilab



Antoine

(depressed)



http://bugzilla.scilab.org/show_bug.cgi?id=16419


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] parsing TSV (or CSV) file with scilab is a nightmare

2020-04-27 Thread Antoine Monmayrant

Hi all,


This is both a rant and desperate cry for help.
I'm trying to parse some TSV data (tab separated data file) with scilab 
and I cannot find a way to navigate around the minefield of bugs present 
in meof/mgetl/mgetstr/csvRead.


A bit of context: I need to load into scilab data generated by a closed 
source software.
The data is in the form of many TSV files (that I cannot share in full, 
just some redacted bits) with a header and a footer.
I don't want to hand modify these files or edit them in any way (I need 
to keep this as portable as possible, so no sed/awk/grep...)



   OPTION 1: csvRead

That's the most intuitive solution, however, because of 
http://bugzilla.scilab.org/show_bug.cgi?id=16391 and the presence of 
more than 1 empty line in my header/footer, this crashes Scilab.



   OPTION 2: hand parsing line by line using mgetl/meof

I tried:

filename="tsv.txt";
[fd, err] = mopen(filename, 'rt');
while ~meof(fd) do
    txtline=mgetl(fd,1);
end
mclose(fd)

Saddly, and contrary to what's written in "help mgetl", meof keeps on 
returning 0, well passed the end of the file and the while never ends!



   OPTION 3: hand parsing chunk by chunk using mgetstr/meof

"help meof" does not confirm that meof should work with mgetl, but 
mgetstr is specifically listed.

I thus tried:

filename="tsv.txt";
[fd, err] = mopen(filename, 'rt');
while ~meof(fd) do
    txtchunk=mgetstr(80,fd);
end
mclose(fd)

But thanks to http://bugzilla.scilab.org/show_bug.cgi?id=16419 this is 
also crashing Scilab.



   OPTION 4: Can anyone here help me with this?

I am really running out of ideas.
Did I miss some -hmm- obvious combination of available file parsing 
scilab functions to achieve my goal?
I have the feeling that it would have been faster for me to just learn a 
totally new language that does not suck at parsing files than trying to 
get it to work with scilab



Antoine

(depressed)



http://bugzilla.scilab.org/show_bug.cgi?id=16419

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] Scilab 6.1 does not work on the new Ubuntu LTS

2020-04-24 Thread Antoine Monmayrant
Hi all,

I'm testing the newly released LTS for Ubuntu (20.04) and scilab does not work 
out of the box.
I reported the bug here: https://bugzilla.scilab.org/show_bug.cgi?id=16418

Cheers,

Antoine

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] ?==?utf-8?q? ?==?utf-8?q? ?= Incorrect color in functio

2020-04-10 Thread Antoine Monmayrant
Yes, quite funny if we write it that way:


function a()
if %t then
what_ever_you_want_that_ends_with_end
end
endfunction

function b()
if %t then
or_that_ends_with_end()
end
endfunction 


Frederico, do you think you could fill a bug report?

Cheers,

Antoine 
 
Le Vendredi, Avril 10, 2020 16:17 CEST, Claus Futtrup  a 
écrit: 
 
> 
> HA HA :-D ... it's funny!
> 
> Cheers,
> Claus
> 
> On 10.04.2020 16:09, Antoine Monmayrant wrote:
> > OK, I think I nailed it:
> >
> > function a()
> >  if % then
> >  end()
> >  end
> > endfunction
> >
> > It's the "end()" in "legend()" that sends the parser off the trail: it 
> > thinks that the if block is over (as it has found "if", "then" & leg"end"() 
> > ) and then treats the next "end" as matching the "function"
> >
> > Antoine
> >   
> >   
> > Le Vendredi, Avril 10, 2020 15:28 CEST, Federico Miyara 
> >  a écrit:
> >   
> >> Dear all,
> >>
> >> When writing the following script in SciNotes (v. 6.1):
> >>
> >> function y = testcolor(t)
> >>       if 1==1
> >>       y = sinc(t)
> >>       plot(t, y)
> >>       legend("sinc")
> >>       else
> >>       y = 1
> >>       end
> >> endfunction
> >>
> >> the end of the if structure appears with the same brownish color as the
> >> endfunction. Strangely, if copying and pasting here or into a word
> >> processor document, the color is the expected purple (that's why I
> >> removed all colors in this message).
> >>
> >> It seems that the culprit is the legend clause.
> >>
> >> Regards,
> >>
> >> Federico Miyara
> >>
> >> ___
> >> users mailing list
> >> users@lists.scilab.org
> >> http://lists.scilab.org/mailman/listinfo/users
> >>
> > ___
> > users mailing list
> > users@lists.scilab.org
> > http://lists.scilab.org/mailman/listinfo/users
> 
> 
> 
> -- 
> This email has been checked for viruses by Avast antivirus software.
> https://www.avast.com/antivirus
> 
> ___
> users mailing list
> users@lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] ?==?utf-8?q? Incorrect color in function

2020-04-10 Thread Antoine Monmayrant
OK, I think I nailed it:

function a()
if % then
end()
end
endfunction

It's the "end()" in "legend()" that sends the parser off the trail: it thinks 
that the if block is over (as it has found "if", "then" & leg"end"() ) and then 
treats the next "end" as matching the "function"

Antoine 
 
 
Le Vendredi, Avril 10, 2020 15:28 CEST, Federico Miyara 
 a écrit: 
 
> 
> Dear all,
> 
> When writing the following script in SciNotes (v. 6.1):
> 
> function y = testcolor(t)
>      if 1==1
>      y = sinc(t)
>      plot(t, y)
>      legend("sinc")
>      else
>      y = 1
>      end
> endfunction
> 
> the end of the if structure appears with the same brownish color as the 
> endfunction. Strangely, if copying and pasting here or into a word 
> processor document, the color is the expected purple (that's why I 
> removed all colors in this message).
> 
> It seems that the culprit is the legend clause.
> 
> Regards,
> 
> Federico Miyara
> 
> ___
> users mailing list
> users@lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] ?==?utf-8?q? ?==?utf-8?q? ?= Error in parameters determined in non-linear least-squares fittin

2020-04-06 Thread Antoine Monmayrant
Hi all,

I would appreciate comments/corrections from you guys as I am far 
from a specialist in this field!
If some of you find this example useful, I can try to work a bit to improve it 
and push it as an atom module.
In fact, I have a bunch of other fit functions (like gaussian, diode-like 
curve, ...) that follow the same approach than the sinewave example  and I've 
long wanted to bundle them in a module where one can add a new fit function by 
providing the model, error, jacobian and estimate functions like in my 
example...

Antoine
 
 
Le Lundi, Avril 06, 2020 08:43 CEST, Claus Futtrup  a 
écrit: 
 
> Hi Scilabers
> 
> Good examples are worth a lot. Maybe this one could be part of the 
> Scilab documentation?
> 
> Best regards,
> Claus
> 
> On 06.04.2020 08:17, Antoine Monmayrant wrote:
> > Hello Heinz,
> >
> > See below the small example I built and I refer to whenever I need to do 
> > some data fitting with confidence intervals for the parameters of the model.
> > It is far from perfect but it might help you untangle the Jacobian and 
> > covariance matrix thingy.
> > Just two words of caution: (1) I am clearly less versed in applied maths 
> > than Stéphane or Samuel, so take this with a grain of salft; (2) I built 
> > this example ages ago, before Samuel improved datafit.
> >
> > Good luck
> >
> > Antoine
> >
> > //
> > // REFERENCE:
> > //
> > //Least Squares Estimation
> > //SARA A. VAN DE GEER
> > //Volume 2, pp. 1041–1045
> > //in
> > //Encyclopedia of Statistics in Behavioral Science
> > //ISBN-13: 978-0-470-86080-9
> > //ISBN-10: 0-470-86080-4
> > //Editors Brian S. Everitt & David C. Howell
> > //John Wiley & Sons, Ltd, Chichester, 2005
> > //
> >
> > //This is a short and definetly incomplete tutorial on data fitting in 
> > Scilab using leastsq.
> > //
> > // Basic assumption: this tutorial is for scientists that face this simple 
> > problem:
> > // they have an experimental dataset x_epx,y_exp and a certain model 
> > y=Model(x,p) to fit thie dataset.
> > //  This tutorial will try to answer the folowing questions:
> > //  1) how do you do that (simply)
> > //  2) how do you do that (more reliably and more quickly)
> > //  a) let's go faster with a Jacobian
> > //  b) how good is your fit? How big is the "error bar" associated with 
> > each parameter of your Model?
> > //  c) Can we bullet proof it?
> >
> > //1) How do you do curve fitting in Scilab
> > //
> > //  We need a) a model function b) a dataset c) some more work
> > //  1)a) Let's start with the model function: a sinewave
> > //  here is the formula: y=A*sin(k*(x-x0))+y0;
> > //  here is the function prototypr [y]=SineModel(x,p) with  
> > p=[x0,k,A,y0]'
> > function [y]=SineModel(x,p)
> > //INPUTS:   x 1D vector
> > //  p parameter vector of size [4,1] containing
> > //  x0  : sine origin
> > //  k   : sine spatial frequency ie k=2%pi/Xp with Xp the period
> > //  A   : sine amplitude
> > //  y0  : sine offset
> > //OUTPUTS:   y 1D vector of same size than x such that y=A*sin(k*(x-x0))+y0;
> >x0=p(1);
> >k=p(2);
> >A=p(3);
> >y0=p(4);
> >y=y0+A*sin((x-x0)*k);
> > endfunction
> >
> > //  1)b) Let's now have a fake dataset: a sine wave with some noise
> > //  We reuse the Model function we have just created to make this fake 
> > dataset
> >
> > x_exp=[-10:0.1:10]';
> > x0=1.55;
> > k=1*%pi/3;
> > A=4.3;
> > y0=1.1
> > y_exp=SineModel(x_exp,[x0,k,A,y0])+(2*rand(x_exp)-1)*6/10;
> >
> > //let's check and see what it looks like:
> > scf();
> > plot(x_exp,y_exp,'k.-');
> > xlabel('Exparimental X');
> > ylabel('Exparimental Y');
> > xtitle('Our fake experimental dataset to fit');
> >
> > //  1)c) we are not done yet, we need some more work
> > //  First we need an error function that return for a given parameter set 
> > param the difference
> > //  between the experimental dataset and the model one:
> > //  Note that this function returns the difference at each point, not the 
> > square of the difference,
> > //  nor the sum over each point of the square of the differences
> > function e = ErrorFitSine(param, x_exp, y_exp)
> > e = SineModel(x_exp,param)-y_exp;
> > endfunction
> >

Re: [Scilab-users] ?==?utf-8?q? Error in parameters determined in non-linear least-squares fitting

2020-04-06 Thread Antoine Monmayrant
Hello Heinz,

See below the small example I built and I refer to whenever I need to do some 
data fitting with confidence intervals for the parameters of the model.
It is far from perfect but it might help you untangle the Jacobian and 
covariance matrix thingy.
Just two words of caution: (1) I am clearly less versed in applied maths than 
Stéphane or Samuel, so take this with a grain of salft; (2) I built this 
example ages ago, before Samuel improved datafit.

Good luck

Antoine

//
// REFERENCE: 
//
//Least Squares Estimation
//SARA A. VAN DE GEER
//Volume 2, pp. 1041–1045
//in
//Encyclopedia of Statistics in Behavioral Science
//ISBN-13: 978-0-470-86080-9
//ISBN-10: 0-470-86080-4
//Editors Brian S. Everitt & David C. Howell
//John Wiley & Sons, Ltd, Chichester, 2005
//

//This is a short and definetly incomplete tutorial on data fitting in Scilab 
using leastsq.
//
// Basic assumption: this tutorial is for scientists that face this simple 
problem:
// they have an experimental dataset x_epx,y_exp and a certain model 
y=Model(x,p) to fit thie dataset.
//  This tutorial will try to answer the folowing questions:
//  1) how do you do that (simply)
//  2) how do you do that (more reliably and more quickly)
//  a) let's go faster with a Jacobian
//  b) how good is your fit? How big is the "error bar" associated with 
each parameter of your Model?
//  c) Can we bullet proof it?

//1) How do you do curve fitting in Scilab
//
//  We need a) a model function b) a dataset c) some more work
//  1)a) Let's start with the model function: a sinewave
//  here is the formula: y=A*sin(k*(x-x0))+y0;
//  here is the function prototypr [y]=SineModel(x,p) with  p=[x0,k,A,y0]'
function [y]=SineModel(x,p)
//INPUTS:   x 1D vector
//  p parameter vector of size [4,1] containing
//  x0  : sine origin
//  k   : sine spatial frequency ie k=2%pi/Xp with Xp the period
//  A   : sine amplitude
//  y0  : sine offset
//OUTPUTS:   y 1D vector of same size than x such that y=A*sin(k*(x-x0))+y0;
  x0=p(1);
  k=p(2);
  A=p(3);
  y0=p(4);
  y=y0+A*sin((x-x0)*k);
endfunction

//  1)b) Let's now have a fake dataset: a sine wave with some noise
//  We reuse the Model function we have just created to make this fake dataset

x_exp=[-10:0.1:10]';
x0=1.55;
k=1*%pi/3;
A=4.3;
y0=1.1
y_exp=SineModel(x_exp,[x0,k,A,y0])+(2*rand(x_exp)-1)*6/10;

//let's check and see what it looks like:
scf();
plot(x_exp,y_exp,'k.-');
xlabel('Exparimental X');
ylabel('Exparimental Y');
xtitle('Our fake experimental dataset to fit');

//  1)c) we are not done yet, we need some more work
//  First we need an error function that return for a given parameter set param 
the difference
//  between the experimental dataset and the model one:
//  Note that this function returns the difference at each point, not the 
square of the difference,
//  nor the sum over each point of the square of the differences
function e = ErrorFitSine(param, x_exp, y_exp)
   e = SineModel(x_exp,param)-y_exp;
endfunction
// Now we need a starting point that is not too far away from the solution
// Let's just fo it by hand for the moment we'll see later how to make it 
programmatically
// Just go and have a look at the previous plot and "guess", here is mine:
p0=[1,2*%pi/6,4,1];

//Ready to go:
[f,popt, gropt] = leastsq(list(ErrorFitSine,x_exp,y_exp),p0);
//popt contains the optimal parameter set that fits our dataset
//
scf();
plot(x_exp,y_exp,'k.');
plot(x_exp,SineModel(x_exp,popt),'r-');
xlabel('Experimental X')
ylabel('Experimental Y and best fit');
xtitle([...
"x0="+msprintf('%1.3f fit value: \t%1.3f',x0,popt(1));...
"k ="+msprintf('%1.3f fit value: \t%1.3f',k,popt(2));...
"A ="+msprintf('%1.3f fit value: \t%1.3f',A,popt(3));...
"y0="+msprintf('%1.3f fit value: \t%1.3f',y0,popt(4))...
]);

//Yep we are done popt is the optimal parameter set that fits our dataset 
x_exp,y_exp with our
// model SineModel
// How to assert the quality of our fit? We can use fopt and gropt for that. 
They should be both as small as possible.
// Ideally, the gradient should be zeros for each parameter, otherwise it means 
we have not found an optimum.

//2) How to go beyond that simple example?
// Namely:
//  a) how to go faster?
//  b) how to estimate how good our fit is (aka get error bars on our 
parameters)?
//  c) how to make thinks more reliable with less human guessing and more 
bulletproofing?


//2)a) and also 2)b)
//  We need the same extra function in order to speed things up and to estimate
//  how the "noise" on the experimental dataset translates in "noise" on each
//  individual parameter p(1), ...p($): the Jacobian matrix of our fit model.
//  Impressive name for a simple idea: providing leastsq with the partial
//  

Re: [Scilab-users] ?==?utf-8?q? Scilab 6.1 too slow to list large vectors

2020-03-31 Thread Antoine Monmayrant
Hello,

I also ran some tests and it seems that the regression is clearly line-based: 
ie the regression is worse for vector than for matrix because there more lines 
to print to display a vector than a matrix of similar length.
See my test code below.


n1=300;
n2=100;
mat=rand(n1,n2);
tn=[];

/* Ctrl+E the code below several times*/

tic
mat // matrix
//mat(:) // vector
t=toc()
tn=[tn,t];

disp('-')
disp('N_run = '+string(length(tn)))
disp('T='+string(mean(tn))+'+/-'+string(stdev(tn)));


/*
6.0.2 matrix
N_run = 20
T=0.6392742+/-0.056698
1.6x slower  but plotting 4 values per line ie 4x less lines to plot than for 
the matrix version

6.1.0 matrix
N_run = 10
T=1.0335109+/-0.0317414

6.0.2 vector mat(:)
N_run = 20
T=0.4943449+/-0.0662727

6.1.0 vector mat(:)
N_run = 10
T=3.800698+/-0.1121251
7.7x slower ie same slow down per line than for the vector version as we plot 4 
values per line so 4x more lines

*/
 
 
 
Le Mardi, Mars 31, 2020 11:36 CEST, Federico Miyara  
a écrit: 
 
> 
> Stéphane,
> 
> I simplified and diversified the test:
> 
> tic
> u = rand(100,1000)
> toc
> 
> takes
> 16 s in 6.1
> 10 s in 6.0.2
> 
> tic
> u = u(:)'
> toc
> 
> takes
> 66 s in 6.1
> 1.29 s in 6.0.2
> 
> tic
> u = u(:)
> toc
> 
> takes
> 107 s in 6.1
> 1.52 s in 6.0.2
> 
> tic
> u = matrix(u,1000,100)
> toc
> 
> takes
> 16 s in 6.1
> 10 s in 6.0.2
> 
> tic
> u = matrix(u,100, 100, 10)
> toc
> 
> takes
> 0.5 s in 6.1
> 0.5 s in 6.0.2
> 
> Seems as if vertical (many line feeds) print took more time than 
> horizontal print.
> 
> Regards,
> 
> Federico Miyara
> 
> 
> 
> On 31/03/2020 05:23, Stéphane Mottelet wrote:
> >
> > Hi Frederico,
> >
> > Thanks for reporting. Can you test if the regression also holds for 
> > matrices ?
> >
> > S.
> >
> > Le 30/03/2020 à 11:56, Federico Miyara a écrit :
> >>
> >> Fs  =  44100
> >> T  =  2.5
> >> t  =  [0:T*Fs]/Fs;
> >> ximp  =  exp(-t/0.3).*rand(t,"normal")  +  0.004*rand(t,"normal");
> >>
> >> tic
> >> ximp  =  ximp(:)
> >> toc
> > -- 
> > 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@lists.scilab.org
> > http://lists.scilab.org/mailman/listinfo/users
>

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] ?==?utf-8?q? Scilab 6.1 too slow to list large vectors

2020-03-30 Thread Antoine Monmayrant
Hi again,

Just tested using the cli (no window, no java): it's even more : 0.34s vs 46s.

Antoine 
 
 
Le Lundi, Mars 30, 2020 11:56 CEST, Federico Miyara  
a écrit: 
 
> 
> Dear All,
> 
> I have observed that Scilab 6.1 seems to have a regression respect to 
> 6.0.2. Sometimes one forgets to put semicolon after the coputation of a 
> vector with tens of thousands components. Scilab 6.0.2 listed all the 
> components very fast. That was nice because one hadn't to cancel the 
> computation, it took about 1 s. With 6.1 it takes much longer. For instance
> 
> Fs  =  44100
> T  =  2.5
> t  =  [0:T*Fs]/Fs;
> ximp  =  exp(-t/0.3).*rand(t,"normal")  +  0.004*rand(t,"normal");
> 
> tic
> ximp  =  ximp(:)
> toc
> 
> This takes 1.36 s in 6.0.2
> 
> The same code in 6.1 takes 182 s
> 
> Any idea why?
> 
> I know I can cancel at any moment the script execution, but if there 
> were a process that took a lot of time one wouldn't be willing to stop it...
> 
> Regards,
> 
> Federico Miyara

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] ?==?utf-8?q? Scilab 6.1 too slow to list large vectors

2020-03-30 Thread Antoine Monmayrant
Hello Frederico,

I can confirm this (6.0.2 vs 6.1) on linux Ubuntu 18.04 64bits:

 6.0.2 -> ~1s
 6.1.0 -> ~50s

Could you fill a bug report?

Antoine
 
 
Le Lundi, Mars 30, 2020 11:56 CEST, Federico Miyara  
a écrit: 
 
> 
> Dear All,
> 
> I have observed that Scilab 6.1 seems to have a regression respect to 
> 6.0.2. Sometimes one forgets to put semicolon after the coputation of a 
> vector with tens of thousands components. Scilab 6.0.2 listed all the 
> components very fast. That was nice because one hadn't to cancel the 
> computation, it took about 1 s. With 6.1 it takes much longer. For instance
> 
> Fs  =  44100
> T  =  2.5
> t  =  [0:T*Fs]/Fs;
> ximp  =  exp(-t/0.3).*rand(t,"normal")  +  0.004*rand(t,"normal");
> 
> tic
> ximp  =  ximp(:)
> toc
> 
> This takes 1.36 s in 6.0.2
> 
> The same code in 6.1 takes 182 s
> 
> Any idea why?
> 
> I know I can cancel at any moment the script execution, but if there 
> were a process that took a lot of time one wouldn't be willing to stop it...
> 
> Regards,
> 
> Federico Miyara

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


  1   2   3   4   5   >