Re: [Scilab-users] output buffer

2022-06-17 Thread antoine . elias

Hello Jean-Yves,

I tried to reproduce the problem but without success.
Could you give us an example ?

With mine, I generate a file with 8192 lines of 26624 characters.

a = "a":"z";
for i = 1:10, a = a + a;end
length(a) //26624

form = "%s\n";
for i = 1:13, form = form+form;end
length(form) /4 //8192 times "%s\n"

args = list();
args(8192) = a; //alloc list
for i = 1:8191, args(i) = a;end

fd = mopen(fullfile(TMPDIR, "mfprintf.txt"), "wt");

try
tic();
mfprintf(fd, form, args(:));
toc()
catch
end

mclose(fd);

Regards,
Antoine

Le 2022-06-17 14:41, Jean-Yves Baudais a écrit :

Hello,

In other words, how to use "setvbuf" in Scilab? Is there an equivalent
function that works with the mfprintf scilab function?

Thanks,

--Jean-Yves


Le 16/06/2022 à 10:39, Jean-Yves Baudais a écrit :

How to manage *the size*. Sorry.

Jean-Yves

Le 16/06/2022 à 10:38, Jean-Yves Baudais a écrit :

Hello,

How can we manage the output buffer when we write to a file? It seems 
that this buffer size is 4096.


Thanks,

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

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


Re: [Scilab-users] Read file (.txt)

2020-09-09 Thread antoine . elias

Hello Daniel,

Do you have try with "evstr" function ?

data = evstr(mgetl("output.txt"));

Regards,
Antoine

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


Re: [Scilab-users] simp_mode odesn't seem to work

2020-08-27 Thread antoine . elias
 

Hello Federico, 

simp_mode is a function not a variable,
 use :
 simp_mode(%f);

 Regards,
 Antoine 
Le 27/08/2020 à 09:50, Federico Miyara a écrit : 

> Dear All,
> 
> I need to have examples of rationals with very close poles and zeros, but the 
> simp engine simplifies them. This is awkward, since the simp documentation 
> says there is no threshold, so other than identical poles and zeros shouldn't 
> be simplified. Actually this is the case with complicated rationals created 
> from electrical network analysis of some filters, but not with the more 
> transparent example below.
> 
> My second attempt to reproduce the problem in my simple numeric example has 
> been to use the command simp_mode to disable any simplification. But it 
> doesn't work as expected--and described. For instance, the code
> 
> N = poly([1 2 3 3.09 5], "s")
> D = poly([1.001 3.003 4 6], "s")
> simp_mode = %f;
> H = N/D
> 
> yields these results:
> 
> --> N
> N = 
> -90.00027 +213.00055s -184.00037s² +74.99s³ -14.09s⁴ +s⁵
> --> D
> D = 
> 72.14 -126.2s +67.05s² -14s³ +s⁴
> --> H
> H = 
> 
> -30.93 +31.66s -10.1s² +s³ 
> -- 
> 24.06 -10.01s +s² 
> 
> As can be seen, even if I disabled automatic simplification, the result is 
> not the raw quotient N/D but a "simplified" version.
> 
> Any idea? Is it a bug?
> 
> Regards,
> 
> Federico Miyara 
> 
> [2]
> Libre de virus. www.avast.com [2]
> 
> ___
> users mailing list
> users@lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users [1]
 

Links:
--
[1] http://lists.scilab.org/mailman/listinfo/users
[2]
https://www.avast.com/sig-email?utm_medium=emailutm_source=linkutm_campaign=sig-emailutm_content=emailclient___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Palette Builder failed with scilab 6.1.0 nightly build - Bugzilla #16332

2020-02-21 Thread Antoine ELIAS

Oops my bad o/

I removed support for some very old versions of VS/VC but it seems I 
forgot some references.


Thank you to report, I will fix that soon.

Regards,
Antoine

Le 21/02/2020 à 18:45, Perrichon a écrit :


Hello,

I created several years ago my palette SEGPAL for additional 
components in XCOS, using Scilab 5.5.2 W10 x64


This library very well run

Now, I try to recompile it using Scilab 6.1.0 nightly build, but the 
buider.sce failed and I don"t know how tu continue


PS : For the C files, I use gcc version 4.6.3

See bugzilla #16332 for attached file (SEGPAL library)

I get errors :

--> exec('C:\SEGPAL\SegPal\builder.sce', -1)

Création des macros...

-- Création de [SegPallib] (Macros) --

genlib : Traitement du fichier : CLRseg.sci

genlib : Traitement du fichier : DerFil.sci

genlib : Traitement du fichier : EdgeTrigger.sci

genlib : Traitement du fichier : IntHyd.sci

genlib : Traitement du fichier : IntLim.sci

genlib : Traitement du fichier : IntSuiv.sci

genlib : Traitement du fichier : IntegralInt.sci

genlib : Traitement du fichier : Memo.sci

genlib : Traitement du fichier : PSB.sci

genlib : Traitement du fichier : PSBsuiv.sci

genlib : Traitement du fichier : PlusInt.sci

genlib : Traitement du fichier : Pow.sci

genlib : Traitement du fichier : RampJet.sci

genlib : Traitement du fichier : Rampe.sci

genlib : Traitement du fichier : Satur.sci

genlib : Traitement du fichier : Step2.sci

genlib : Traitement du fichier : TempoTrig.sci

genlib : Traitement du fichier : Time_Delay.sci

Création des blocs...

Création des sources...

à la ligne    57 de la fonction detectmsvc64tools ( C:\Program 
Files\scilab-branch-master\modules\dynamic_link\macros\detectmsvc64tools.sci 
ligne 71 )


à la ligne 4 de la fonction dlwHaveCompiler   ( C:\Program 
Files\scilab-branch-master\modules\dynamic_link\macros\windows\dlwHaveCompiler.sci 
ligne 17 )


à la ligne 7 de la fonction haveacompiler ( C:\Program 
Files\scilab-branch-master\modules\dynamic_link\macros\haveacompiler.sci 
ligne 20 )


à la ligne    38 de la fonction tbx_builder_src   ( C:\Program 
Files\scilab-branch-master\modules\modules_manager\macros\tbx_builder_src.sci 
ligne 55 )


à la ligne    35 de la fonction main_builder  ( 
C:\SEGPAL\SegPal\builder.sce ligne 43 )


à la ligne    51 du fichier exécuté C:\SEGPAL\SegPal\builder.sce

Variable non définie : dlwIsVc11Express

Best regards

Pierre P.


___
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 convert the ~ input placeholder <= Re: convert matlab code to scilab

2019-11-26 Thread Antoine ELIAS

Hello,

Or when you have to write a function following a specific prototype ( 
graphic events, optim, ode, ...)


If I would write a function that call another, I have to specify a 
prototype to allow user to call my function.
But in some case, the final user does not need all parameters so he can 
replace unused inputs by ~.

I think that only syntactic sugar.

example:
function for_each(iterable, fn)
    for i=1:size(iterable, "*")
        fn(iterable(i), i, iterable); //item, index, array
    end
endfunction

Users can define fn like this if tthey only need item and don't want to 
use index and whole array

function my_func(a, ~, ~)
    //blabla
end

I don't say that's essential :p
That's my understanding
Antoine
Le 26/11/2019 à 16:15, Chin Luh Tan a écrit :

Hi Samuel,

In fact I've not been using matlab for more than 10 years, so I try to 
understand this as well.


The input tilde is still abit confusing for me as well, I am trying to 
understand its' usage as this page: 
https://octave.org/doc/v4.4.1/Ignoring-Arguments.html


function val = pick2nd (~, arg2)
  val = arg2;
endfunction

I can't see the reason why the input need to ignored in this case, is 
it defined but not being user due to bad user overlooked it? or is it 
neglected and the default value would be used?


Then I find this : 
https://stackoverflow.com/questions/25204074/correct-use-of-tilde-operator-for-input-arguments


*/"The tilde is only for function declaration. Matlab's mlint 
recommends to replace unused arguments by ~. The result is a function 
declared like this function output = MyFunction(a, b, ~, c). This is a 
very bad practice. /**/

/*
*/
/*
*/Since you have a function where the parameters are optional, you 
must call the function with empty arguments 
output=MyFunction(str1,str2,[],[],...,true)."/*


It sound to me that the input tilde is suggested by the matlab mlint 
to improve the code so that the unused variable need not to pass into 
the function, and to improve memory management?


So there are 2 possibilities for the input tilde :

1. used to replace unused variable in the input which defined by user, 
but not being used. So the mlint recomment to replace with tilde, it 
could be be remove possibly due to the project has been calling the 
functions for many time, and changing the 4th to 3rd argument might 
need to change a lot of codes. In this case, the %unused would be good.


2. Tilde used to tell the function to use default value, then 
replacing it with % unused might cause error.


Think we need some x-matlaber to confirm which case.

Thanks again.

rgds,
CL



 On Tue, 26 Nov 2019 20:36:01 +0800 *Samuel Gougeon 
mailto:sgoug...@free.fr>>* wrote 


Hello Chin Luh,

Thanks a lot for your input.

Both cases -- input and output will have to be converted --, since
the converter is also made to convert (sets of) functions
definitions, not only scripts.

About the input case: Steven's answer is still not really clear to
me. Doing some tests on Octave, we must anyway provide some input
at calling time when  ~ is used as default input in the
definition. AFAIU, this ~ could just be to make sure that no
variable name used inside the function matches the name of the
input argument in the function definition, since "~" alone can't
be actually used as variable's name. In this case, for Scilab, any
input ~ could be replaced with an improbable variable name like
"%unused" or "%kwzxq", and that should do it.

Please, correct me if someone understands something else.

Best regards
Samuel

Le 26/11/2019 à 03:33, Chin Luh Tan a écrit :


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

Hi Samuel,

I think your assumption likely correct on the input and the
output using ~


https://www.mathworks.com/matlabcentral/answers/288016-tilde-doesn-t-work-for-ignoring-my-inputs

"
You *can*use tilde to ignore input arguments when you
*define*the function.
You *cannot*use tilde to ignore input arguments when you
*call*the function.
You *cannot*use tilde to ignore output arguments when you
*define*the function.
You *can*use tilde to ignore output arguments when you
*call*the function.
If you want to be able to specify only the third argument,
there must be some way for your function to disambiguate the
one-input call from a call that specifies only the third
input. Usually in MathWorks function this is done by
specifying [] for the arguments for which the user doesn't
want to specify. In that case the code would use the default
value if either narginis too small or if narginis large enough
and the specified input argument isempty.
"
From 

Re: [Scilab-users] display of complex/not real numbers, again

2019-09-12 Thread Antoine ELIAS

Hello Stéphane,

In Scilab 6.0.2 without format("e", 24)

--> h = %eps/128, x0=%pi/4
 h  =
   1.735D-18

 x0  =
   0.7853982

--> (cos(x0+h)-cos(x0-h))/2/h
 ans  =
   0.

--> cos(x0+%i*h)
 ans  =
   0.7071068

--> imag(cos(x0+%i*h))/h
 ans  =
  -0.7071068

--> -sin(x0)
 ans  =
  -0.7071068

It seems to be close of Matlab's outputs, no ?
I probably not understand your problem ...

Antoine
Le 12/09/2019 à 10:26, Stéphane Mottelet a écrit :

Hello all,

The subject has been already discussed a lot but I would like it to be 
discussed again because I now have a real rationale to promote a 
change in the way complex numbers with small imaginary part are 
displayed.


I don't know if some of you were aware of the clever technique of 
complex-step derivative approximation, but until yesterday I was not 
(see e.g. 
http://mdolab.engin.umich.edu/sites/default/files/Martins2003CSD.pdf). 
Roughly speaking, using the extension of a real function x->f(x) to 
the complex plane allows to compute an approximation of the derivative 
f'(x0) at a real x0 without using a substraction, like in the central 
difference formula (f(x0+h)-f(x0-h))/2/h which is subject to 
substractive cancelation when h is small. In Scilab most operators and 
elementary functions are already complex-aware so this is easy to 
illustrate the technique. For example let us approximate the 
derivative of x->cos(x) at x=%pi/4, first with the central difference 
formula, then with the complex step technique:


--> format("e",24)

--> h=%eps/128, x0=%pi/4
 h  =

   1.73472347597680709D-18

 x0  =

   7.85398163397448279D-01


--> (cos(x0+h)-cos(x0-h))/2/h
 ans  =

   0.0D+00


--> imag(cos(x0+%i*h))/h
 ans  =

  -7.07106781186547462D-01


--> -sin(x0)
 ans  =

  -7.07106781186547462D-01

You can see the pathological approximation with central difference 
formula and the perfect (up to relative machine precision) 
approximation of complex-step formula.


However, the following is a pity:


--> cos(x0+%i*h)
 ans  =

   7.07106781186547573D-01

We cannot see the imaginary part although seeing the latter is 
fundamental in the complex-step technique. We have to force the 
display like this, and frankly I don't like having to do that with my 
students:


--> imag(cos(x0+%i*h))
 ans  =

  -1.22663473334669916D-18

I hope that you will find that this example is a good rationale to 
change the default display of Scilab. To feed the discussion, here is 
how Matlab displays things, without having to change the default 
settings:



>> h=eps/128, x0=pi/4
h =
   1.7347e-18
x0 =
    0.7854

>> (cos(x0+h)-cos(x0-h))/2/h
ans =
 0

>> cos(x0+i*h)
ans =
   0.7071 - 0.i

>> imag(cos(x0+i*h))/h
ans =
   -0.7071

>> -sin(x0)
ans =
   -0.7071




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


Re: [Scilab-users] Make Variable visible in Scilab from a SCE-script in a toolbox

2019-05-10 Thread Antoine ELIAS

Hello,

You can use "resume" to return values in caller environment.
In case of callbacks from gui interaction, caller is always "console" scope.

In your callback do something like "data = resume(a);"
That's create or overwrite "data" with the contents of "a"

Example :

xdel(winsid());
clear createGUI callbackFromGui;

function createGUI()
    f = figure(...
    "dockable", "off", ...
    "axes_size", [300 100], ...
    "infobar_visible", "off", ...
    "toolbar", "none", ...
    "menubar_visible", "on", ...
    "menubar", "none", ...
    "default_axes", "off", ...
    "background", color(255, 255, 255));

    uicontrol(f, ...
    "style", "pushbutton", ...
    "string", "Send variable in console context", ...
    "position", [(300 - 200)/2 (100 - 25)/2 200 25], ...
    "callback", "callbackFromGui");
endfunction

function callbackFromGui()
    a = rand(10, 10);
    data = resume(a);
endfunction

createGUI();

After clicking on the button, you should have a "data" variable in the 
console.


Regards,
Antoine

Le 10/05/2019 à 14:18, Stéphane Mottelet a écrit :

Le 10/05/2019 à 11:42, Hani Andreas Ibrahim a écrit :
I wrote a SCE-Script where you can read datafiles into a matrix and 
specify the import parameter AND the name of matrix where the data is 
stored in a GUI. Because variables in sce are visible to Scilab I 
could work with the matrix which name was specified in the GUI in 
Scilab's console.
Now I wrote a toolbox where I call this script from a menu item 
(addmenu) with exec("myscrip.sce",-1). The toolbox works fine so far 
and run the script properly but the matrix variable is not visible in 
Scilab. Obviously Scilab handles variables in sce in a toolbox 
differently?
The script itself works fine and provide the variable if I run the 
sce directly outside the toolbox. The sce has no dependencies to 
external SCIs.

Who can I make this variable visible for Scilab from a toolbox?
Thanks, Hani
PS: The toolbox should run on Scilab 5.5.x and 6.0.x.

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


Hello,

Please give us a small and reproductive example, under the form of two 
scripts (the one creating the menu and the one executed by selecting 
the menu item).


S.

--
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] create figure without toolbar, etc

2019-04-17 Thread Antoine ELIAS

Hello Philipp,

The "bar" with the question mark is the docking system, to allow you to 
drag the window in an other Scilab window.
If you don't want dockable system on your window you can set "dockable" 
to "off" at *creation time*.


f = figure("dockable", "off", "toolbar_visible", "off", 
"menubar_visible", "off", "infobar_visible", "off");


Regards,
Antoine
Le 17/04/2019 à 10:16, P M a écrit :

Dear all,

for creating a plot it is often convenient to hide all toolbars, 
menubars etc.


with:

f  =  figure();
f.toolbar_visible  =  "off"
f.menubar_visible  =  "off"
f.infobar_visible  =  "off" it is possible to hide most of the things.
However one bar remains, which is the one displaying the window number 
and the question mark. How to hide these?

Thank you,
Philipp


___
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] A gateway example in the current scilab-6.0.1 source still remaining in the scilab 5.5.2 old Scilab C API version.

2019-02-01 Thread Antoine ELIAS

Hello René,

With Scilab 5.3.0, late of 2010, we have introduce a new API that will 
be compatible with new Scilab 6 environment.
The goal was to depreciate stackx.h interface too dependent on the 
format of the old data storage format. ( called "stack" ).
This interface is defined in Scilab documentation : 
https://help.scilab.org/docs/6.0.0/en_US/section_57c66b650f71d7a7eaca3dfe608a4c08.html
During development of Scilab 6, we worked on a more efficient API: 
https://help.scilab.org/docs/6.0.1/en_US/api_scilab.html


If you want to write gateways and keep compatibility between 5 and 6, 
prefer 
https://help.scilab.org/docs/6.0.0/en_US/section_57c66b650f71d7a7eaca3dfe608a4c08.html
If you want to write for Scilab 6 and more use 
https://help.scilab.org/docs/6.0.1/en_US/api_scilab.html


You can find examples in documentation or in the demonstration toolbox 
'toolbox skeleton' in your Scilab installation folder. 
(SCI/contrib/toolbox_skeleton)

For example the same gateway writes in both API:
--> edit("SCI/contrib/toolbox_skeleton/sci_gateway/c/sci_csum.c"); 
//compatible 5 and 6 version
--> edit("SCI/contrib/toolbox_skeleton/sci_gateway/c/sci_csum6.c"); 
//scilab 6 and more


Thank you for the report, we need to update or remove old examples.
Regards,
Antoine
Le 01/02/2019 à 09:55, René Grognard a écrit :

Dear user or developer experienced in the new Scilab C API,

All the sub-directory: 
scilab-6.0.1/share/scilab/modules/dynamic_link/examples/gateway, 
giving a nice, non-trivial example of a gateway, seems an identical 
copy of the same sub-directory in scilab-5.5.2.


Is there somewhere a version converted for scilab-6.0.1 ?

The conversion does not seem at all obvious to me. For example I 
cannot see how the simple instructions given by: Port to the Scilab 6 
C API, in: Gateways: from Scilab 5 to Scilab 6, could ever make this 
gateway compatible with both the Scilab 5 and 6 APIs. (Is there a 
"mapping" somewhere between the functions, etc, of the old and new 
Scilab APIs as there is between Scilab and Matlab?)


The conversion of that gateway example --- with matrix multiplication 
in C --- would be a far better example to: Getting started with 
API_Scilab, than the rather trivial one given. At any rate as it 
stands the sub-directory in question has no place within the current 
scilab-6.0.1.


Thanks for any comment and maybe the location of an updated version of 
this particular gateway example.


René Grognard









___
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] nightly build (latest) release

2019-01-31 Thread Antoine ELIAS

Thank you Paul !

It seems that in the packaged Windows version some files are missing in 
xml module.

I will fix that asap.

Antoine
Le 31/01/2019 à 10:39, Carrico, Paul a écrit :


Just a feedback on the latest branch/nightly build release I 
downloaded this moring:


-Scilab opens and immediately closes under Windows 7 (64 bits)

-It does not open and remains blocked without opening  under CentOS 7 
(64 bits)


I’m going back to the old one

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] Unexpected END OF FILE

2019-01-30 Thread Antoine ELIAS

Hello Frederico,

On Windows, you should open your file in binary mode, with "rb".
--> fd = mopen("440Hz_0.2s.wav", "rb");
--> h = mgeti(1000, "uc", fd);
--> size(h)
 ans  =
   1.   1000.

--> dec2hex(h(1:5))
 ans  =
!52  49  46  46  84  !

Regards,
Antoine
Le 30/01/2019 à 23:02, Federico Miyara a écrit :


Dear all,

I'm trying to read data from a file (in this case a wave file) with 
the following code (Scilab 6.0.1)

fid  =  mopen('g:\Mis documentos\Ondas\440Hz_0.2s.wav',  'r')
mseek(0,  fid)
h  =  mgeti(1000,'uc',fid)
I should get a vector with 1000 unsigned 1 byte integer components but 
I end with only 164 entries. Viewing the file with an hex viewer, the 
last correctly read data are


34 3E 34 3E

(decimal 52 62 52 62)

Then the following data and further data

1A 3D 1A 3D  ...

are not read at all. No warning like having reached EOF. By the way, 
the repeated pairs are because it is a stereo file with identical left 
and right channels.


The same happens changing the way the file data are to be decoded. 
Seems to get stuck when 1A or 1A 3D appears.


Any idea of what may be going on and how to solve it?

Federico Miyara


<#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] Scilab from Powershell

2018-10-26 Thread Antoine ELIAS

Hello,

I made a quick test and it seems to work ( curiosity ... I never used 
powershell with Scilab )


ps.sce :


PS E:\git\6.0\scilab> $objScilab.SendScilabJob("exec('d:\tests\ps.sce', 
-1);")


   0.3616361   0.4826472   0.5015342   0.6325745
   0.2922267   0.3321719   0.4368588   0.4051954
   0.5664249   0.5935095   0.2693125   0.9184708
0

Is it possible that you have an error in your file ?
Do you have try to exec your file in Scilab ?

Antoine
Le 26/10/2018 à 16:45, FIXED-TERM Nacer Mohamed Ikbal (ETAS/ESY) a écrit :


hello mesdames and sirs,

I want to ask you about the possibility of calling a function that has 
been written within a scilab from powershell.


I am doing the following after have the file where the code written a 
side than calling it :


$objScilab.SendScilabJob("exec('D:\New\ScilabCode.sce', -1)")

I always receive an error result 999 in powershell



___
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] == and : relative priorities, as in 0==-1:1

2018-07-31 Thread Antoine ELIAS

Haha, I was referring to Matlab.
It was a private joke with Bruno.
Sorry about for misunderstanding.

Antoine
Le 31/07/2018 à 22:20, Rafael Guerra a écrit :


Le 31/07/2018 à 21:51, Samuel Gougeon a écrit :

It is somewhat reported here 
 (in 2011..), but i 
don't understand
the conclusion of the report...: “It seems that "he who must not be 
named" has different priorities on operators.”


Is Voldemort working in the Scilab team?



___
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] Counter of pointers to an XML object, and clear destructor

2018-07-29 Thread Antoine ELIAS

Hello Samuel,

In XMLObject there is two levels of reference,
 - one on MList (managed by reference counter)
 - one on internal XMLObject (internally manager like handle, an 
integer that link to a C++ object)


xmlDelete destroy internal XMLObject
clear destroy (unreference and destroy if ref <= 1 ) MList object.

So in your case, after a xmlDelete, the internal XMLObject was destroyed 
but not the MList.
And after a clear doc, the MList was destroyed but the internal 
XMLObject not.


Current XMLObject is based on simple MList with the id of the doc ( 
store as double ).
If we want to correctly destroy the internal XMLObject with the clear 
command.
We must change the implementation to use types::UserType instead of 
types::Double and uses destructor of UserType to free XMLObject.


> Deleting an object should clear all its pointers. For instance, with 
the XML example

> hereabove, deleting the document should clear doc and doc2.
I am not agree with that, I cannot delete an user variable indirectly. ( 
xmlDelete(doc) that will delete doc )

Only clear command can do that. For me it will be a bad practice.

Antoine
Le 28/07/2018 à 16:20, Samuel Gougeon a écrit :

Hello,

I am doing some tests about the save() function, in order to document 
its behavior when saving pointers to some objects.


There is the case of XML objects:
Contrarily to graphic handles, that are pointers whose reloading 
restores the pointed graphics, saving XML pointers is possible, but 
then their reloading does NOT restore the XML document.
Then, when digging in Bugzilla in order to search for features about 
this and the clear() function applied to XML pointers, i've found back 
the following comment from Calixte 
, referring to an 
expected change of Scilab 6 with respect to Scilab 5:


/With Scilab 6, things will be easier since each data will have a 
reference counter [of pointers to it] which will allow to call a kind 
of destructor when the reference count will be zero.//

/
In practical, this new feature looks still not to be implemented. Here 
is an illustration:


// Let's create an XML document and a pointer "doc" to it:
--> doc = xmlReadStr("rib=""bar"">Hello")

 doc  =
XML Document
url: Undefined
root: XML Element

// Now, let's make a copy of the pointer:
-->doc2=doc
 doc2  =
XML Document
url: Undefined
root: XML Element

--> doc2==doc
 ans  =
  T T    <<< this double True is strange, but it's not the matter here

// Then let's clear both pointers: If a counter actually exists,
// it shall be set to 0 afterwards.
// And if the automatic destructor is implemented, then this should
// automatically delete the XML document. What's the reality?:
--> clear doc doc2   // OK
-->  xmlGetOpenDocs()
 ans  =
   ans(1)
XML Document
url: Undefined
root: XML Element

The document still exists. So, the automatic destructor is not yet 
implemented,

at least for XML objects.

Is it a pity? To me, the reverse approach would be more relevant:
Deleting an object should clear all its pointers. For instance, with 
the XML example

hereabove, deleting the document should clear doc and doc2.
It's unfortunately not the case:
--> xmlDelete(xmlGetOpenDocs()(:))  // cleaning the area
--> doc = xmlReadStr("rib=""bar"">Hello");

--> doc2 = doc;
--> xmlDelete(doc)
--> isdef(["doc" "doc2"],"l")
 ans  =
  T T
--> doc
 doc  =
-->

This is the same issue with graphic handles when the figure they point 
to has been closed:
We then get some still existing /but invalid/ handles, instead of 
properly clearing them.


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] ATOMS error (Scilab 6.0.1)

2018-07-21 Thread Antoine ELIAS

Hello,

Trouble comes from a bug in mgetl function. (Windows only)
Patch was validated this morning.
From tomorrow you can use nightly build version to avoid this.
http://www.scilab.org/en/development/nightly_builds/branch60

Sorry for inconvenience.
Antoine
Le 21/07/2018 à 11:50, arctica1963 a écrit :

Hello all,

Just recently been getting this error when running the ATOMS module manager:

"No ATOMS module is available. Please, check your Internet connection or
make sure that your OS is compatible with ATOMS."

I am using version 6.0.1 and know that it was working a while back, so not
sure what has changed. It can clearly get to the repository to update the
database, but then generates an error. Console shows: "Scanning repository
http://atoms.scilab.org/6.0  ... Done"

I also verified this on a separate machine that I only recently updated with
6.0.1, and that gave the same response. Not a big deal as I tend to write
functions as I need them, but seems odd.

Tried deleting the user folder at:
C:\Users\\AppData\Roaming\Scilab\scilab-6.0.1 but did not help.

Any ideas? It works fine under 5.5.2.

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] uicontrol tab

2018-02-26 Thread Antoine ELIAS

Hello James

'Position',[0.05625,0.0541667,0.7921875,0.8729167]
seems to be normalized values. So don't forget to set units property.

//figure
f=figure(...
    'figure_position', [400,50], ...
    'figure_size', [859,752], ...
    'auto_resize', 'on', ...
    'background', 33, ...
    'figure_name', 'VISA Interface number %d',...
    'dockable', 'off', ...
    'infobar_visible', 'off', ...
    'toolbar_visible', 'off', ...
    'menubar_visible', 'on', ...
    'default_axes', 'on', ...
    'visible', 'off');

handles.dummy = 0;

//tab container
handles.tabframe = uicontrol(f, ...
    'style', 'tab', ...
    'position', [0.05625,0.0541667,0.7921875,0.8729167]);

//set "units" property
handles.tabframe.units = "normalized";

//3rd tab
handles.tab3 = uicontrol(handles.tabframe, ...
    "style", "frame", ...
    "backgroundcolor", [1 0 1], ...
    "string", "magenta")

//2nd tab
handles.tab2 = uicontrol(handles.tabframe, ...
    "style", "frame", ...
    "backgroundcolor", [1 1 0], ...
    "string", "yellow")

//1st tab
handles.tab1 = uicontrol(handles.tabframe, ...
    "style", "frame", ...
    "backgroundcolor", [0 1 1], ...
    "string", "cyan")

//show figure
f.visible = 'on';




Le 26/02/2018 à 16:26, Stéphane Mottelet a écrit :

Le 26/02/2018 à 16:20, James Holland a écrit :

I'm trying to incorporate the 'tab' function in a GUI but I don't see any tab
control when I execute the code. I can't find a tutorial for this either.
can someone please give me an example of how this is done. My code is below:


f=figure('figure_position',[400,50],'figure_size',[859,752],'auto_resize','on','background',[33],'figure_name','VISA
Interface number %d',...
'dockable','off','infobar_visible','off','toolbar_visible','off','menubar_visible','on','default_axes','on','visible','off');
//
handles.dummy = 0;

handles.tabframe = uicontrol
(f,'Style','tab','Position',[0.05625,0.0541667,0.7921875,0.8729167],'Visible','on','String','tab1');


I also have button controls but they work OK.

TIA James



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


Hello,

there is an example in the tests of gui module :

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27

// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
// Copyright (C) 2014 - Scilab Enterprises - Antoine ELIAS
//
// This file must be used under the terms of the CeCILL.
// This source file is licensed as described in the file COPYING, which
// you should have received as part of this distribution. The terms
// are also available at
// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
  
function  tabs=  createTab(uiType)

 f=  figure("dockable",  "off"  ,"infobar_visible",  "off",  "toolbar_visible",  "off",  "menubar_visible",  "off", 
 "default_axes",  "off",  "layout",  "border")
 f.axes_size  =  [470,  410];
  
 tabs=  uicontrol(f,  "style",  uiType,  "tag"  ,"tab",  "constraints",  createConstraints("border",  "center"));
  
 tab1=  uicontrol(tabs,  "style",  "frame",  "tag",  "tab 1",  "string",  "tab 1",  "layout",  "border");

 uicontrol(tab1,  "string",  "button 1");
  
 tab2=  uicontrol(tabs,  "style",  "frame",  "tag",  "tab 2",  "string",  "tab 2",  "layout",  "border");

 uicontrol(tab2,  "string",  "button 2");
  
 tab3=  uicontrol(tabs,  "style",  "frame",  "tag",  "tab 3",  "string",  "tab 3",  "layout",  "border");

 uicontrol(tab3,  "string",  "button 3");
endfunction
  
//tab

tab=  createTab("tab");

S.
--
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] File exist function?

2018-01-25 Thread Antoine ELIAS

Hello Claus,

You can use "isfile" function to check existence if a file and "isdir" 
for folder.

https://help.scilab.org/docs/6.0.0/en_US/isfile.html
https://help.scilab.org/docs/6.0.0/en_US/isdir.html

Regards,
Antoine
Le 25/01/2018 à 17:43, Claus Futtrup a écrit :

Dear Scilabers

I wish to check for the existence of some files. For this I created a 
simple function:


[out]=function  file_exist(fname)
 [fd,  err]  =  mopen(fname);  // Try to open file, mode: 
'br'(binary-reading)
 if  err==0  then
 out=%t;
 mclose(fname);
 else
 out=%f
 end
endfunction

I didn't check, but presumably this would work.

Is such a function already available? Which way is the "official" way 
to do this in Scilab?


Maybe I'm searching for the wrong word, but I found some ways in 
Scilab. The "fileinfo" seems to be the closest one to what I wish to do.


Matlab has a function "exist()" which can check for files too. Scilab 
has the function "exists()" - notice the function name is plural, not 
singluar - and this one AFAIK only works for Scilab variables (not 
files), although I didn't check.


If fileinfo is the right way, maybe an example for the help could be 
to make a file_exist function, to show ... (?) ... when I search for 
Scilab file exist function, I'm not guided in any 
specific way/direction and find myself insecure whether I find the 
right help.


Best regards,
Claus


___
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-Dev] Scilab forge down

2017-11-07 Thread Antoine ELIAS

Hello all,

Since Tuesday evening, services around xxx.scilab.org are interrupted by 
a hardware failure of an internal connection.

ISP is working on it.
In the meantime, ITs start to move servers ( VM ) to another site.
They started by the mailing list server.

I do not have more information except that it is not voluntary.
And that ESI IT teams work to solve the problem.

Regards,
Antoine
Le 06/11/2017 à 17:47, Stéphane Mottelet a écrit :

Hello Scilab/ESI guys,

The scilab forge (forge.scilab.org) seems to be down. Is there a 
maintenance happening ? I hope that this is just temporary : in the 
future that would be nice to announce in adavance such 
unavailabilities...


S.


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


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


Re: [Scilab-users] addinter: Unknown error depending on scilab build

2017-07-03 Thread Antoine ELIAS

Hello Erik,

SCI/bin is in library path when Scilab is running but DW can not know that.
Please, do not copy Scilab dlls in your dll path, Scilab dlls have 
another dependencies that can not be resolved.


Can you explain us your initial trouble ?

Antoine
Le 29/06/2017 à 12:55, E_Ben a écrit :

I analysed my dlls in dependency walker, and it seems that some scilab dlls
cannot be found (see screenshot attached below, the dll names are: ast.dll,
libintl.dll, output_stream.dll). They are actually located in the SCI/bin
folder. When I copy them into the folder where my dll is, still many
dependent dlls also located in SCI/bin are not found by dependency walker.
So, it seems that the scilab installations on which the dll can be loaded
find the scilab dlls in SCI/bin, but those which cause an error don't find
them. Any ideas what I can do instead of copying all dlls from the SCI/bin
folder to the folder where my dll is?

depwalk.png 




--
View this message in context: 
http://mailinglists.scilab.org/addinter-Unknown-error-depending-on-scilab-build-tp4036699p4036706.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
Nabble.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] "findmsvccompiler" is buggy!?

2017-03-23 Thread antoine . elias

Well it seems that someone have some problem with copy/paste ( me ^^ )

fix -> https://codereview.scilab.org/#/c/19226/

But on my computer with 6.0.0 release:

--> findmsvccompiler //default value
 ans  =
 msvc120pro

--> setenv("SCILAB_PREFERED_MSVC","msvc140pro");
--> findmsvccompiler
 ans  =
 msvc140pro

Works well.

Thank you
Antoine

Le 2017-03-23 22:57, Dirk Reusch a écrit :

Hello Antoine,

Please have a look at "dlwFindMsVcCompiler" (cf. below), the list
entries of

funcs = list( ... )

and the entries of

compilers = [ ... ]

do *not* match!

Best regards,

Dirk

---

function MSCompiler = dlwFindMsVcCompiler()
MSCompiler = "unknown"; // unknown

// We use always last version of MS compiler

val = getenv("SCILAB_PREFERED_MSVC", "");
if val <> "" then
funcs =

list(dlwIsVc14Express,dlwIsVc12Pro,dlwIsVc14Express,dlwIsVc12Pro,dlwIsVc11Express,dlwIsVc11Pro,dlwIsVc10Express,dlwIsVc10Pro);
compilers = [ ... "msvc140express";
"msvc140pro";
"msvc120express";
"msvc120pro";
"msvc110express";
"msvc110pro";
"msvc100express";
"msvc100pro";];
idx = find(val == compilers);
if idx <> [] then
func = funcs(idx);
if func() then
MSCompiler = val;
return;
end
end
end
...

On Thu, 23 Mar 2017 22:26:18 +0100
antoine.el...@scilab-enterprises.com wrote:




Hello,

Can you try with :

setenv("SCILAB_PREFERED_MSVC","msVC140pro")

I have 4 versions of VS on my computer and I can switch without
trouble.

Regards,
Antoine

Le 2017-03-23 21:55, Dirk Reusch a écrit :
> Hello,
>
> Having installed VS 2013 ("msvc120express") and VS 2015
> ("msvc140pro") and trying to force the use of VS 2015 via
>
> setenv("SCILAB_PREFERED_MSVC","mscv140pro")
>
> I have noticed that "findmsvccompiler()" still reports
> "msvc120express".
>
> IMHO there is a bug in "dlwFindMsVcCompiler()", because
> "dlwIsVc14Pro()" returns correctly %t.
>
> Best regards,
>
> Dirk
> ___
> 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] "findmsvccompiler" is buggy!?

2017-03-23 Thread antoine . elias
 

Hello,

Can you try with :

setenv("SCILAB_PREFERED_MSVC","msVC140pro")

I have 4 versions of VS on my computer and I can switch without trouble.

Regards,
Antoine

Le 2017-03-23 21:55, Dirk Reusch a écrit :
> Hello,
> 
> Having installed VS 2013 ("msvc120express") and VS 2015 ("msvc140pro")
> and trying to force the use of VS 2015 via
> 
> setenv("SCILAB_PREFERED_MSVC","mscv140pro")
> 
> I have noticed that "findmsvccompiler()" still reports "msvc120express".
> 
> IMHO there is a bug in "dlwFindMsVcCompiler()", because "dlwIsVc14Pro()"
> returns correctly %t.
> 
> Best regards,
> 
> Dirk
> ___
> 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 get a C compiler for Scilab 6.0.0

2017-02-17 Thread antoine . elias

Hello Vic,

For compilation of Scilab, we provide Visual Studio 2013 solution.
For compilation of toolbox/code, you can use VS2010, VS2012, VS2013 and 
VS2015.


Scilab 6 on Windows provides Visual C++ redistributable 2013.
So for better compatibility/portability, I suggest you use VS2013 ( Pro 
or Express[1] )


Hope that helps,
Antoine

[1] https://www.microsoft.com/en-us/download/details.aspx?id=44914

Le 2017-02-17 22:27, Vittorio Comino a écrit :

What is the up to date procedure to install a C compiler (preferably
Microsoft) for the new Scilab 6.00 on Windows10?
Thanks.

Vic
___
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] Interfacing to third party DLLs

2017-01-19 Thread antoine . elias

Hello James,

inputs arguments of your interface must be pointers, Scilab manage data 
as matrix ( arrays in C )

So a scalar variable `A` become a `double A[1];`

prototype must be like this :
void Add(double* a, double* b, double* c);


I made some changes is yours files, take a look, I hope that can help 
you.


Antoine

Le 2017-01-18 22:38, James Holland a écrit :
I've spent some time on this and I still can't get this to work. I've 
created

a very simple 64-bit dll  to allow me to experiment with this but to no
avail. All my DLL consists of is two functions, one that adds two 
doubles
and returns a double and one that subtracts a double from another 
double and
returns a double. When I try to add a=4, b=2 I get a nonsense answer 
that
changes every time. Also ulink doesn't work at all nor does dllinfo 
although

I can examine the dll using dumpbin.


TestDLL1.zip 

TestDLL1.sce 





--
View this message in context:
http://mailinglists.scilab.org/Scilab-users-Interfacing-to-third-party-DLLs-tp4035330p4035379.html
Sent from the Scilab users - Mailing Lists Archives mailing list
archive at Nabble.com.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/usersextern "C"
{
#include "DLLtest1.h"
}

void Add(double* a, double* b, double* c)
{
	*c = *a + *b;
}

void Sub(double* a, double* b, double* c)
{
	*c = *a - *b;
}
#ifndef _DLL_TUTORIAL_H_
#define _DLL_TUTORIAL_H_

void Add(double* a, double* b, double* c);
void Sub(double* a, double* b, double* c);

#endif
//build
//use your path
cd d:\testDLL1;

//ilib_for_link export all symbols
ilib_for_link("TestDLL1", "DLLtest1.cpp", [], "-I.");

//link with scilab
Test_Functions= ["Add", "Sub"];
Test_Path = "libTestDLL1.dll";
Test_Lib = link(Test_Path, Test_Functions, 'c');

link("show")

a=4;
b=2;
c=0;
d=size(c);

c = call("Add", a, 1, "d", b, 2, "d", "out", d, 3, "d");
assert_checkequal(c, a + b);

c = call("Sub", a, 1, "d", b, 2, "d", "out", d, 3, "d");
assert_checkequal(c, a - b);

ulink(Test_Lib);
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Visual Studio 2015

2017-01-16 Thread antoine . elias

Hello James,

You can use VS 2015 to build your toolbox but to distribute it you need 
to provide runtime libraries
or install VS 2015 runtime on target computer. 
(https://www.microsoft.com/en-us/download/details.aspx?id=48145)

Scilab 6 beta 2 provides only VS 2013 runtime libraries

At Scilab start, call findmsvccompiler() to get version that Scilab 
found.
If VS 2013 pro is found (msvc120pro [1]) , Scilab always use it to avoid 
compatibility trouble.
You can force Scilab to use another MS compiler by setting environment 
variable "SCILAB_PREFERED_MSVC" ( with misspelling ^^ )


setenv("SCILAB_PREFERED_MSVC", "msvc140pro"); //to set VS 2015 pro as 
c/c++ compiler


Antoine

[1] relation entre la version du compiler et celle de Visual Studio
MSVC++ 10.0 (Visual Studio 2010)
MSVC++ 11.0 (Visual Studio 2012)
MSVC++ 12.0 (Visual Studio 2013)
MSVC++ 14.0 (Visual Studio 2015)


Le 2017-01-16 12:37, James Holland a écrit :
Will Scilab 6 beta 2 work with Visual Studio 2015? I currently have 
Visual
Studio 2013 Express but the SDK, which I need to create 64-bit DLLs, 
will

only work with the Professional version, if I have to upgrade then 2015
would be a better option.



--
View this message in context:
http://mailinglists.scilab.org/Visual-Studio-2015-tp4035364.html
Sent from the Scilab users - Mailing Lists Archives mailing list
archive at Nabble.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] Scilab 6.0 Beta 2 - Load/save bug

2016-11-04 Thread antoine . elias

Hi guys,

Scilab 6 can load data from Scilab 5 if data were saved as SOD files

In Scilab 5 :
a = 1;
save(home + "/myfile.sod", "a"); // use "" on variable to save in SOD 
format instead of old format.


In Scilab 6 :
load(home + "/myfile.sod");
a == 1

Antoine

Le 2016-11-04 11:53, BBoillot a écrit :

Hi Rafael,

I'll do that.

Thank you



--
View this message in context:
http://mailinglists.scilab.org/Scilab-6-0-Beta-2-Load-save-bug-tp4034909p4034911.html
Sent from the Scilab users - Mailing Lists Archives mailing list
archive at Nabble.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] Invalid index?

2016-03-31 Thread antoine . elias

Hello,

Confirmed, failed on Scilab 5.5.2 but works in Scilab 6 beta 1

You can do that to by pass the problem :

god.vars = [];
for i=1:11
disp(i);
god.vars = [god.vars, uicontrol(god.frame1, 'style', 'text', 
'string', god.labels(i), 'position', [i*60 - 8 + fudge, 30, 10, 20 ])];

end

or

for i=1:11
disp(i);
uicontrol(god.frame1, 'style', 'text', 'string', god.labels(i), 
'position', [i*60 - 8 + fudge, 30, 10, 20 ]);

end

god.vars = god.frame1.children;



Le 2016-03-30 15:48, scilab.20.browse...@xoxy.net a écrit :

This one has me baffled!

If I run this code:
...
god.vars = [];
for i=1:11
disp(i);
god.vars(i)  = 1; // uicontrol( god.frame1, 'style', 'text',
'string', god.labels(i), 'position', [ i*60 - 8 + fudge, 30, 10, 20 ]
);
...
end

It completes without error.

But if I uncomment the uicontrol:

god.vars(i)  = uicontrol( god.frame1, 'style', 'text', 'string',
god.labels(i), 'position', [ i*60 - 8 + fudge, 30, 10, 20 ] );

The assignment to god.vars(i) works when i == 1;, but fails when i ==
2 as follows:

-->exec('C:\test\poly.sce', -1)

1.

2.
god.vars(i)  = uicontrol( god.frame1, 'style', 'text', 'string',
god.labels(i), 'position', [ i*60 - 8 + fudge, 30, 10, 20 ] );

!--error
21
Invalid index.
at line  43 of exec file called by :
exec('C:\test\poly.sce', -1)

I've eliminated the only other index usage (god.labels(i)) as a 
problem;


so why can it assign to god,vars(1) and not to god.vars(2)?

Thanks Buk.


FREE 3D EARTH SCREENSAVER - Watch the Earth right on your desktop!
Check it out at http://www.inbox.com/earth



___
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 replicate what "load" does (aka creating variable in the current workspace from inside a function)

2016-02-23 Thread antoine . elias

Hi users,

Just to explain, why "who" change.
Previous implementation of "who" was stack dependant, so when you ask 
local variables names,
Scilab 5 reads the stack from bottom to top ( or the opposite ), and 
returns list of variables it found.


Now in Scilab 6, we have remove this stack ( i'm sure you already know 
that ^^ ).

And we use map to store local variables names.
maps are pretty fast but do not ensure order of elements.
"who" returns a list of local variables names, that's all.

The alphabetical order is a side effect of implementation like creation 
order was in Scilab 5.
If we use another system to store local variables names, we can get 
another output.


So please, do not use "alphabetical" order without "sorted" argument. It 
may change in future.



Antoine
ps: I'm pretty sure that "who"'s help page does not say "'who' returns 
variables names in creation order."


Le 2016-02-22 12:51, Antoine Monmayrant a écrit :

Not sure if it is related to `who` or to the special use of `resume`.


I can confirm that it comes from the bug in who for scilab 6.0.
See also my solution that uses 'resume' and not 'who' and work in both
5.5 and 6.0

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


Re: [Scilab-users] nightly builds of scilab 6 ?

2015-09-16 Thread Antoine ELIAS
Hello Stéphane,

We have some troubles with documentation generation that prevent nightly builds 
release.
I hope we can solve it quickly.

Thank you for reporting
Antoine

Le 16/09/2015 14:46, Stéphane Mottelet a écrit :
> Hello,
>
> When will be recent nighty builds of Scilab 6 available ? Some important bugs 
> have been fixed since the alpha version so it would be nice to benefit from 
> these fixes.
>
> S.
>


-- 
Antoine ELIAS
Software developer
---
Scilab Enterprises
143bis rue Yves Le Coz - 78000 Versailles
Phone: 01.80.77.04.70
http://www.scilab-enterprises.com

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


Re: [Scilab-users] Help write simple GUI

2014-06-01 Thread Antoine ELIAS
Hi Claus,

For small dialogs to ask inputs, use *x_mdialog* function ( 
http://help.scilab.org/docs/5.5.0/fr_FR/x_mdialog.html )

function result = compute_voltage()
txt = ['Power (Watt)';'Impedance (ohm)'];
values = *x_mdialog*('System values',txt,['100';'8'])
if values  [] then
w = values(1);
o = values(2);
w = eval(w);
o = eval(o);

if typeof(w)  constant | int(w)  w | typeof(o)  constant | 
int(o)  o then
error(bad value, integer values expected);
end

result = sqrt(w * o);
else
result = [];
end
endfunction

voltage = compute_voltage()

Antoine


Le 31/05/2014 22:01, Claus Futtrup a écrit :
 Hi there

 I hope someone can help me make a simple GUI front end to my script, 
 preferably without using GUI Builder or guimaker, because I think I'll 
 understand better without using additional tools.

 The GUI - a window containing two variable input:
 1. text + input box + text
Again the input is a number, typically an integer (as in system power : 
 100 Watt). 100 being the user variable input.
 2. text + input box + text
A number, typically an intereger (as in impedance : 8 ohm). 8 being the 
 user variable input.

 The script will then based on 100 Watt into 8 ohm calculate the voltage = 
 sqrt(100*8). I will round the number to one decimal, convert it to a string 
 and create an answer, like Input level : 28.3
 Volt.

 The GUI should contain two buttons, e.g. an OK + a QUIT button. The OK button 
 runs the calculations. The quit button quits the script (may as well quit 
 Scilab).

 I've studied the GUI controls in Scilab already and I understand the the old 
 way of making a new window is:

 f = figure();

 but it seems there's a new command in Scilab 5.5.0:

 f = createWindow();

 The new method probably has its advantages, but the Scilab manual doesn't 
 really explain... can anybody explain to me?

 Can you use the same uicontrol commands with both methods? (can I use 
 examples found on the internet using figure and just replace figure with 
 createWindow?). It seems to me that the examples in
 the createWindow gives uicontrol some inputs named units - normalized - 
 etc. - which are not present when looking at old figure() examples.

 My next question will be, how do I create a uicontrol which accepts a string 
 input (as I need 2 of those). The uicontrol documentation says the Edit 
 style will do that. Funny, but also a bit
 strange, that you can find all sorts of examples for using uicontrol with 
 checboxes, listboxes, radiobuttons, pushbuttons, tables etc. - but no 
 examples are provided with this most useful editable
 string input ... (???)

 ... hereafter I expect to evaluate the two strings (or if they're returned as 
 numbers, that's fine of course, I just don't need the script to crash if 
 something is not right). Then execute my code.

 Best regards,
 Claus

 ---
 This email is free from viruses and malware because avast! Antivirus 
 protection is active.
 http://www.avast.com

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


-- 
Antoine ELIAS
Software developer
---
Scilab Enterprises
143bis rue Yves Le Coz - 78000 Versailles
Phone: 01.80.77.04.70
http://www.scilab-enterprises.com

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


Re: [Scilab-users] Scilab-5.5.0-beta-1 crashes at startup

2013-10-04 Thread Antoine ELIAS
Hello Christophe,
Thank you for report.
I think we have found the trouble with 64 bits version on Windows XP 64 bits.
Can you try with the next nightly build ?

Regards,

Le 03/10/2013 09:14, Dang, Christophe a écrit :
 Hello,

 De la part de Serge Steer
 Envoyé : mercredi 2 octobre 2013 18:57

 For information, under SuSe12.3 on a 64 bits processor I obtain the
 following trace at startup
 I'm under Microsoft Windows XP Pro 64 bits
 (5.2.3790 Service Pack 2 Nu 3790)
 and I also couldn't start the 64 bits version of 5.5.0-beta

 Running the 32 bits version is OK

 Best regards



-- 
Antoine ELIAS
Software developer
---
Scilab Enterprises
143bis rue Yves Le Coz - 78000 Versailles
Phone: 01.80.77.04.70
http://www.scilab-enterprises.com

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


Re: [Scilab-users] Converting a matrix of string into real

2013-03-05 Thread Antoine ELIAS
You can use msscanf function too
http://help.scilab.org/docs/5.4.0/en_US/mfscanf.html

sample :

//your data
dataIn = string(rand(500,500));
typeof(dataIn)
size(dataIn)

//convert to double
tic();
dataOut = matrix(msscanf(-1, dataIn, %f), size(dataIn));
disp(convertion time :  + string(toc()));
typeof(dataOut)
size(dataOut)

Antoine

Le 05/03/2013 11:09, Adrien Vogt-Schilb a écrit :
 hi

 my mistake

 the function name is csvTextScan

 http://help.scilab.org/docs/5.4.0/en_US/csvTextScan.html

 On 05/03/2013 11:06, Carrico, Paul wrote:
 Thanks .. but is it in an Atoms package ? I failed in finding it on the web 
 site and the function seems not to be defined in Scilab (5.4.0)
  
 Paul

 
 *De :* users-boun...@lists.scilab.org 
 [mailto:users-boun...@lists.scilab.org] *De la part de* A. Vogt-Schilb
 *Envoyé :* mardi 5 mars 2013 10:12
 *À :* International users mailing list for Scilab.
 *Objet :* Re: [Scilab-users] Converting a matrix of string into real

 Hi

 csvStringtodouble

 Sent from my phone

 Carrico, Paul paul.carr...@esterline.com wrote:

 Dear All
  
 After reading a text file (mgetl), removing the comments, I've finally a 
 matrix of string containing only numbers... what is the fastest way to 
 convert those string into reals (I don't remember)?
  
 using eval function is quite slow
  
 Thanks
  
 Paul
 


 Le présent mail et ses pièces jointes sont confidentiels et destinés à la 
 personne ou aux personnes visée(s) ci-dessus. Si vous avez reçu cet e-mail 
 par erreur, veuillez contacter immédiatement l'expéditeur et effacer le 
 message de votre système. Toute divulgation, copie ou distribution de cet 
 e-mail est strictement interdite.

 This email and any files transmitted with it are confidential and intended 
 solely for the use of the individual or entity to whom they are addressed. 
 If you have received this email in error, please contact the sender and 
 delete the email from your system. If you are not the named addressee you 
 should not disseminate, distribute or copy this email.




 ___
 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


-- 
Antoine ELIAS
Software developer
---
Scilab Enterprises
143bis rue Yves Le Coz - 78000 Versailles
Phone: 01.80.77.04.70
http://www.scilab-enterprises.com

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


Re: [Scilab-users] C compiler

2013-02-01 Thread Antoine ELIAS
Sweet mailer ...

function vcPath64 = dlwGet64BitPath()
vcPath64 = [];
programFilesx86Path = getenv('ProgramFiles(x86)', '');
if (programFilesx86Path  '') then
if isfile(programFilesx86Path + '\Microsoft Visual Studio
10.0\VC\bin\amd64\cl.exe') then
vcPath64 = programFilesx86Path + '\Microsoft Visual Studio
10.0';
end
end
endfunction

MSVCBIN64PATH = dlwGet64BitPath() + filesep() + 'VC\bin\amd64'

Antoine

Le 01/02/2013 10:09, Antoine ELIAS a écrit :
 Hello Pete,

 I'm under Win8 64Bits, Scilab 5.4.0, VS2010 Pro and I got :

 --msvc = findmsvccompiler()
  msvc  =msvc100pro  
  
 --bOK=configure_msvc()
  bOK  = T 
  
 --bOK=haveacompiler()
  bOK  = T 
  

 Can you try to execute the following code please ?

 function vcPath64 = dlwGet64BitPath()
 vcPath64 = [];
 programFilesx86Path = getenv('ProgramFiles(x86)', '');
 if (programFilesx86Path  '') then
 if isfile(programFilesx86Path + '\Microsoft Visual Studio
 10.0\VC\bin\amd64\cl.exe') then
 vcPath64 = programFilesx86Path + '\Microsoft Visual Studio
 10.0';
 end
 end
 endfunction

 MSVCBIN64PATH = dlwGet64BitPath() + filesep() + 'VC\bin\amd64'

 Antoine

 Le 01/02/2013 09:28, pepe a écrit :
 Hello all,

 I want to get running C compiler via Scilab. I have installed MS Visual
 Studio C++ 2010 Express. I run Win 8 - 64b and Scilab 5.4.0 - 64b.

 msvc = findmsvccompiler()
 msvc100express

 bOK=configure_msvc()
 T

 but 
 bOK=haveacompiler()
 F

 Can you please help how to configure C compiler under Scilab correctly to be
 able to compile? 


 Thanks
 Pete





 --
 View this message in context: 
 http://mailinglists.scilab.org/C-compiler-tp4025856.html
 Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
 Nabble.com.
 ___
 users mailing list
 users@lists.scilab.org
 http://lists.scilab.org/mailman/listinfo/users



-- 
Antoine ELIAS
Software developer
---
Scilab Enterprises
143bis rue Yves Le Coz - 78000 Versailles
Phone: 01.80.77.04.70
http://www.scilab-enterprises.com

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


Re: [Scilab-users] C compiler

2013-02-01 Thread Antoine ELIAS
Can you show me the script output ?

the same without line wrap, I hope.

function vcPath64 = dlwGet64BitPath()
vcPath64 = [];
programFilesx86Path = getenv('ProgramFiles(x86)', '');
if (programFilesx86Path  '') then
if isfile(programFilesx86Path + '\Microsoft Visual Studio 
10.0\VC\bin\amd64\cl.exe') then
vcPath64 = programFilesx86Path + '\Microsoft Visual Studio 10.0';
end
end
endfunction

MSVCBIN64PATH = dlwGet64BitPath() + filesep() + 'VC\bin\amd64'


Le 01/02/2013 11:42, pepe a écrit :
 Unfortunately suggested procedure does not help.  

 Note:
 I have installed  MS VC++ 2010 Express, There is recommended a Windows SDK
 7.1 but 
 I can't install and no idea why always finishes with failure.




 --
 View this message in context: 
 http://mailinglists.scilab.org/C-compiler-tp4025856p4025860.html
 Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
 Nabble.com.
 ___
 users mailing list
 users@lists.scilab.org
 http://lists.scilab.org/mailman/listinfo/users


-- 
Antoine ELIAS
Software developer
---
Scilab Enterprises
143bis rue Yves Le Coz - 78000 Versailles
Phone: 01.80.77.04.70
http://www.scilab-enterprises.com

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