MATLAB Report 1
MATLAB Report 1
MATLAB Report 1
5. Simulink:
o Simulink is a MATLAB-based environment for modeling, simulating, and
analyzing dynamic systems.
Applications of MATLAB
1. Engineering:
o Control systems, signal processing, and robotics.
2. Science:
o Physics simulations, data analysis, and modeling.
3. Finance:
o Risk analysis, portfolio optimization, and algorithmic trading.
4. Machine Learning:
Building and training predictive models.
o
5. Image and Video Processing:
o Object detection, image enhancement, and computer vision.
Starting MATLAB
After logging into your account, you can enter MATLAB by double-clicking on the MATLAB
shortcut icon (MATLAB 7.0.4) on your Windows desktop. When you start MATLAB, a
special window called the MATLAB desktop appears. The desktop is a window that contains
other windows. The major tools within or accessible from the desktop are:
• The Command Window
• The Command History
• The Workspace
• The Current Directory
• The Help Browser
• The Start button
The graphical interface to the MATLAB workspace
When MATLAB is started for the first time, the screen looks like the one that shown in the
Figure 1.1. This illustration also shows the default configuration of the MATLAB desktop. You
can customize the arrangement of tools and documents to suit your needs. Now, we are
interested in doing some simple calculations. We will assume that you have sufficient
understanding of your computer under which MATLAB is being run. You are now faced with
the MATLAB desktop on your computer, which contains the prompt (>>) in the Command
Window. Usually, there are 2 types of prompt:
>> for full version
EDU> for educational version
Note: To simplify the notation, we will use this prompt, >>, as a standard prompt sign, though
our MATLAB version is for educational purpose.
Before we conclude this minimum session, Table 1.1 gives the partial list of arithmetic operators.
M-File Scripts
A script file is an external file that contains a sequence of MATLAB statements. Script
files have a filename extension .m and are often called M-files. M-files can be scripts that
simply execute a series of MATLAB statements, or they can be functions that can accept
arguments and can produce one or more outputs.
Example
Consider the system of equations:
average = (game1+game2+game3)/3
The following shows the command prompt when this script file (saved as example3) is
executed.
>> example3
average =
16
The input command can also be used to assign string to a variable. For more information, see MATLAB
documentation.
A typical example of M-file function programming can be found in a recent paper which related to the
solution of the ordinary differential equation (ODE) [12].
Advantages of MATLAB
1. Ease of Use:
o Intuitive syntax and interactive environment.
2. Rich Library:
o Extensive built-in functions and toolboxes.
3. Visualization:
o High-quality graphs and plots for data representation.
4. Community Support:
o Active user community and extensive documentation.
Conclusion
This report demonstrated four MATLAB programs to solve common mathematical problems.
MATLAB is a versatile tool for numerical computation and problem-solving, and the provided
references can help students and professionals enhance their MATLAB skills.
sum =
100
>>
X=
0.4000 0
0.6000 0
0.8000 0
-0.2000 0
References
1. MATLAB Official Documentation:
https://www.mathworks.com/help/matlab/
Comprehensive documentation for MATLAB functions and features.
2. MATLAB Onramp (Free Interactive Tutorial):
https://www.mathworks.com/learn/tutorials/matlab-onramp.html
A beginner-friendly tutorial to learn MATLAB basics.
3. MATLAB Programming for Engineers (Coursera):
https://www.coursera.org/learn/matlab
A structured course for learning MATLAB programming.
4. MATLAB Central (Community Forum):
https://www.mathworks.com/matlabcentral/
A platform to ask questions and share knowledge with the MATLAB community.