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

Wollo University (WU)

College of Natural and Computational Science (CNS)

Department of Physics

Individual Assignment: Computational

Student Name: Selam Hirbo Kane

ID No: WOUR/2818/10

Submitted to Instructor: Ashennaf. A


Submission Date 05 / 04 / 2013EC

1
1. i. What Is MATLAB? Answer -: The name MATLAB stands for matrix laboratory. MATLAB
is a high-performance language for technical computing. It integrates computation,
visualization, and programming in an easy-to-use environment where problems and solutions
are expressed in familiar mathematical notation.
ii. What are some of the uses of Mat Lab programming? Answer
 Math and computation
 Algorithm development
 Modeling, simulation, and prototyping
 Data analysis, exploration, and visualization
 Scientific and engineering graphics
 Application development, including Graphical User Interface building

2. i. What do we mean by ‘’solving a given problem symbolically’’? Answer


Solving an equation symbolically means that expressions can be used for representing the
solutions. For example, the equation x + y = 2x – 1 is solved for the unknown x by the
expression x = y + 1, because substituting y + 1 for x in the equation results in (y + 1) + y
= 2(y + 1) – 1, a true statement.
ii. And also “solving a given problem numerically”? Answer
Solving given problem numerically means to use approximations that make a problem
easier to solve. However, we can use methods that are known to give for us something
that is close to the answer, a numerical approximation. Typically such methods use
approximations and computer power.
3. i. List at least 5 examples of MATLAB Symbolic Tools Answer
 Algebra: Polynomials, vectors and matrices.
 Calculus: Differentiation and integration.
 Transforms: Laplace and Z transforms.
 Generalized functions: Heaviside and Dirac.
 Systems of ordinary differential equations.
 The funtool, MuPAD and help.

ii. List at least 5 examples of Numeric tools? Answer

2
 Interpolation, extrapolation, and regression
 Differentiation and integration
 Linear systems of equations
 Eigenvalues and singular values
 Ordinary differential equations (ODEs)
 Partial differential equations (PDEs)
4. i. What is M-file of MatLab? An m-file, or script file, is a simple text file where you can
place MATLAB commands. When the file is run, MATLAB reads the commands and
executes them exactly as it would if you had typed each command sequentially at the
MATLAB prompt. All m-file names must end with the extension '.
ii. Why we need M-files for? Because M-Files  provides Intelligent Information
Management solutions for all document management.
iii. What is the difference between using command window to using M-file for a given
task?
 You cannot define a function in the command window.
 You cannot run () the command window.
 You cannot use the graphical debugging tools well in the command window.
 Error tracebacks are poor in the command window.
 You cannot use mfilename in the command window .
 You cannot pause execution in the command window .
 In r2016b and later you can define scripts in script files.
 you can run() a script
 Debugging is better with script files
 mfilename has some uses in a script
5. i. What is a script? Answer
Scripts − script files are program files with .m extension. In these files, you write series of
commands, which you want to execute together.
ii. What are the properties of a script file? Answer
 Script properties are added to a script component by defining them with the go. Property
()  special function. The function has to be used at the top level—outside any callback-

3
functions like init () and update (). The default value provided for the property governs the
type of the script property:
-number,
- hash,
-boolean, 
-msg.url, 
-vmath.vector3, 
-vmath.vector4,
-  vmath.quaternion and  resource
6. i. What is function? Answer
 Functions − functions files are also program files with .m extension that can accept
inputs and return outputs.
ii. What are the properties of a function file? Answer
A MATLAB file of a special format that contains code with optional properties
-inputs and
-outputs
Some advantages:
 Functions can be called from inside of other script and function M-files.
 Inputs allow variable values to be modified when calling the function (eg from
the Command Window).
 Outputs can be assigned to other variables at the Command Window or within a
separate M-file.
Disadvantages:
 A slight disadvantage with a function M-file is that you must follow the prescribed
format, or else it won’t run correctly. Once you get the hang of that, you will see they
are often very useful.
7. What are the difference between scripts and functions? Answer
i. Scripts − script files are program files with .m extension. In these files, you write
series of commands, which you want to execute together. Scripts do not accept
inputs and do not return any outputs. They operate on data in the workspace.
ii. Functions − functions files are also program files with .m extension. Functions
can accept inputs and return outputs. Internal variables are local to the function.

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