Вы находитесь на странице: 1из 5

University of San Carlos

Department of Electrical and Electronics Engineering


Name: Neil John Perez
Subject:EE422NL
Schedule: 10:30-1:30/Tue

I.

II.

Date Performed: November 18,2014


Date Submitted: November 25,2014
Remarks:
Experiment#1
Introduction to MATLAB and Simulink

Objectives:
a.) To be acquainted with the MATLAB environment and interface.
b.) To carry out mathematical operations using MATLAB
c.) To carry out matrix functions and operations in MATLAB.
d.) To be able to create plots and graphs using MATLAB.
e.) To be able to distinguish and familiarize the 2 different M-files namely, script and function
files.
f.) To be acquainted with the operations in Simulink.
Report
On the first part of the experiment, MATLAB was opened by clicking the Start menu
and clicking the MATLAB icon. The MATLAB environment is then studied.
The help function is then studied. When the help command was inputted in the
Command Window different help topics then popped up in the said window. The command help
plot is then typed in the Command Window then the statement below appeared showing how the
specific functions works.

On the next part, different mathematical and matrix functions and operations are then carried out
using MATLAB. Different arithmetic and trigonometric functions were carried out like the addition,
square root and the sine. Different matrix operation and functions are then learned like the matrix
addition, subtraction, multiplication and division, matrix transpose, etc. Matrix building functions were
also introduced like the eye which will give us an identity matrix, ones which will give a matrix with
elements that are all ones as well as diag which will give us a diagonal matrix.

The function of the colon : was also learned. The colon can either be used to extract all the
elements in a matrices column/row or it can be used to determine the increment of our row. Matrix
functions are then tackled. det which determines the determinant of tha matrix, inv which finds the
matrixs inverse, size which determines the matrixs size and rank which determines the rank of the
matrix are some of the matrix functions that were introduced in the experiment.
Another very important function, which is the plot, was also introduced. Simply put, the data
that are inputted in the form of matrix can be plotted in a two or three dimensional graph using the plot
function. As an example, the graph that is yielded from the group of statements below

Should appear like this.

The next part of the experiment deals with the so called M-files. It was realized that
knowledge on M-files is very vital in MATLAB, most especially in dealing with complex operations. It
was found that there are two types of M-files. First, the Script M-file consolidates a group of statement
into one statement. An example on how to display a sine wave plot using the Script M-file was being
done. The script file which was done would look like the one below:

Typing sineplot in the


Window would allow a plot
that will appear like:

Command
window to appear

The operation of Simulink is now tackled. Simulink can be opened by typing simulink on
the Command Window, and the Simulink will appear right away. Different parts of the Simulink interface
was learned like the Library Browser which houses the different blocks needed for designing a model. An
activity relating Simulink was done where a Simulink model that will plot the product of two sine waves
was given. The Simulink model would look like this:

Information like amplitude, frequency and phase of the sine wave can be modified by double clicking the
Sine Wave block. Double clicking the scope block after running the model would give you your output
waveform.

Вам также может понравиться