Author: admin

  • Operators

    An operator is a symbol that tells the compiler to perform specific mathematical or logical manipulations. MATLAB is designed to operate primarily on whole matrices and arrays. Therefore, operators in MATLAB work both on scalar and non-scalar data. MATLAB allows the following types of elementary operations − Arithmetic Operators MATLAB allows two different types of…

  • Data Types

    MATLAB does not require any type declaration or dimension statements. Whenever MATLAB encounters a new variable name, it creates the variable and allocates appropriate memory space. If the variable already exists, then MATLAB replaces the original content with new content and allocates new storage space, where necessary. For example, The above statement creates a 1-by-1…

  • M-Files

    So far, we have used MATLAB environment as a calculator. However, MATLAB is also a powerful programming language, as well as an interactive computational environment. In previous chapters, you have learned how to enter commands from the MATLAB command prompt. MATLAB also allows you to write series of commands into a file and execute the…

  • Commands

    MATLAB is an interactive program for numerical computation and data visualization. You can enter a command by typing it at the MATLAB prompt ‘>>’ on the Command Window. In this section, we will provide lists of commonly used general MATLAB commands. Commands for Managing a Session MATLAB provides various commands for managing a session. The following…

  • Variables

    In MATLAB environment, every variable is an array or matrix. You can assign variables in a simple way. For example, MATLAB will execute the above statement and return the following result − It creates a 1-by-1 matrix named x and stores the value 3 in its element. Let us check another example, MATLAB will execute the above…

  • Basic Syntax

    MATLAB environment behaves like a super-complex calculator. You can enter commands at the >> command prompt. MATLAB is an interpreted environment. In other words, you give a command and MATLAB executes it right away. Hands on Practice Type a valid expression, for example, And press ENTER When you click the Execute button, or type Ctrl+E,…

  • Environment Setup

    Local Environment Setup Setting up MATLAB environment is a matter of few clicks. The installer can be downloaded from here. MathWorks provides the licensed product, a trial version and a student version as well. You need to log into the site and wait a little for their approval. After downloading the installer the software can be…

  • Overview

    MATLAB (matrix laboratory) is a fourth-generation high-level programming language and interactive environment for numerical computation, visualization and programming. MATLAB is developed by MathWorks. It allows matrix manipulations; plotting of functions and data; implementation of algorithms; creation of user interfaces; interfacing with programs written in other languages, including C, C++, Java, and FORTRAN; analyze data; develop…

  • CLOS

    Common LISP predated the advance of object-oriented programming by couple of decades. However, it object-orientation was incorporated into it at a later stage. Defining Classes The defclass macro allows creating user-defined classes. It establishes a class as a data type. It has the following syntax − The slots are variables that store data, or fields. A slot-description…

  • Error Handling

    In Common LISP terminology, exceptions are called conditions. In fact, conditions are more general than exceptions in traditional programming languages, because a condition represents any occurrence, error, or not, which might affect various levels of function call stack. Condition handling mechanism in LISP, handles such situations in such a way that conditions are used to signal warning…