[Scilab-users] Variables visibility in functions

2020-05-07 Thread kjubo
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


[Scilab-users] isreal question

2020-03-06 Thread kjubo
Dear all,

consider this code:

==start of code
clc
clear

a3 =  1
a2 = -1
a1 =  0.106865
a0 = -0.002212
mode(0)
sol = roots([a3 a2 a1 a0])
isreal(sol(1))
isreal(sol(2))
isreal(sol(3))
==end of code

i get this print in console:

  sol  = 

   0.8816333  
   0.0907062  
   0.0276605  
 ans  =

  F
 ans  =

  F
 ans  =

  F

I do not understand, why the isreal return false flag, if all roots are real
with no imaginary part.

I am missing something? Or it is bug?

using Scilab 6.0.2 x64

thank you

BR

J.K.



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


[Scilab-users] c link (mingw)

2019-09-25 Thread kjubo
Dear all,

I am trying to make a c code.
I instaled mingw (from equation.com) and MinGw toolbox from ATOMS.

When I try to use a example code from call help page, I get following error:
(full scilab console print)


Generate a loader file
   Generate a Makefile
   Running the Makefile
   Compilation of fooc.obj
   Building shared library (be patient)

- Compile file fooc.c --
 
!

 
!
x86_64-w64-mingw32-gcc.exe -c -DWIN32 -DSTRICT -DFORDLL -D_MSC_VER
-I"C:/NONINS~1/SCILAB~1.2/libs/MALLOC/includes"!
 -I"C:/NONINS~1/SCILAB~1.2/libs/f2c" -I"C:/NONINS~1/SCILAB~1.2/libs/intl"
-I"C:/NONINS~1/SCILAB~1.2/modules/core/i!
ncludes" -I"C:/NONINS~1/SCILAB~1.2/modules/api_scilab/includes"
-I"C:/NONINS~1/SCILAB~1.2/modules/call_scilab/incl!
udes" -I"C:/NONINS~1/SCILAB~1.2/modules/output_stream/includes"
-I"C:/NONINS~1/SCILAB~1.2/modules/jvm/includes" -I!
"C:/NONINS~1/SCILAB~1.2/modules/localization/includes"
-I"C:/NONINS~1/SCILAB~1.2/modules/dynamic_link/includes" -I!
"C:/NONINS~1/SCILAB~1.2/modules/mexlib/includes"
-I"C:/NONINS~1/SCILAB~1.2/modules/time/includes" -I"C:/NONINS~1/S!
CILAB~1.2/modules/windows_tools/includes"
-I"C:/NONINS~1/SCILAB~1.2/modules/threads/includes" -I"C:/NONINS~1/SCILA!
B~1.2/modules/ast/includes/ast"
-I"C:/NONINS~1/SCILAB~1.2/modules/ast/includes/exps"
-I"C:/NONINS~1/SCILAB~1.2/mod!
ules/ast/includes/operations"
-I"C:/NONINS~1/SCILAB~1.2/modules/ast/includes/parse"
-I"C:/NONINS~1/SCILAB~1.2/modu!
les/ast/includes/symbol"
-I"C:/NONINS~1/SCILAB~1.2/modules/ast/includes/system_env"
-I"C:/NONINS~1/SCILAB~1.2/modu!
les/ast/includes/types"
-I"C:/NONINS~1/SCILAB~1.2/modules/ast/includes/analysis"
-I"C:/NONINS~1/SCILAB~1.2/modules!
/string/includes" -I"C:/NONINS~1/SCILAB~1.2/modules/console/includes" -m64
-D__SCILAB_TOOLBOX__  -DNDEBUG  fooc.c !

 
!
- Link files -- 
 
!

 
!
x86_64-w64-mingw32-g++.exe --shared fooc.o -std=c++11 -L"c:\program
files\gcc\x86_64-w64-mingw32\lib" -LC:\Users\j!
kopac\AppData\Roaming\Scilab\scilab-6.0.2\mingwlib_x64 -lgfortran -lblasplus
-llibf2c -lcore -lcore_f -llapack -lo!
utput_stream -ldynamic_link -linteger -loptimization_f -llibjvm
-lscilocalization -llinpack_f -lcall_scilab -ltime!
 -lapi_scilab -llibintl -last -lfileio -lio -lstring -lthreads -lsciconsole
-lscilab_windows -llibmex  -o libfooc.!
dll  -Wl,--out-implib=libfooc.a -Wl,--export-all-symbols
-Wl,--enable-auto-import !

 
!
C:\Users\jkopac\AppData\Roaming\Scilab\scilab-6.0.2\mingwlib_x64/liblibf2c.a:
file not recognized: File format not!
 recognized 
 
!

 
!
collect2.exe: error: ld returned 1 exit status  
 
!

 
!
Makelib:127: recipe for target 'libfooc.dll' failed 
 
!

 
!
make: *** [libfooc.dll] Error 1 
 
!
at line25 of function dlwCompile(
C:\NONINS~1\SCILAB~1.2\contrib\mingw\010~1.5\macros\windows\dlwCompile.sci
line 34 )
at line70 of function ilib_compile  (
C:\NONINSTALL\scilab-6.0.2\modules\dynamic_link\macros\ilib_compile.sci line
86 )
at line   104 of function ilib_for_link (
C:\NONINSTALL\scilab-6.0.2\modules\dynamic_link\macros\ilib_for_link.sci
line 118 )
at line18 of executed file C:\Users\XXX\Documents\SciLab\c experiment\z
helpu\test_help_call.sce

ilib_compile: Error while executing Makelib


Can anybody help, how to make it works?
(SciLab 6.0.2 on Win 7 PRO, 64 bit)

thanks!

BR
JK



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


[Scilab-users] code coverage

2019-09-18 Thread kjubo
Dear all,

I am not able to find out, how to make a profiling on functions, if they are
nested.
consider this example:

//SCILAB CODE START
clc,clear
function fx = sub1(x1,x2)
fx = x1+x2
fx = fx/x2
endfunction
function fx = sub2(x1,x2)
fx = sub1(x1,x2)
endfunction

nrun = 1e4
covStart("all")
for ii=1:nrun
sub2(10,7)
end
covWrite("html", "TMPDIR/coverage")
covStop()
winopen('TMPDIR/coverage/'+'sub2'+'.html')
winopen('TMPDIR/coverage/'+'sub1'+'.html') //DOES NOT EXIST
//SCILAB CODE END

Is there any trick?

thanks in advance

BR
J.K.



--
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] vector operation replacing for loop

2018-11-07 Thread kjubo



Hello,

precalculate the know values, I gain 40% faster execution time.
Hope helps a bit...

BR

clc, clear, mode(0)

n=1e6
Z=grand(1,n,'nor',0,1);
Z=Z(:);
r=0.9;

tic()
V1=Z;
for ii=2:n;
V1(ii)=r*V1(ii-1)+sqrt(1-r^2)*Z(ii);
end;
toc()

tic()
V2 = Z;
k1 = sqrt(1-r^2).*Z;
for ii=2:n;
V2(ii) = r*V2(ii-1) + k1(ii);
end;
toc()

isequal(V1,V2)




--
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] any suggestion to make my Scilab code faster would be welcome:

2018-05-16 Thread kjubo
Hello,

d = zeros(n,1);
for ii=1:n;
//SqDist   = (X-X(i))^2 + (Y-Y(i))^2 + (Z-Z(i))^2;
SqDist   = (X-X(ii)).*(X-X(ii)) + (Y-Y(ii)).*(Y-Y(ii)) +
(Z-Z(ii)).*(Z-Z(ii));
SqDist(ii)= [];
d(ii)= sqrt(min(SqDist));
end; 

some comments:
* preallocate matrix
* avoid unnecessary assign of variables (this slow down scilab more than
expected)
* as seen in previous meesages here, use X*X instead of X^2

for me speed up factor is ~10

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


[Scilab-users] Scilab 6.0.0 vs 5.2.2 - performance decrease

2017-04-07 Thread kjubo
Dear all,

I observed a performance decrease with relatively simple code that use a for
cycles.
bench_1.sci   

Almost everybody is reporting massive speed up in for cycles, but in my case
it is opposite.
In 5.2.2 run time is 10 seconds, while in 6.0.0 is 18 seconds.

Both Scilab versions are 64 bit, Win 7 64 bit.

Can somebody confirm my results?

Thanks in advance.

BR
J.K.



--
View this message in context: 
http://mailinglists.scilab.org/Scilab-6-0-0-vs-5-2-2-performance-decrease-tp4036150.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


Re: [Scilab-users] Restoration error (5.2.2-64bit)

2016-04-25 Thread kjubo
Dear Jan,

thanks, this helps an Scilab now works.
As Scilab is portable (or at least does not need administrator privileges)
I supposed, that all data are stored in AppData. But not (even when I
search for scilab string in whole C:/, windows did not found this
directory).

Thanks for your help.

Best regards

Jakub Kopáč

2016-04-25 21:35 GMT+02:00 JLan [via Scilab / Xcos - Mailing Lists
Archives] <ml-node+s994242n4034017...@n3.nabble.com>:

> Have you tried to delete your configuration files?  Could be here:
> C:\Users\NN\AppData\Roaming\Scilab
> Jan Å
>
> On 25.04.2016 21:13, kjubo wrote:
>
> > Dear all,
> >
> > I encourted a weird problem. After starting to use external monitor with
> my
> > notebook, Scilab stopped to work.
> > I get error messages
> > <http://mailinglists.scilab.org/file/n4034016/scilab_error.png>
> >
> > I had tried reinstall SciLab, but this does not helps.
> >
> > Do you have any idea what can I do, to start using Scilab again?
> >
> > Thanks in advance
> >
> > Jakub Kopáč
> >
> > NOTE: I am using Scilab 5.2.2-x64 on Win7PRO-64bit, without XCOS
> installed
> > and only reference math libraries.
> >
> >
> >
> > --
> > View this message in context:
> http://mailinglists.scilab.org/Restoration-error-5-2-2-64bit-tp4034016.html
> > Sent from the Scilab users - Mailing Lists Archives mailing list archive
> at Nabble.com.
> > ___
> > users mailing list
> > [hidden email] <http:///user/SendEmail.jtp?type=node=4034017=0>
> > http://lists.scilab.org/mailman/listinfo/users
>
> ___
> users mailing list
> [hidden email] <http:///user/SendEmail.jtp?type=node=4034017=1>
> http://lists.scilab.org/mailman/listinfo/users
>
>
> --
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://mailinglists.scilab.org/Restoration-error-5-2-2-64bit-tp4034016p4034017.html
> To start a new topic under Scilab users - Mailing Lists Archives, email
> ml-node+s994242n2602246...@n3.nabble.com
> To unsubscribe from Restoration error (5.2.2-64bit), click here
> <http://mailinglists.scilab.org/template/NamlServlet.jtp?macro=unsubscribe_by_code=4034016=a29wYWMuamFrdWJAZ21haWwuY29tfDQwMzQwMTZ8MTcwMjczNzUxNA==>
> .
> NAML
> <http://mailinglists.scilab.org/template/NamlServlet.jtp?macro=macro_viewer=instant_html%21nabble%3Aemail.naml=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: 
http://mailinglists.scilab.org/Restoration-error-5-2-2-64bit-tp4034016p4034021.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


[Scilab-users] Restoration error (5.2.2-64bit)

2016-04-25 Thread kjubo
Dear all,

I encourted a weird problem. After starting to use external monitor with my
notebook, Scilab stopped to work.
I get error messages
 

I had tried reinstall SciLab, but this does not helps.

Do you have any idea what can I do, to start using Scilab again?

Thanks in advance

Jakub Kopáč

NOTE: I am using Scilab 5.2.2-x64 on Win7PRO-64bit, without XCOS installed
and only reference math libraries.



--
View this message in context: 
http://mailinglists.scilab.org/Restoration-error-5-2-2-64bit-tp4034016.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


[Scilab-users] graphic issue

2013-11-07 Thread kjubo
hello all,

I found a problem with graphics on scilab 5.5 beta1.
when I pass with mouse over some buttons, they apear black, sometimes is
only one button,in other time is all console (see pics).
I found this problem also in last 5.4 branch but not in 5.3 branch. for this
reason I have to use 5.3.
I am using win7 32 bit.
is there any setting which should I set up to eliminate this problem?

any help will be appreciated.

thanks.

Jakub

http://mailinglists.scilab.org/file/n4027790/bug.png 



--
View this message in context: 
http://mailinglists.scilab.org/graphic-issue-tp4027790.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


Re: [Scilab-users] perfomnace decease (scilab 5.4.0-beta3)

2012-09-03 Thread kjubo
it is done.



--
View this message in context: 
http://mailinglists.scilab.org/perfomnace-decease-scilab-5-4-0-beta3-tp4024765p4024784.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


[Scilab-users] perfomnace decease (scilab 5.4.0-beta3)

2012-09-01 Thread kjubo
hello,

im testing performance of scilab with my own file (heat transfer
computation),
which consist of for cycles and if conditions. i found that scilab
5.4(beta3) runs 60% slower than other scilab version. have you any
explanation to this behavior?
(im testing on the same hardware every time, windows OS)
here are my results, attached exec file.

thanks

Jakub Kopáč



results:
//SCILAB BENCHMARK
// heat transfer 2D
//scilab 4.1.2 272sek
//scilab 5.2.2 320sek
//scilab 5.3.0-beta1 295sec
//scilab 5.3.0-beta2 293sec
//scilab 5.3.0-beta3 296sec
//scilab 5.3.0-SSE3  286sec
//scilab 5.3.1   302sec
//scilab 5.3.2-64bit 265sec
//scilab 5.4.0-beta3 483sec

http://mailinglists.scilab.org/file/n4024765/bench_prestup_tepla.sce
bench_prestup_tepla.sce 



--
View this message in context: 
http://mailinglists.scilab.org/perfomnace-decease-scilab-5-4-0-beta3-tp4024765.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