You are on page 1of 11

Umm Al-Qura University

College of Engineering and Islamic


Architecture
Department of Electrical Engineering

EE3001-Engineering Numerical Methods

Lab Work #1: Introduction to MATLAB

Prepared by
Ammar Talq Alsulami

ID: 444007130
Date: 17/02/1445
Objectives:
1. Become familiar with the use of MATLAB.
2. Become familiar with the Command Window and
MATLAB Desktop.
3. Become familiar with numbers and arithmetic
operations, saving and reloading a work, using
help, MATLAB demos, interrupting a running program
and long command lines.

Pre-Lab:
Tick (√) for True and (×) for False
1. MATLAB is a high-performance language for technical
computing.
2. The name MATLAB stands for max laboratory.

Procedure:
1. The Command Window

Figure.1: Using the command window for some functions (addition and sine)
Figure.2: Using the command window to show previous results.

Figure.3: Using the command window to show long format of sine function
results.
Figure.4: Using the command window to show short format of sine function
results.

2. Numbers and arithmetic operations in MATLAB

Figure.5: Using the command window to show numbers with letters.


Figure.6: Using the command window to show numbers with letters.
3- Saving and reloading your work
4- Help
5- Demos
To learn more about MATLAB capabilities you can execute the
demo command in the Command Window or click on Help and
next select Examples and Demos from the pull- down menu.
Some of the MATLAB demos use both the Command and the
Figure windows. To learn about matrices in MATLAB open the
demo window using one of the methods described above. In the
left pane select Matrices and in the right pane select Basic matrix
operations then click on Run Basic matrix Click on the Start >>
button to begin the show. If you are familiar with functions of a
complex variable I recommend another demo. Select
Visualization and next 3-D Plots of complex functions. You can
generate graphs of simple power functions by selecting an
appropriate button in the current window.

6- Interrupting a running program


To interrupt a running program press simultaneously the Ctrl-c
keys. Sometimes you have to repeat pressing these keys a couple
of times to halt execution of your program. This is not a
recommended way to exit a program, however, in certain
circumstances it is a necessity. For instance, a poorly written
computer code can put MATLAB in the infinite loop and this
would be the only option you will have left.
7- Long command lines
Conclusion

1. I learned how to use MATLAB.


2. Getting to know the command window and MATLAB Desktop.
3. Finally, learning about numbers and arithmetic operations, saving and reloading
work, using help, displaying MATLAB, interrupting a running program, and long
command lines.

LAB REVIEW QUESTIONS


Solve the following exercises in your lab report.

1-What is the precision, accuracy, and resolution of your bench instruments.


Accuracy: An instrument’s degree of veracity—how close its measurement comes
to the actual or reference value of the signal being measured.

Resolution: The smallest increment an instrument can detect and display—


hundredths, thousandths, millionths.
Precision: An instrument’s degree of repeatability—how reliably it can reproduce
the same measurement over and over.

2- Discuss the resolution of voltage measurements made with the oscilloscope, i.e., how
many significant digits can you obtain from the scope display?

The precision and accuracy of voltage measurements made with a digital scope are
affected by the speed at which samples are taken, i.e. the sampling rate, and
sampling depth or bit depth. Bit depth is just the number of bits of information in
each sample, and it directly corresponds to the resolution of each sample. It also
relates to the dynamic range of the system, the largest and smallest amplitude
signal that can be digitized.

3- How could this lab assignment be improved?

Collaboration among colleagues

You might also like