[Scilab-users] BusCreator, BusSelector in Scilab ?

2020-05-20 Thread tien.dang
I'm doing project to convert model in Matlab Simulink to Scilab. I do not
know the module BusCreator and BusSelector are supported in Scilab or Not. I
just checked in Scilab Palette, don't have any module like this.
How would I find that module in Scilab? BusCreator and BusSelector ?
Thanks





--
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


Re: [Scilab-users] debug with scilab 6.1.0

2020-05-20 Thread Samuel Gougeon

Hello Bernard,

Please see
http://bugzilla.scilab.org/16363
https://codereview.scilab.org/#/c/21428

Regards
Samuel

Le 20/05/2020 à 20:07, B@Ksva a écrit :

Hello,
trying to use debug mode with Scilab 6.1.0 on W10 fails. I reloaded 6.0.2
and it's OK ! Why?
Example below is the console copy of 6.1 with the simple tutorial from the
help menu:

--> function v=compute(val)
   > v = 1;
   > for i=1:val
   > v = v * i;
   > end
   > endfunction

--> debug

debug> break compute 4 "i == 5"
num  enable function file  condition

   0truecompute:4   "i == 5"

debug> exec compute(10)
  ans  =

3628800.

debug> quit
Sortie du débogger.

-->


As one can see, the function is completed without taking the breakpoint into
account. Again with 6.0.2, the function logically stop at i=5 as expected
and get this:

debug> exec compute(10)
halte du débogger au point d'arrêt (0) dans la fonction compute ligne 4

v = (v * i)


Any clue on what is going wrong ?



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


Re: [Scilab-users] Corona modelling

2020-05-20 Thread Samuel Gougeon

Le 20/05/2020 à 17:40, Chin Luh Tan a écrit :
I can confirm this, this also happened in Scilab 6.1 Windows 10, 
however, it runs smooth in Scilab 6.0.2 same machine.


Thanks.
The issue is now reported here: 
http://bugzilla.scilab.org/show_bug.cgi?id=11852#c9


Samuel


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


[Scilab-users] debug with scilab 6.1.0

2020-05-20 Thread B@Ksva
Hello,
trying to use debug mode with Scilab 6.1.0 on W10 fails. I reloaded 6.0.2
and it's OK ! Why?
Example below is the console copy of 6.1 with the simple tutorial from the
help menu:

--> function v=compute(val)
  > v = 1;
  > for i=1:val
  > v = v * i;
  > end
  > endfunction

--> debug

debug> break compute 4 "i == 5"
num  enable function file  condition

  0truecompute:4   "i == 5"

debug> exec compute(10)
 ans  =

   3628800.

debug> quit
Sortie du débogger.

--> 


As one can see, the function is completed without taking the breakpoint into
account. Again with 6.0.2, the function logically stop at i=5 as expected
and get this:

debug> exec compute(10)
halte du débogger au point d'arrêt (0) dans la fonction compute ligne 4
>> v = (v * i)


Any clue on what is going wrong ?




--
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


Re: [Scilab-users] Corona modelling

2020-05-20 Thread Chin Luh Tan
I can confirm this, this also happened in Scilab 6.1 Windows 10, however, it 
runs smooth in Scilab 6.0.2 same machine. 



rgds,
CL


 On Wed, 20 May 2020 21:50:04 +0800 Samuel Gougeon  wrote 



Hello,



Thank you Stéphane for this nice
  example of applied GUI.

The screenshot of the Xcos model from
  Hervé is also quite stimulating.



About the GUI run on Scilab 6.1.0, i
  have noticed that the Scilab filebrowser is blinking when using
  any of both sliders, as if it was updated/redisplayed for each
  slider step. It continues to blink for a while even after stopping
  using the control, likely until all queued steps are performed.
  This behavior can be seen when sliding with the mouse, as well as
  with arrows, but not with page_up and page_down keys. So,
  apparently only performing small steps triggers it.


Does anyone confirm this behavior, or is it only on my PC on
  Windows7 ?

Best regards
 Samuel



Le 30/03/2020 à 08:13, Stéphane
  Mottelet a écrit :

Hello Heinz,

Here is an interactive version (made for my children last
week...) :

// Confinement COVID-19 !
// Stephane MOTTELET, UTC
// Tue Mar 24 08:55:03 CET 2020
// 
function dydt=sir(t, y, bet, gam, N)
dydt=[-bet/N*y(1)*y(2)
   bet/N*y(1)*y(2)-gam*y(2)  
   gam*y(2)];
endfunction

function draw(bet, gam)
t=0:1:360;
N=6e7;
if exists("gcbo") && is_handle_valid(gcbo)
sb = gcbo;
if sb.tag=="beta"
bet=sb.value;
gam=findobj("gamma").value
else
gam=sb.value;
bet=findobj("beta").value
end
y=ode('stiff',[N-1;1;0],0,t,list(sir,bet,gam,N));
curves = findobj("curves");
curves.children(1).data(:,2)=y(3,:);
curves.children(2).data(:,2)=y(2,:);
curves.children(3).data(:,2)=y(1,:);
else
y=ode('stiff',[N-1;1;0],0,t,list(sir,bet,gam,N));
scf(0)
clf
plot(t,y)
gce().tag="curves";
gce().children.thickness=2;
legend("Susceptible","Infected","Recovered",-1)

sb1 = uicontrol("style","slider",...
"units","normalized",...
"Position", [0.85,0.2,0.05,0.48],...
"BackgroundColor", [1,1,1],...
"Callback_Type",12,...
"sliderstep",[1/1000,1/10],...
"min",0.15,"max",0.3,"value",bet,...
"Callback","draw","tag","beta");

uicontrol("style","text",...
"string","$\beta$",...
"units","normalized",...
"Position", [0.85,0.125,0.05,0.08],...
"BackgroundColor", [1,1,1],...
"HorizontalAlignment","center");

sb1 = uicontrol("style","slider",...
"units","normalized",...
"Position", [0.90,0.2,0.05,0.48],...
"BackgroundColor", [1,1,1],...
"Callback_Type",12,...
"sliderstep",[1/1000,1/10],...
"min",0,"max",1/15,"value",gam,...
"Callback","draw","tag","gamma");

uicontrol("style","text",...
"string","$\gamma$",...
"units","normalized",...
"Position", [0.9,0.125,0.05,0.08],...
"BackgroundColor", [1,1,1],...
"HorizontalAlignment","center");

end
end

clf

draw(0.3,1/15)






___
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 Atoms Issue

2020-05-20 Thread Chin Luh Tan
Hi Samuel, 



Thanks. I will try your suggestion when I update the file with the same version 
number next time.



Currently any changes I did I would create a new subversion for it, or just a 
small patch file. I was thinking it could be just mentioned as "SOP" instead of 
reporting as a bug. 



Will keep you posted on this.



Regards,

Chin Luh




 On Wed, 20 May 2020 23:11:59 +0800 Samuel Gougeon 
 wrote 



Hello Chin Luh,



Le 20/03/2020 à 15:36, Chin Luh Tan a
  écrit :

Hi, 



There is a little issue always bugging me, whenever an
  atoms module has been installed, it will be kept in "archives"
  folder, either in SCI or SCIHOME respective folder. 



Under some circumstances if the developer update some patch
  in the portal and and remain the same version,
  atomsSystemUpdate followed by atomsInstall the module will
  pick up the archived module instead of the latest one from the
  web. User need to manually delete them from the folder in
  order to get the latest one. 



Is there any function in atoms* which I might have miss out
  which could clear the archives? It sounds redundant to
  developers or advance user but it makes sense for normal
  Scilab user. 





Have you tried to run atomsUpdate(your_module) instead of
  atomsInstal(your_module), in addition to atomsSystemUpdate()?

If it does not work better, it would be worth reporting the issue on
bugzilla.

 

 Best regards

 Samuel

 


___

users mailing list 

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


Re: [Scilab-users] Scilab 6.1 too slow to list large vectors

2020-05-20 Thread Perrichon
Hello,

 


See also bugzilla  Scilab's Bug Tracker – Bug 16359



 

 

Time request : 100 s

 

Results :

Xcos Scilab 5.5.2 :

Durée de la simulation : 258.3 s

 

Xcos Scilab 6.1.0 :

Durée de la simulation : 4353.4 s

 

BR.

Pierre

 



 

Before printing, think about ENVIRONMENTAL responsabity

 

 

De : users  De la part de Samuel Gougeon
Envoyé : mercredi 20 mai 2020 16:50
À : users@lists.scilab.org
Objet : Re: [Scilab-users] Scilab 6.1 too slow to list large vectors

 

Le 30/03/2020 à 11:56, 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...

 

Apparently, the maximum number N of lines of the console scroll buffer set in 
the user preferences (by default to 3000) is not taken into account to abstract 
the display in this kind of situation. Is it?

Yet, if there is no opened diary, displaying 10 "primary" rows looks 97% 
useless if the scroll buffer is 3000-row tall: 97000 rows will anyway become 
unreachable an lost, after the full display.

So, even without anticipating wrapping of long primary rows, that still 
multiplies the number of actual rows to display, wouldn't it be wise to limit 
the display to N primary lines, either the N last ones, or the N/2 first ones + 
"..." + the N/2 last ones ?

Even in the case of having so tall full diaries is required (that is a very 
specific and exceptional case), it is always possible to increase N through the 
preferences.

My two cents...

Samuel

 

 

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


Re: [Scilab-users] Scilab Atoms Issue

2020-05-20 Thread Samuel Gougeon

Hello Chin Luh,

Le 20/03/2020 à 15:36, Chin Luh Tan a écrit :

Hi,

There is a little issue always bugging me, whenever an atoms module 
has been installed, it will be kept in "archives" folder, either in 
SCI or SCIHOME respective folder.


Under some circumstances if the developer update some patch in the 
portal and and remain the same version, atomsSystemUpdate followed by 
atomsInstall the module will pick up the archived module instead of 
the latest one from the web. User need to manually delete them from 
the folder in order to get the latest one.


Is there any function in atoms* which I might have miss out which 
could clear the archives? It sounds redundant to developers or advance 
user but it makes sense for normal Scilab user.



Have you tried to run atomsUpdate(your_module) instead of 
atomsInstal(your_module), in addition to atomsSystemUpdate()?


If it does not work better, it would be worth reporting the issue on 
bugzilla.


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


Re: [Scilab-users] Scilab 6.1 too slow to list large vectors

2020-05-20 Thread Samuel Gougeon

Le 30/03/2020 à 11:56, 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...



Apparently, the maximum number N of lines of the console scroll buffer 
set in the user preferences (by default to 3000) is not taken into 
account to abstract the display in this kind of situation. Is it?


Yet, if there is no opened diary, displaying 10 "primary" rows looks 
97% useless if the scroll buffer is 3000-row tall: 97000 rows will 
anyway become unreachable an lost, after the full display.


So, even without anticipating wrapping of long primary rows, that still 
multiplies the number of actual rows to display, wouldn't it be wise to 
limit the display to N primary lines, either the N last ones, or the N/2 
first ones + "..." + the N/2 last ones ?


Even in the case of having so tall full diaries is required (that is a 
very specific and exceptional case), it is always possible to increase N 
through the preferences.


My two cents...

Samuel



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


[Scilab-users] ”histc”''s bug?

2020-05-20 Thread fujimoto2005
I think "histc" has a some bug.
The following sample code of the help file does't work.

**
data = [1 1 1 2 2 3 4 4 5 5 5 6 6 7 8 8 9 9 9];
N = size(data,"*")   // ==19

// Default binning; "sqrt": sqrt(19) => 4. .. => 4 bins
[h, j, b, i] = histc(data)
[h, j, b, i] = histc(data,10)
h= histc(data,10)
*



--
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


Re: [Scilab-users] Corona modelling

2020-05-20 Thread Perrichon
Dear,

I understand Samuel, but not sure that this kind of example on C-19 is the most 
representative of a GUI with Scilab.

Confusion is done on what is on the screen, and ridiculus analysis when experts 
are always studing in the whole word !

Where is the message : scilab solve C-19 ??? I dream.

So this is is a bad example.

 

 

De : users  De la part de Samuel Gougeon
Envoyé : mercredi 20 mai 2020 15:50
À : users@lists.scilab.org
Objet : Re: [Scilab-users] Corona modelling

 

Hello,

 

Thank you Stéphane for this nice example of applied GUI.

The screenshot of the Xcos model from Hervé is also quite stimulating.

 

About the GUI run on Scilab 6.1.0, i have noticed that the Scilab filebrowser 
is blinking when using any of both sliders, as if it was updated/redisplayed 
for each slider step. It continues to blink for a while even after stopping 
using the control, likely until all queued steps are performed. This behavior 
can be seen when sliding with the mouse, as well as with arrows, but not with 
page_up and page_down keys. So, apparently only performing small steps triggers 
it.


Does anyone confirm this behavior, or is it only on my PC on Windows7 ?


Best regards
Samuel

 

Le 30/03/2020 à 08:13, Stéphane Mottelet a écrit :

Hello Heinz,

Here is an interactive version (made for my children last week...) :

// Confinement COVID-19 !
// Stephane MOTTELET, UTC
// Tue Mar 24 08:55:03 CET 2020
// 
function dydt=sir(t, y, bet, gam, N)
dydt=[-bet/N*y(1)*y(2)
   bet/N*y(1)*y(2)-gam*y(2)  
   gam*y(2)];
endfunction
 
function draw(bet, gam)
t=0:1:360;
N=6e7;
if exists("gcbo") && is_handle_valid(gcbo)
sb = gcbo;
if sb.tag=="beta"
bet=sb.value;
gam=findobj("gamma").value
else
gam=sb.value;
bet=findobj("beta").value
end
y=ode('stiff',[N-1;1;0],0,t,list(sir,bet,gam,N));
curves = findobj("curves");
curves.children(1).data(:,2)=y(3,:);
curves.children(2).data(:,2)=y(2,:);
curves.children(3).data(:,2)=y(1,:);
else
y=ode('stiff',[N-1;1;0],0,t,list(sir,bet,gam,N));
scf(0)
clf
plot(t,y)
gce().tag="curves";
gce().children.thickness=2;
legend("Susceptible","Infected","Recovered",-1)

sb1 = uicontrol("style","slider",...
"units","normalized",...
"Position", [0.85,0.2,0.05,0.48],...
"BackgroundColor", [1,1,1],...
"Callback_Type",12,...
"sliderstep",[1/1000,1/10],...
"min",0.15,"max",0.3,"value",bet,...
"Callback","draw","tag","beta");

uicontrol("style","text",...
"string","$\beta$",...
"units","normalized",...
"Position", [0.85,0.125,0.05,0.08],...
"BackgroundColor", [1,1,1],...
"HorizontalAlignment","center");

sb1 = uicontrol("style","slider",...
"units","normalized",...
"Position", [0.90,0.2,0.05,0.48],...
"BackgroundColor", [1,1,1],...
"Callback_Type",12,...
"sliderstep",[1/1000,1/10],...
"min",0,"max",1/15,"value",gam,...
"Callback","draw","tag","gamma");
 
uicontrol("style","text",...
"string","$\gamma$",...
"units","normalized",...
"Position", [0.9,0.125,0.05,0.08],...
"BackgroundColor", [1,1,1],...
"HorizontalAlignment","center");
 
end
end
 
clf
 
draw(0.3,1/15)
 

 

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


Re: [Scilab-users] Overloading "inv" and/or "p" does not seem to work with Scilab 6.1.0

2020-05-20 Thread Samuel Gougeon

Hello Denis,

Le 07/05/2020 à 14:58, CRETE Denis a écrit :

Hello,

I redefined a few functions in Scilab 6.1.0 to extend them to arrays 
with 3 dimensions (formerly called hypermatrix). Overloading works 
with "clean", "multiply", "left division" and "element by element 
division" (after defining functions %s_clean, %s_m_s, %s_l_s and %s_d_s).


I tried to overload function "inv" with the following code:

function y=%s_inv(x),
    if ndims(x)>2 then
        for k=1:size(x,3),
            y(:,:,k)=inv(x(:,:,k));
        end;
    else
        y=inv(x);
    end;
endfunction

expecting that each layer of y is the reciprocal of corresponding 
layer of x. Instead,
inv(ones(1,1,2).*.rand(2,2)) returns the reciprocal of x layer 1 in y 
layer 1 AND x LAYER n IN y LAYER n, WHEN n>1. I use "layer" to 
designate the matrix obtain for a fixed value the index along the 3rd 
dimension.


Code to reproduce the problem:

n=4; m=3;
M=ones(1,1,n).*.rand(m,m);
inv(M)

Attempts to circumvent this problem by using M^(-1) instead of inv(M) 
run into the same problem (after redefining function %s_p). Is this a 
bug or did I miss something ?



It's a bug. inv() should display an error message inviting to define 
%s_inv(), or use %s_inv().
By the way, the hook to the overload existed in Scilab 5.5.2. Hence, 
this issue is a regression.

Could you please report it?
Thanks

Samuel


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


Re: [Scilab-users] Corona modelling

2020-05-20 Thread Samuel Gougeon

Hello,

Thank you Stéphane for this nice example of applied GUI.
The screenshot of the Xcos model from Hervé is also quite stimulating.

About the GUI run on Scilab 6.1.0, i have noticed that the Scilab 
filebrowser is blinking when using any of both sliders, as if it was 
updated/redisplayed for each slider step. It continues to blink for a 
while even after stopping using the control, likely until all queued 
steps are performed. This behavior can be seen when sliding with the 
mouse, as well as with arrows, but not with page_up and page_down keys. 
So, apparently only performing small steps triggers it.


Does anyone confirm this behavior, or is it only on my PC on Windows7 ?

Best regards
Samuel

Le 30/03/2020 à 08:13, Stéphane Mottelet a écrit :


Hello Heinz,

Here is an interactive version (made for my children last week...) :

// Confinement COVID-19 !
// Stephane MOTTELET, UTC
// Tue Mar 24 08:55:03 CET 2020
//
function  dydt=sir(t, y, bet, gam, N)
 dydt=[-bet/N*y(1)*y(2)
bet/N*y(1)*y(2)-gam*y(2)   
gam*y(2)];

endfunction

function  draw(bet, gam)
 t=0:1:360;
 N=6e7;
 if  exists("gcbo")  &&  is_handle_valid(gcbo)
 sb  =  gcbo;
 if  sb.tag=="beta"
 bet=sb.value;
 gam=findobj("gamma").value
 else
 gam=sb.value;
 bet=findobj("beta").value
 end
 y=ode('stiff',[N-1;1;0],0,t,list(sir,bet,gam,N));
 curves  =  findobj("curves");
 curves.children(1).data(:,2)=y(3,:);
 curves.children(2).data(:,2)=y(2,:);
 curves.children(3).data(:,2)=y(1,:);
 else
 y=ode('stiff',[N-1;1;0],0,t,list(sir,bet,gam,N));
 scf(0)
 clf
 plot(t,y)
 gce().tag="curves";
 gce().children.thickness=2;
 legend("Susceptible","Infected","Recovered",-1)
 
 sb1  =  uicontrol("style","slider",...

 "units","normalized",...
 "Position",  [0.85,0.2,0.05,0.48],...
 "BackgroundColor",  [1,1,1],...
 "Callback_Type",12,...
 "sliderstep",[1/1000,1/10],...
 "min",0.15,"max",0.3,"value",bet,...
 "Callback","draw","tag","beta");
 
 uicontrol("style","text",...

 "string","$\beta$",...
 "units","normalized",...
 "Position",  [0.85,0.125,0.05,0.08],...
 "BackgroundColor",  [1,1,1],...
 "HorizontalAlignment","center"); 
 
 sb1  =  uicontrol("style","slider",...

 "units","normalized",...
 "Position",  [0.90,0.2,0.05,0.48],...
 "BackgroundColor",  [1,1,1],...
 "Callback_Type",12,...
 "sliderstep",[1/1000,1/10],...
 "min",0,"max",1/15,"value",gam,...
 "Callback","draw","tag","gamma");

 uicontrol("style","text",...
 "string","$\gamma$",...
 "units","normalized",...
 "Position",  [0.9,0.125,0.05,0.08],...
 "BackgroundColor",  [1,1,1],...
 "HorizontalAlignment","center"); 


 end
end

clf

draw(0.3,1/15)


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


[Scilab-users] multiple histograms on one graph

2020-05-20 Thread fujimoto2005
Is there a way to display histograms of multiple data groups in the same
graph? An n × m matrix A which column represents the data of each group. I
want to display the histogram of Aj data on the same graph to see the
difference in frequency between groups.
Best regards.



--
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