Esta página aún no se ha traducido para esta versión. Puede ver la versión más reciente de esta página en inglés.

Scripts

Archivos de programa básicos

Los scripts son el tipo de archivo de programa más simple. Estos son útiles para automatizar una serie de comandos de MATLAB®, como cálculos que se deben realizar de forma repetida desde la línea de comandos o series de comandos a los que se tiene que hacer referencia.

Funciones

editEdit or create file
inputSolicitar entrada de usuario
publishGenerate view of MATLAB file in specified format
grabcodeExtract MATLAB code from file published to HTML
snapnowTake snapshot of image for inclusion in published document

Temas

Programas básicos

Create Scripts

Create a script in a new file or from commands in the Command History.

Add Comments to Programs

Add comments to describe your code and allow others to understand it.

Find and Replace Text in Files

Find and replace text in the current file or multiple files. Automatically rename functions or variables.

Improve Code Readability

Use indentation, text-width indication, and code folding to make your code easier to read.

Code Sections

Define code sections within your MATLAB program files to evaluate each section individually.

Open and Save Files in the Editor

Open and save files in the Editor using several different methods.

Agregar entradas y salidas

Scripts vs. Functions

Program files can be scripts that simply execute a series of MATLAB statements, or they can be functions that also accept input arguments and produce output.

Add Functions to Scripts

Add functions to scripts to reuse code within a script and avoid creating and managing separate function files.

Compartir código

Publish and Share MATLAB Code

MATLAB provides options for presenting your code to others, including using publishing and creating live scripts and functions in the Live Editor.

Información relacionada