Ameba Ownd

アプリで簡単、無料ホームページ作成

Scilab script files

2022.01.19 02:49




















Create List Scilab gateway Double reading Scilab gateway Double writing Scilab gateway Get child item Scilab gateway Item Number Scilab gateway Integer reading Scilab gateway Integer writing Scilab gateway Pointer reading Scilab gateway Pointer writing Scilab gateway Polynomial reading Scilab gateway Polynomial writing Scilab gateway Sparse reading Scilab gateway Sparse writing Scilab gateway String reading Scilab gateway String writing Scilab gateway Variable Reference Scilab gateway Variable dimension Scilab gateway Variable Type Scilab gateway Variable Complexity Scilab gateway Matrix Type Scilab gateway Integer Precision Scilab gateway Polynomial Symbolic Variable Scilab gateway Sparse matrix reading Scilab gateway Online help management Description abort interrupts current evaluation and gives the prompt.


Within a pause level abort return to level 0 prompt. Parameters title a character string, the demo title path a character string, the path of the scilab script associated with the demo. Description This function adds a new entry in the demos list.


The demo should be executed by a Scilab script file. If the given title already exists in the demo list associated with the same file nothing is done. The function checks if the file exist.


Description ans means "answer". Variable ans is created automatically when expressions are not assigned. Variable ans is not protected by predef. Description This function is used inside a function definition. It gives the number of actual inputs arguments rhs and output arguments lhs passed to the function when the function is called. It is usually used in function definitions to deal with optional arguments.


Description Backslash denotes left matrix division. If A is not square, x is a least square solution. B is an operator with no predefined meaning. These variables can be used to define matrices of booleans, with the usual syntax. Boolean variables can be used for indexing matrices or vectors. Boolean sparse matrices are supported. Name brackets [,] left and right brackets [a11,a12, Parameters a11,a12, Description Left and right brackets are used to note vector and matrix concatenation.


These symbols are also used to denote a multiple left-hand-side for a function call Inside concatenation brackets, blank or comma characters mean "column concatenation", semicolon and carriage-return mean "row concatenation". Note : to avoid confusions it is safer to use commas instead of blank to separate columns.


Within multiple lhs brackets variable names must be separated by comma. Examples [6. Description This command kills variables which are not protected. It removes the named variables from the environment.


By itself clear kills all the variables except the variables protected by predef. Thus the two commands predef 0 and clear remove all the variables. Normally, protected variables are standard libraries and variables with the percent prefix. Note the particular syntax clear a and not clear a. Description clearfun 'name' removes the primitive 'name' from the set of primitives built-in functions. This function allows to rename a primitive : a Scilab primitive can be replaced by a user-defined function.


For experts Name clearglobal kills global variables clearglobal clearglobal nam Description clearglobal kills all the global variables. Description Colon symbol : can be used to form implicit vectors.


Description Commas are used to separate parameters in functions or to separate entries of row vectors. Blanks can also be used to separate entries in a row vector but use preferably commas. Also used to separate Scilab instructions. Use ; to have the result not displayed on the screen.


The slashes as well as all the following characters up to the end of the lines are not interpreted. Inside a function, the first comment lines, up to the first instruction or an empty line may be used to provide the default contents for the function help. Parameters function a scilab function, not compiled type 11 opt flag with value 0 default , 1 or 2. Description comp function compiles the function function. Compiled and interpreted functions are equivalent but usually compiled functions are much faster.


The functions provided in the standard libraries are compiled. The online definition as well as the short syntax of the commands exec and deff generate compiled functions. So comp has to be used in very particular cases.


Note: the compilation takes part "in place", i. These operators apply to any type of operands. These operators apply only to real floating point and integer arrays. The semantics of the comparison operators also depend on the operands types: With array variables like floating point and integer arrays, logical arrays, string arrays, polynomial and rationnal arrays, handle arrays, lists If a and b evaluates as arrays with same types, but a or b is a 1 by 1 array the scalar is compared with each element of the other array.


The result is an array of booleans of the size of the non scalar operand. Description Inside a for or while loop, the command continue passes control to the next iteration of the loop in which it appears, skipping any remaining statements between this instruction and the loop's end instruction. Description For the values 0,1,2,3,4 of level-int , debug defines various levels of debugging. This is targeted to the parser, not to Scilab scripts, and is for Scilab experts only.


Description Deletes the breakpoint at line linenumb in the function macroname. Line numbers in linenumb are physical line numbers in function macroname. Note that Scilab versions before 5. The difference between physical and logical line numbers is the number of continued lines see dot.


If linenumb is omitted, all the breakpoints in function macroname are deleted. If both macroname and linenumb are omitted, all breakpoints in all functions are deleted.


Examples setbpt 'foo',1 ,setbpt 'foo',10 ,delbpt 'foo',10 ,dispbpt delbpt 'foo',1 ,dispbpt setbpt 'foo1',4 ,setbpt 'foo1',9 ,setbpt 'foo2',6 ,setbpt 'foo3',8 ,dispbpt delbpt 'foo2' ,dispbpt delbpt ,dispbpt delbpt 'foo',[1,2,5,6] ,dispbpt.


Description dispbpt displays all active breakpoints currently inserted in functions. The line numbers displayed by dispbpt are physical line numbers in the mentioned functions. Description May be used inside for pr while instructions to separate the loop variable definition and the set of instructions. Dot is used to mark decimal point for numbers : 3.


Element-by-element multiplicative operations are obtained using. Kronecker product is noted. Note that when dot follows a number it is alway prt of the number so 2. Continuation mark. Two or more decimal points at the end of a line or followed by a comment causes the following line to be a continuation. Continuation lines are handled by a preprocessor which builds a long logical line from a sequence of continuation lines. So the continuation marks can be used to cut a line at any point.


The following function foo:. The logical line formed by physical line 3 and physical line 4 is built as if it was entirely written in the physical line 4 while physical line 3 would be empty. This is done this way because continuation marks can be put anywhere even inside an expression. Description If functionname is the name of a defined scilab function edit functionname try to open the associated file functionname.


If functionname is the name of a undefined scilab function edit create a functionname. Description [] denotes the empty matrix. It is uniquely defined and has 0 row and 0 column, i. Empty linear systems syslin lists may have several rows or columns. Description Used at end of loops or conditionals. Name errcatch error trapping errcatch n [,'action'] [,'option'] errcatch. Description errcatch gives an "action" error-handler to be performed when an error of type n occurs.


This option is useful for debugging purposes. Use whereami to get information on the current context. It is possible to check if an error has occured using the iserror function.


Do not forget to clear the error using the errclear function as soon as possible This option is useful for error recovery. In many cases, usage of errcatch n,"continue",.. To set back default mode, enter errcatch -1,"kill" errcatch The errcatch actions apply to the current evalution context function, exec, pause and all the sublevels. A second errcatch call in a sub-level hides the initial one for this sub-level. If a second errcatch call is made at the same level, the effect of the first one is removed.


When called in the context of a Scilab function or exec the errcatch is automatically reset when the function returns. Description clears the action error-handler connected to error of type n. If n is positive, it is the number of the cleared error ; otherwise all errors are cleared default case. Parameters message a character string. The error message to be displayed.


The number associated with the error message pos an integer. Description error function allow to issue an error message and to handle the error. By defaut error stops the current execution and resume to the prompt level.


This default can be changed using the errcatch or execstr The number associated with the error message is error message,n prints the character string contained in message.


The number associated with the error message is given by n. This number should be greater than In this case the pos argument must be used error n,pos to give the parameter value. In the other cases the pos argument is ignored. Description This page gives the table of the predefined error messages, and their associated error number. Some of these error messages are used by Scilab itself for parser errors or specific builtin errors.


Some others are of a more general use and can be used in Scilab functions. The starred one are those for which the syntax error n,pos is handled. Use stacksize function to increase it. Parameters Z matrix of character strings M or list M,Subexp M matrix of character strings Subexp vector of character strings H matrix ierr integer, error indicator. Description Returns the result of the evaluation of the matrix of character strings M. Each element of the matrix must define a valid Scilab expression.


Parameters name a character string where an optional character with possible values: 'l' local , 'n' nolocal and 'a' all. The default value is 'all'. Description exists name returns 1 if the variable named name exists and 0 otherwise. Caveats: a function which uses exists may return a result which depends on the environment! Warning: the exists function does not check if a variable exists in the global namespace.


Examples deff 'foo x ',.. Description Ends the current Scilab session n The exit status shall be n, if specified. Otherwise, the value shall be zero. Description External function or routine for use with specific commands. An "external" is a function or routine which is used as an argument of some high-level primitives such as ode, optim, schur The calling sequence of the external function or routine is imposed by the high-level primitive which sets the arguments of the external.


For example the external function costfunc is an argument of the optim primitive. Its use is precised in the optim help. If other values are needed by the external function these variables can be defined in its environment. Also, they can be put in a list. For example,the external function. An external can also be a Fortran or C routine : this is convenient to speed up the computations.


The name of the routine is given to the high-level primitive as a character string. The calling sequence of the routine is also imposed. External Fortran or C routines can also be dynamically linked see link. Note that in this case index i is valid only if all its entries are equal to one. For matrices with more than 2 dimensions see:hypermatrices the dimensionality is automatically reduced when right-most dimensions are equal to 1.


They allow a recursive extraction without intermediate copies. The instructions [ But if the extraction syntax is used within a function input calling sequence each returned list component is added to the function calling sequence. Note that, l list is the same as l. If i is a vector of booleans it is interpreted as find i. Remarks For soft coded matrix types such as rational functions and state space linear systems, x i syntax may not be used for vector element extraction due to confusion with list element extraction.


Description Used to define loops. Its syntax is: tion,.. Parameters type character string long integer max number of digits default 10 v a vector for the current format v 1 type format : 0 for 'e' and 1 for 'v' v 2 number of digits m a vector to set new format m 1 number of digits m 2 type format : 0 for 'e' and 1 for 'v'.


Description Sets the current printing format with the parameter type ; it is one of the following : "v" for a variable format default "e" for the e-format. It is no more the case, the clean function can be used to set neglitible entries to zeros. Description Scilab functions are variable, funcprot allows the user to specify what scilab do when such variables are redefined. Parameters name a string, the name of a primitive numptr the internal routine number of the primitive.


Description Utility function for experts only to get the internal routine number numptr of the primitive 'name'. Description getdebuginfo get information about Scilab to debug. Parameters res md5 result string filename filename string or matrix of strings ParamString string or matrix of strings. Description getmemory returns free system memory kilo-octets.


Description returns scilab mode. STDThe standard Scilab gui, plot NWScilab in command line with the plots. NWNIScilab in command line without any graphics. Description return in svariable names on scilab stack. Variables are sorted by alphabetical order. Examples getvariablesonstack getvariablesonstack 'local' getvariablesonstack 'global'.


Description return in version the Scilab version name and in opts build options which can be used to determine if scilab has been build with pvm, tk or modelicac and give release date and time. Name global Define global variable global 'nam1', Description Ordinarily, each Scilab function, has its own local variables and can "read" all variables created in the base workspace or by the calling functions.


Any assignment to that variable, in any function, is available to all the other functions declaring it global. If the global variable doesn't exist the first time you issue the global statement, it will be initialized to the empty matrix.


Parameters n integer, the required global stack size given in number of double precision words sz 2-vector [total used]. Description Scilab stores gobal variables in a stack gstacksize n allows the user to increase or decrease the size of this stack. The maximum allowed size depends on the amount of free memory and swap space available at the time.


Description Exponentiation of matrices or vectors by a constant vector. If A is a vector or a rectangular matrix the exponentiation is done element-wise, with the usual meaning. For square A matrices the exponentiation is done in the matrix sense. For boolean, polynomial and rational matrices, the exponent must be an integer. Remarks In such cases dot is part of the operator, not of the number.


Description ieee returns the current floating point exception mode. The initial mode value is 0. Remarks Floating point exception arising inside some library algorithms are not yet handled by ieee modes. Name if then else conditional execution if expr1 then statements elseif expri then statements Description The if statement evaluates a logical expression and executes a group of statements when the expression is true.


The expri are expressions with numeric or boolean values. If expri are matrix valued the condition is true only if all matrix entries are true or different from zero. The optional elseif and else provide for the execution of alternate groups of statements.


An end keyword, which matches the if, terminates the last group of statements. The line structure given above is not significant, the only constraint is that each then keyword must be on the same line as its corresponding if or elseif keyword.


The keyword then can be replaced by a carriage return or a comma. Parameters x matrix of any kind constant, sparse, polynomial, Description MATRIX CASE if x is a matrix the indices i and j, may be: Real scalars or vectors or matrices In this case the values given as indices should be positive and it is only their integer part which taken into account.


If i or j maximum value exceed corresponding x matrix dimension, array x is previously extended to the required dimensions with zeros entries for standard matrices, 0 length character string for string matrices and false values for boolean matrices. If i maximum value exceed size x,1 , x is previously extended to the required dimension with zeros entries for standard matrices, 0 length character string for string matrices and false values for boolean matrices.


The : symbol the : symbol stands for "all elements". They allow a recursive insertion without intermediate copies. The l k Remarks For soft coded matrix types such as rational functions and state space linear systems, x i syntax may not be used for vector entry insertion due to confusion with list entry insertion.


Parameters fun integer an interface number see funptr funs integer vector, vector of interface number see funptr. Description The interface programs may be written in 2 different ways for the mode of function argument passing. In the first and default way, the arguments are passed by value. With the following syntax:. In the second way arguments may be passed be reference if there are "named arguments" no copy of the variable value is done. Warning, declaring that the interface with number fun can handle arguments passed by reference if it is not the case should produce unpredictable results.


This function may be useful for dynamically loaded interface see addinter. Parameters C big matrix of the coefficients d Polynomial matrix degree. Description tests if error number n has occurred after a call to errcatch.


Description isglobal x returns true if x has been declared to be a global variable and false otherwise. Parameters str vector of character strings or an empty matrix. The last recorded error message. Description Each time an error occurs, the Scilab error handler records it in an internal table only the last one is retained.


The lasterror function allows to get the message, the error number, the current function if any and the current line number in the current function out of this table. The reported line number is the physical line number where the last error occurred. There is a difference only if the function in error includes continued lines see dot before the point where the error happened. This function is especially useful while using errcatch or execstr. Description Left and right brackets are used for vector and matrix concatenation.


These symbols are also used to denote a multiple left-hand-side for a function call Inside concatenation brackets blank or comma characters mean "column concatenation", semicolon and carriage-return mean "row concatenation". Note : to avoid confusions it is safer to use comma instead of blank to separate columns. Description This primitive converts a compiled Scilab function function-name into a list which codes the internal representation of the function reverse polish notation.


The first entry of the list is the function name, the second and third are respectively the vectors of left hand side variables and right hand side variables names. The following entries are either basic operation records either lists with contains the hierachical control structures like if , for, Basic operation records are described by a character string vector whose first element represents the opcode.


Description This primitive converts a compiled Scilab function function-name into a tree imbricated tlists which codes the internal representation of the function. For use with tree2code. Entries eij can be real or complex numbers, polynomials, rationals, strings, booleans. Vectors are seen as matrices with one row or one column.


Parameters v a vector, a matrix or an hypermatrix n,m integers sizes vector of integers y a vector, a matrix or hypermatrix. Please notices that mode does not used at prompt, only in an exec-file or a scilab function. The new variable values are displayed if required. This is the default for exec files. If carriage return follows character "p" the execution is paused see pause. Line display is disabled for compiled scilab function see comp. By default, Scilab functions are executed using the silent "-1" mode.


Description Scilab and Matlab additions and substractions work differently when used with empty matrices: Scilab. Upper and lower case letters are different. Name newfun add a name in the table of functions newfun "function-name",nameptr. Description Utility function for experts only. Adds the name "function-name" in the table of functions known to the interpreter. This function is useful to associate a primitive to a routine interfaced in "matusr. Used with funptr and clearfun one can redefine a primitive by a function with same name.


Name parents left and right parenthesis expression [ Parameters x matrix of any possible type v row or column vector of any possible type l list variable func any function name e1,e2, Within multiple rhs arguments must be separated by comma.


Description Switch to the pause mode; inserted in the code of a function, pause interrupts the execution of the function: one receives a prompt symbol which indicates the level of the pause e. The user is then in a new workspace in which all the lower-level variables and in particular all the variable of the function are available.


To return to the calling workspace enter "return" In this mode, [ Otherwise, the lower-level variables are protected and cannot be modified. The pause is extremely useful for debugging purposes. This mode is killed by the command "abort". Name perl Call Perl script using appropriate operating system executable perl 'perlfile' perl 'perlfile',arg1,arg2, Description perl 'perlfile' calls the Perl script perlfile, using the appropriate operating system Perl executable.


Parameters X,Y scalar or vector or matrix of numbers, polynomials or rationals. It may also be a syslin list str1,str2 a character string, a vector or a matrix of character strings. Description Addition. For numeric operands addition as its usual meaning. If one of the operands is a matrix and the other one a scalar the scalar is added to each matrix entries. Addition may also be defined for other data types through "soft-coded" operations see overloading.


Parameters a matrix or real number vname String, the symbolic variable name. If the string have more than 4 characters only the first 4 are taken into account. Description If a is a matrix, p is the characteristic polynomial i. If v is a vector, poly v,"x",["roots"] is the polynomial with roots the entries of v and "x" as formal variable.


In this case, roots and poly are inverse functions. Note that Infinite roots gives zero highest degree coefficients. Here poly and coeff are inverse functions. Parameters A,t scalar, polynomial or rational matrix.


Description Utility function used for defining "oldest" variables as "protected". Protected variables cannot be killed. They are not saved by the 'save' command. The "oldest" are those appearing last in the who 'get'.


Remarks: Variable ans created automatically when expressions are not assigned is never protected by predef 'all'. Description The quit command has two different meanings depending on the calling context: If there is no pause active, then the quit command makes Scilab terminate, even if the command is called inside a function. If there is a pause active, then the quit command makes aborts the instructions started at this pause level ando terminates the current pause level.


Description quote ' is used for Conjugate Transpose of matrix. Simple ' or double " quotes are also used to define character strings. Character strings are defined between two quotes. A Quote within a character string is denoted by two quotes. The internal representation of a rational is a list. A rational matrix can be defined with the usual syntax e. A rational matrix can also be defined as above as a list tlist ['r','num','den','dt'],num,den,[] with num and den polynomial matrices.


Description get primitives list of a module. Name resume return or resume execution and copy some local variables resume [x1,.. Description In a function resume stops the execution of the function, [.. In pause mode, it allows to return to lower level [.. In an execstr called by a function [..


Name return return or resume execution and copy some local variables return [x1,.. Description In a function return stops the execution of the function, [.. In pause mode, it allows to return to upper level [.. Description This function returns a row vector of character strings containing the arguments of the Scilab command line.


First args entry contains the path of the launched executable file. This function corresponds to the getarg function in C langage. Description -args Arguments If this option is present, arguments are passed to Scilab. They can then be got by sciargs function. For multi arguments passing use a quoted, blank separated sequence of words like: scilab args 'foo1 foo2'. Without this option, unknown arguments will not be accepted. Default display is unix Advise: use this option on a Scilab source tree.


Note that several instructions can be used in with -e. Other possible lang values are 'fr' for french and 'en' for english for compatibility reasons.


The default language is english. This default value is fixed the scilab. On some systems, locales must be compiled to render correctly UTF-8 fonts. Without -ns option the initial stacksize is set by scilab. This option will disable many features in Scilab Only use if you know what you are doing. This option may be used with -f or -e options. From Scilab 5. This mode does not load the Java Virtual Machine faster to start and uses less memory.


Java Virtual Machine options Starting from Scilab 5. In version 5. X and 5. Another way of using Scilab is from the command line. Whatever the operating system is, binaries are located in the directory scilab The -nw option disables the display of the console. The -nwni option launches the nongraphics mode: in this mode, the console is not displayed and plotting functions are disabled using them will generate an error.


This executable corresponds to the icon which is available on the desktop after the installation of Scilab. The second executable is Scilex. With the Scilex. The Scilex. By default, the graphics mode is launched. The scilab script is sensitive to the -nw and -nwni options. There are two extra executables on Linux: scilab-cli and scilab-adv-cli.


The scilab-adv-cli executable is equivalent to the -nw option, while the scilab-cli is equivalent to the -nwni option[7]. In the following Windows session, we launch the Scilex. Then we run the plot function in order to check that this function is not available in the non-graphics mode. The default behavior of Scilab is to wait for new user input: this is why the quit command is used, so that the session terminates.


The following session, executed from the MS Windows terminal, shows how to use the -f option to execute the previous script. Notice that we used the absolute path of the Scilex. To exit, we interactively type the quit statement in the terminal. By default, Scilab provides its messages and its help pages in the English language.


But it can also provide them in French, in Chinese, in Portuguese and in several other languages. The table 15 presents the list of languages supported by Scilab 5. For some of these languages, the help pages of Scilab are partially translated, as indicated in the table. Scilab provides several functions which manages the localization. These functions are presented in the table On Windows, we can use the setdefaultlanguage function, which takes a string representing the required language as input argument.


Then we restart Scilab so that the menus of the console are translated. For example, the following command in the Linux terminal runs Scilab in Japanese:. A visit to any site or page from our web site via these links is done entirely at your own risk. Legal notice: You may not, under any circumstances, resell or reproduce any information for commercial use without the express prior written consent of File-Extensions.


Scripts to automatically harvest results are strictly prohibited due to performance reasons and will result in your IP being banned from this website. Enter any file extension without dot e. Open SCI file Scilab script. SCI file extension - Scilab script. What is sci file? How to open sci files? File type specification: Source code and script file type. The sci file contains script from Scilab. The default software associated to open sci file: SciLab Company or developer: Scilab Enterprises SciLab is an open source software for numerical computation providing a powerful computing environment for engineering and scientific applications available for various platforms.


How to convert: Probably cannot be converted to anything else.