Introduction To MATLAB For Researchers A
Introduction To MATLAB For Researchers A
com
ISSN: 2394-2630
Review Article CODEN(USA): JSERBR
Onwusuru I1, Okolo Chidiebere C1, Uka Chukwuma2, Ohuabunwa Austine1, Nwafor
Chibuikem M1
1
Electronics Development Institute, Awka, Anambra State, Nigeria
2
Federal College Of Education (Technical), Umunze, Anambra State, Nigeria
Abstract This article explainsthe technicalsoftware known as MATLAB and the simulation techniques.
MATLAB has many advantages compared to most conventional computer language for solving technical
problems. Is has an interactive system whose basic data element is an array that does not require dimensioning.
This article gives any user a guide on how to operate the software and simulate with it as well etc.
176
Onwusuru I et al Journal of Scientific and Engineering Research, 2017, 4(6):176-180
5*sin(2.5^(3-pi))+1/75
at the prompt. Be careful with parentheses and don't forget to type * whenever you multiply!
Note that MATLAB is case sensitive. This means that MATLAB knows a difference between letters written as
lower and upper case letters. For example, MATLAB will understand sin(2) but will not understand Sin(2).
177
Onwusuru I et al Journal of Scientific and Engineering Research, 2017, 4(6):176-180
Variables In MATLAB
We can easily define our own variables in MATLAB. Let's say we need to use the value of 3.5sin(2.9)
repeatedly. Instead of typing 3.5*sin(2.9)over and over again, we can denote this variable as x by typing the
following:
x=3.5*sin(2.9)
Now type
x+1
and observe what happens. Note that we did not need to declare x as a variable that is supposed to hold a
floating point number as we would need to do in most programming languages.
Often, we may not want to have the result of a calculation printed-out to the command window. To suppress this
output, we put a semi-colon at the end of the command; MATLAB still performs the command in "the
background". If you defined x as above, now type
y=2*x;
y
And observe what happened.
In many cases we want to know what variables we have declared. We can do this by typing whos. Alternatively,
we can view the values by opening the "Workspace" window. This is done by selecting the Workspace option
from the View menu. If you want to erase all variables from the MATLAB memory, type clear. To erase a
specific variable, say x, type clear x. To clear two specific variables, say x and y, type clear x y, that is separate
the different variables with a space. Variables can also be cleared by selecting them in the Workspace window
and selecting the delete option.
178
Onwusuru I et al Journal of Scientific and Engineering Research, 2017, 4(6):176-180
current1 = i(1);
current2 = i(2);
current3 = i(3);
vA = (current1 - current2)*r2
vB = (current2 - current3)*r4
vC = (current3)*r6
v = 0:5:100;
k = length(v);
for k = 1:length(v)
V = [v(k);0;0]
i = A\V
vC(k) = i(3)*r6
end
subplot(2,2,3)
plot(vC,v)
holdon
gridon
title('Response of Pi Resistive Network');
xlabel('Output Voltage');
ylabel('Input Voltage');
179
Onwusuru I et al Journal of Scientific and Engineering Research, 2017, 4(6):176-180
Conclusion
MATLAB integrates computation, visualization, and programming in an easy to use environment where
problems and solutions are expressed in familiar mathematical notation. MATLAB has also evolved over a
period of years with input from many users. It is the standard instructional tool for introductory and advanced
courses in mathematics, engineering and sciences in the university environment while in the industry; it is the
tool of choice for high-productivity research, development and analysis.
References
[1]. J. W. Demmel. Applied Numeric LINEAR Algebra. Siam, 1997.
[2]. S. J. Chapman. MATLAB Programming for Engineers. Thomson, 2004.
[3]. A. Gilat. MATLAB: An introduction withApplications. John Willey and Sons, 2004.
[4]. David Houcque. Introduction to MATLAB for Engineering Students. Version 1.2, August 2005.
180