Matlab

Commands in Matlab session

  • Command                   Description
  • CLC                           clearing of command window.
  • CLOSE ALL             Closes all plots.
  • CLEAR                       variables removed from the memory.
  • HELP                         Searches for a topic you need.
  • EXIST                        command used to check for the availability of file or variable.
  • GLOBAL                   Declaration of variables as global.
  • QUIT                          Stops MATLAB session.
  • EPS                                Defining accuracy of floating-point precision.
  • INF                              defined for Infinity.
  • NAN                           not defining a numerical result (not a number).
  • Pi                                The number p.
  • Cd                               useful for changing the current directory.
  • DATE                         present day date is displayed.
  • DELETE                         useful for deleting a File.
  • PRINT                             Prints a plot.
  • AXIS                                Sets axis limits.
  • GRID                         Gridlines will be displayed.
  • PLOT                         plots of x and y axis will be displayed.
  • PRINT                        Prints the plots and saved it to file.
  • TITLE                        To provide text on top of plot.
  • X-LABEL                  x-axis is added with labels.
  • Y-LABEL                  y-axis is added with labels.
  • HOLD                             fix the current plot.
  • FIGURE                    new figure window is created.
  • SUBPLOT                 shows plots in subwindows.
  • STEM                         shows stem plot
  • ONES                          Creates an array of ones.
  • ZEROS                        A zero array is created.
  • %s Format as a string.
  • %d                               Format as an integer.
  • %f  Format as a floating point value.
  • \n                          enter a new line in the output string.
  • \t                           In order to insert a tab in the output string.
  • [ ]                                     Brackets; enclosures array elements.
  • .                                               Symbol is used to define decimal point.
  • +                                      Addition operation
  • –                                               Subtraction operation.
  • *                                              performs Scalar and matrix multiplication.
  • INPUT                            Waits for input by displaying prompt.
  • RESHAPE                      used to change size.
  • DET                                perform determinant of an array.
  • INV                                 perform inverse of a matrix.
  • RAND                           Distributed random elements uniformly.
  • RANDN                         Random elements will be distributed normally.

DELETING ROWS AND COLUMNS:

              Pair of square brackets useful for performing deleting row and column operation. Let begin with

 A = D;

 In order to delete the second column of A, let use the equation as shown

 A (:, 2) = []

This changes A to A = 16    2    13

                                      5     11    8

                                       9     7     12

                                      4     14     1

If you will delete any one element from a matrix, the result will not anymore a matrix. So, expressions like

A (1, 2) = []

 Result in an error. From the above operation we know how to delete a single element, or sequence of elements, and how to change the remaining shape of the elements into a row vector.

So A(2:2:10) = []

Results in X = 1   6   9   2   7    13   12   1

DATA TYPES IN MATLAB:

With the help of different types of data types or classes you can work with you code by creating arrays, table, matrices, floating-point and so on. Matlab combines integers, floats and booleans into one thing: doubles or floating point number.

 Example: >> a = 1.54 % this is a double

                  >> b = a > 1 % Logical (Boolean) double.

Strings. Character arrays will be treated as string matlab.

>>b = ‘abcd’ % NOTE that matlab uses single quotes

>>b (2:3)

Arrays/Matrices of numbers. In order to separate rows we use this operator ‘;‘, or same goes with blank space to separate columns ‘,’.

a= [4 5 6; 1, 2, 3].

Cell array is way to store mixed data or several strings.

d = {‘abcd’, 1, [123], ‘def’

There are 16 fundamental classes in MATLAB. Most of the classes are in the form of an array or a matrix. With the exception of function handles, this matrix or array starts with a minimum of zero in size and it will grow to an n-dimensional array of maximum size. A function will always handle in scalar matrix.

Rajeshwari Chiluveru

Rajeshwari is a Smart TV and connectivity specialist with over 7 years of hands-on experience in troubleshooting real-world device issues. She has worked extensively on diagnosing problems such as WiFi not working, HDMI ARC/eARC failures, app errors, and connectivity issues across platforms like Samsung, Hisense, and Android TV. At Web Vidyalayam, she focuses on creating verified, step-by-step solutions based on practical testing rather than theory. Her goal is to simplify complex technical problems and help users fix their devices quickly and confidently.

Share
Published by
Rajeshwari Chiluveru

Recent Posts

Hisense Smart TV WiFi Not Working? Easy Fixes That Work (2026 Guide)

Introduction: When your Hisense TV won't connect to WiFi, it is rarely a problem with…

1 month ago

Fix Hisense TV Storage Space Running Out: 2026 OS Logic Hub

Hisense Google TV Storage Space Running Out: Why it Happens and How to Fix It…

1 month ago

Samsung Smart TV HDMI ARC/eARC Not Working? Easy Fixes That Actually Work (2026 Guide)

Introduction: "Setting up a soundbar with your Samsung TV should be simple, but the HDMI…

1 month ago

Samsung TV Red Light Blinking? 4 Fixes (2026 Power Logic Hub)

User Problem Scenario: The Red Light "Panic" You press the power button on your Samsung…

2 months ago

Samsung TV Not Connecting to WiFi: 2026 Easy Fix Guide

Introduction: I Know the Feeling "We’ve all been there. You sit down to watch your…

2 months ago

Samsung TV Restarting During Diagnosis? Fix the Reboot Loop Fast

User Problem Scenario: The "Diagnosis Loop" Paradox Imagine you notice your apps are slow. You…

2 months ago