Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
5.4.0 - Français

Change language to:
English - 日本語 - Português - Русский

Please note that the recommended version of Scilab is 2025.0.0. This page might be outdated.
See the recommended documentation of this function

Aide Scilab >> Fonctions avancées > macro

macro

Scilab procedure and Scilab object

Description

Macros are Scilab procedures ("macro", "function" and "procedure" have the save meaning). Usually, they are defined in files with an editor and loaded into Scilab by exec or through a library.

They can also be defined on-line (see deff). A file which contains a macro must begin as follows:

function [y1, ..., yn]=foo(x1, ...,xm)

The yi are output variables calculated as functions of input variables and variables existing in Scilab when the macro is executed. A macro can be compiled for faster execution. Collections of macros can be collected in libraries. Macros which begin with % sign (e.g. %foo) and whose arguments are lists are used to perform specific operations: for example, z=%rmr(x,y) is equivalent to z=x*y when x and z are rationals (i.e. x=list('r',n,d,[]) with n and d polynomials).

See Also

  • deff — on-line definition of function
  • exec — exécution d'un script (fichier de commandes)
  • comp — pré-interprétation ou "compilation" de fonctions Scilab
  • lib — library definition
Report an issue
<< macr2lst Fonctions avancées macrovar >>

Copyright (c) 2022-2024 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Mon Oct 01 17:37:27 CEST 2012