• Skip to main content
  • Skip to secondary menu
  • Skip to primary sidebar
  • Skip to footer
Circuits Gallery

Circuits Gallery

All about Electronics and Circuits

  • Home
  • Basics
    • Components
    • Wiring
    • Circuitry
    • Oscilloscope
    • Conductivity
  • Project
    • Using 555 Timer
    • Using Op-Amp
  • MicroController
    • PIC
  • Arduino
  • Simulation
  • Digital
  • Communication
  • How To
  • About Us

Getting Started With MATLAB | How to Create Your First Matlab Project?

March 19, 2022 by Charles Clark Leave a Comment

The name MATLAB stands for MATrix LABoratory. It is the fourth-generation programming language and is developed by Mathworks Inc., USA.

MATLAB is great for doing array manipulation, doing specialized math functions, and creating nice plots quickly. It is a Matrix-based powerful software package for scientific and engineering numerical computation and visualization.

MATLAB

Libraries and SIMULINK

Symbolic computation is one of the features that make MATLAB interesting to work with, apart from the numerous libraries. I also used it for numerical analysis, and in signal processing modeling with SIMULINK. Complex numerical problems can be solved in fractions of time that are required with other high-level languages.

The Magic of .m files

MATLAB provides an interactive environment with thousands of built-in functions. Users can create their own functions too. MATLAB program and script files always have filenames ending with ‘.m’.

Great Visualization From the Easiest of Codes

The programming language is exceptionally straightforward since almost every data object is assumed to be an array. Graphical output is available to supplement numerical results. Figure window gives the display of the figures as the result of the program.

GUI of MATLAB (Different windows in MATLAB)

Command Window

User can enter MATLAB codes in the command window. MATLAB is an Interpreter since it executes line by line manner. Once entered, the code will execute at the next moment itself.

Work Space Window

Work Space window contains the current variables used in the program.

Command History Window

Command History Window contains the previously executed programs. Users can refer to this field for analyzing previous codes

How to enter a Matrix in MATLAB | Getting Started With Matlab Matrices

Let we define a matrix as A=[1 2 3;4 5 6;7 8 9]
The Command window for the above code is shown in the image

Creating script‘.m’ file

In order to write the program as a whole, we can create ‘.m’ files. The codes inside a ‘.m’ file can be executed simultaneously.
To create a new file, go File-> New-> Script or press Cntrl+N. Then write your MATLAB code in the new editor.

Commenting and Uncommenting

You can mask some codes from the execution of the program. Select the code that you want to mask, then right-click on the codes and select ‘Comment’. Then a ‘%’ will appear before each line of codes, those lines are masked while executing the program. To expose masked codes, select the codes and right-click then ‘Uncomment’. After doing so the ‘%’ symbol is disappeared from the editor.

Labeling the Codes

To label a specific code you can use the ‘%’ symbol. The text coming immediately after ‘%’ will not execute. It is also a kind of masking as explained earlier.

Executing Editor Window Codes in Matlab

To execute the codes written in MATLAB, Select all, right-click, then select ‘Evaluate Selection’
Then the whole codes executed in the MATLAB platform

Conclusion

In 2004, MATLAB had around one million users across the world through a substantial fraction was getting started with Matlab. It is widely used in academic and research institutions as well as industrial enterprises. As an additional note to all the above tutorial steps: all commands and the ready-to-run program file name can be typed in the command window to execute them.

Filed Under: Basics, How To

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

More To See

How Far Can You Run Low Voltage Lighting

How Far Can You Run Low Voltage Lighting? Exploring the Limits of Low Voltage Lighting Installations

What is the Difference between RC Coupling and Transformer Coupling

What is the Difference between RC Coupling and Transformer Coupling? In-Depth Guide

Oscilloscope Probe X1 X10 Difference

Oscilloscope Probe X1 X10 Difference | Detection and Compensation of Probes

How to Measure Amps on 240V Circuit With Multimeter

How to Measure Amps on 240V Circuit With Multimeter | Step-By-Step Guide

More About

  • Arduino
  • Basics
  • Circuitry
  • Communication
  • Components
  • Conductivity
  • Digital
  • How To
  • MicroController
  • Oscilloscope
  • PIC
  • Project
  • Simulation
  • Using 555 Timer
  • Using Op-Amp
  • Wiring

Footer

QUICK LINKS

  • About Us
  • Privacy Policy
  • Terms and Conditions
  • Contact

AFFILIATE DISCLOSER

Circuits Gallery is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for website owners to earn advertising fees by advertising and linking to amazon (.com, .co.uk, .ca etc) and any other website that may be affiliated with Amazon Service LLC Associates Program

© 2023 · Circuits Gallery | All Rights Reserved