About 658,000 results
Open links in new tab
  1. Programming and Scripts - MATLAB & Simulink - MathWorks

    A script is a file that contains multiple sequential lines of MATLAB commands and function calls. You can run a script by typing its name at the command line. Scripts

  2. Scripts and Functions in MATLAB - GeeksforGeeks

    Apr 26, 2025 · A script file is an ordinary MATLAB file that could contain any code except a class definition. See the following example which creates and displays a magic square. Example 1:

  3. Scripts - MATLAB & Simulink - MathWorks

    Scripts are the simplest type of program file. They are useful for automating a series of MATLAB ® commands, such as computations that you have to perform repeatedly from the command line or series of commands you have to reference. Create a script in a new file or from commands in the Command History.

  4. Live Script Gallery - MATLAB & Simulink - MathWorks

    Combine code, output, and formatted text in a single executable document. See more community-authored live scripts on the MATLAB File Exchange. Find example live scripts from the MATLAB Community, and create your own using MATLAB Live Editor.

  5. Function with Multiple Inputs in a Script File in MATLAB

    Apr 24, 2025 · Here is an example of a function in a MATLAB script file with numerous inputs: Example 1: The function in this example gives two output arguments, sum, and difference, and accepts two input arguments, x, and y. The function's body calculates the input arguments' sum and difference before assigning the findings to the output arguments. Example 2:

  6. Chapter 4: Writing Scripts – A Guide to MATLAB for ME 160

    Create a script file within MATLAB that can calculate the volume of the room and the surface area of wall #1, wall #2, and the floor, as labeled in the image, by assigning values to variables x, y, and z, and completing arithmetic operations with them. Use …

  7. Scripts in Matlab - Academic Block

    A script in MATLAB is a plain text file that contains a sequence of commands. Scripts are saved with a .m file extension and executed to perform tasks or calculations. They do not accept inputs directly or return outputs like functions but are useful for automating tasks.

  8. Programming with MATLAB: Writing MATLAB Scripts - GitHub …

    Feb 28, 2025 · MATLAB knows about files in the current directory, but if we want to run a script saved in a different location, we need to make sure that this file is visible to MATLAB. We do this by adding directories to the MATLAB path. The path is a list of directories MATLAB will search through to locate files.

  9. MATLAB Scripts - Computer Action Team

    Scripts are collections of MATLAB commands stored in plain text files. When you type the name of the script file at the MATLAB prompt the commands in the script file are executed as if you had typed them in from the keyboard.

  10. Scripts and Functions in Matlab explained with Example Codes

    Dec 8, 2021 · Whenever you are going to perform a specific functionality by using MATLAB code you either go for a MATLAB script or a MATLAB function. MATLAB script is the simplest form of the MATLAB file in which you can write your MATLAB code …

Refresh