Exp No 00
Exp No 00
Date:21.05.2024
Experiment No: 00
Objective: Gaining experience with MATLAB and Simulink is the aim of this experiment.
Introduction to MATLAB
Command Window: This window allows quick prototyping of small, easily executable
programs by typing and immediately executing statements, which cannot be saved.
Editor script: The Editor (Script) window allows for the execution of larger programs with
multiple statements and complex functions, saved in the '.m' file extension.
Workspace: The Workspace window displays the values of variables created during the
program's editor course.
Command History window : The Command History window displays a log of statements
executed in current and previous MATLAB sessions, including the time, date, and statements
from each session, as well as the exact path of the program file being created.
MATLAB Library offers inbuilt functions for mathematical operations like sine, cosine, and
tangent, as well as complex functions like matrix inverse and determinant. Despite being
encoded in C, C++, and Java, MATLAB is easier to implement, providing an alternative for
vector operations and eliminating multiple statements.
The diagram in the figure shows the main features and capabilities of MATLAB.
MATLAB offers built-in functions for linear algebra computations, data analysis, signal
processing, optimization, and numerical solutions of differential equations. It supports an
external interface for running programs and allows users to write their own functions in the
MATLAB language. MATLAB also provides optional "toolboxes" for primary applications
like symbolic computations, image processing, statistics, control system design, and neural
networks. Its built-in functions are optimized for vector functions, making them faster.
MATLAB System
♦ Development Environment
♦ MATLAB Mathematical Function Library
♦ MATLAB Language
♦ Graphics
♦ MATLAB External Interfaces/API
Introduction to Simulink
Simulink is the platform for Model-Based Design that supports system-level design, simulation,
automatic code generation, and continuous test and verification of embedded systems.
3
Block Diagram Environment: Simulink uses a block diagram approach to model systems.
Users can drag and drop blocks representing different components and connect them to
simulate the behavior of the entire system.
Simulation and Analysis: Simulink allows users to simulate the behavior of models and
analyze the results. It supports various solvers for different types of systems, and users can
visualize simulation results using built-in tools.
Model-Based Design: It enables model-based design, where the system can be designed,
simulated, and tested in a virtual environment before actual implementation. This helps in
identifying and fixing design issues early in the development process.
Automatic Code Generation: Simulink supports automatic code generation for embedded
systems. Models developed in Simulink can be converted into C code for deployment on
hardware such as microcontrollers and DSPs.
Integration with MATLAB: Simulink seamlessly integrates with MATLAB, allowing users
to combine the power of MATLAB's computational capabilities with Simulink's modeling and
simulation environment.
Creating a Model: Start by opening Simulink and creating a new model. Drag and drop blocks
from the library browser to represent the components of your system.
Connecting Blocks: Connect the blocks using lines to define the flow of data between
components. Each block represents a mathematical operation, signal processing function, or
system component.
Simulation: Configure the simulation settings and run the simulation to observe the behavior
of the system over time.
Analysis: Use tools within Simulink to analyze the simulation results, such as plotting signals,
calculating system responses, and identifying system characteristics.
Refinement and Optimization: Iterate our model, refining it based on simulation results to
optimize system performance and behavior.
Component: 1. PC
2. MATLAB
Result and Discussion: MATLAB is a powerful tool for numerical computation, data analysis,
and algorithm development. Its ease of use, extensive library of functions, and visualization
capabilities make it a popular choice for engineers, scientists, and researchers across different
disciplines.
Simulink is a powerful tool for engineers and scientists to design and simulate complex systems
efficiently. It provides a visual and intuitive way to model dynamic systems, making it a
valuable tool for system design and analysis.
Conclusion: This experiment provided a strong basis for future MATLAB and Simulink
exploration and application.