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

PHM: 607

DHAs

ABHISHEK

165001

PHYSICS (HONOURS)

QUEST.1 WHAT IS MATLAB?

ANS.1 The name MATLAB stands for MATRIX LABORATORY. MATLAB was written originally
to provide easy access to matrix software developed by the LINPACK (linear system package)
and EISPACK (Eigen system package) projects. MATLAB is a high-performance language for
technical computing. It integrates computation, visualization, and programming environment.
Furthermore, MATLAB is a modern programming language environment: it has sophisticated
data structures, contains built-in editing and debugging tools, and supports object-oriented
programming. These factors make MATLAB an excellent tool for teaching and research.
MATLAB has many advantages compared to conventional computer languages (e.g., C,
FORTRAN) for solving technical problems. MATLAB is an interactive system whose basic data
element is an array that does not require dimensioning. The software package has been
commercially available since 1984 and is now considered as a standard tool at most universities
and industries worldwide. It has powerful built-in routines that enable a very wide variety of
computations. It also has easy to use graphics commands that make the visualization of results
immediately available. Specific applications are collected in packages referred to as toolbox.
There are toolboxes for signal processing, symbolic computation, control theory, simulation,
optimization, and several other fields of applied science and engineering. MATLAB is used in
every facet of computational mathematics.

Following are some commonly used mathematical calculations.

• Dealing with Matrices and Arrays

• 2-D and 3-D Plotting and graphics

• Linear Algebra

• Algebraic Equations

• Non-linear Functions
• Statistics

• Data Analysis

• Calculus and Differential Equations

• Numerical Calculations

• Integration

• Transforms

• Curve Fitting

• Various other special functions

• It provides built-in graphics for visualizing data and tools for creating custom plots. MATLAB
programming interface gives development tools for improving code quality maintainability and
maximizing performance.

Quest.2 HISTORY OF MATLAB.

ANS.2 The development of MATLAB began at the end of 1970s. The work on MATLAB was
initiated by Cleve Moler, who chaired the computer science department at the University of
New Mexico during that time. Cleve Moler started developing MATLAB with the aim of
providing his students with an access to EISPACK and LINPACK without having any need to go
for learning Fortran.

The language, however, soon became popular among a large number of university, specifically
in the field of applied mathematics, because of its high usability in the said area. At the time of
the visit that was made by Moler to Stanford University in the 1983, Jack Little, who was an
engineer, came in contact with the MATLAB programming language.

After realising the fact that MATLAB had an impressive commercial potential, Jack Little went
on for joining hands with Steve Bangert and Moler. These three then started rewriting MATLAB
in C Language. This was also accompanied with the formation of MathWorks in the year 1984 to
further enhance the development of MATLAB.

ACKPAC is the name that was given to the rewritten libraries of MATLAB. LAPACK was created
in the year 2000. This was a new set of libraries which were used by the newer and modified
MATLAB so as to incorporate the feature of matrix manipulation.

The early uses of MATLAB were specifically made by the practitioners as well as researchers
that were associated with the field of control engineering, which was a speciality of Jack Little.
The language, because of the high profile features, was quick to become popular in a variety of
other domains as well.

The common uses of this language are now made in the field of education, especially in the
teaching of numerical analysis, and linear algebra. Apart from that it is also deployed by the
scientists who work in the area of image processing.

QUEST.3 WHAT IS M FILE?

ANS.3 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 '.m' (e.g. test.m). If you create a new m-file with the same name as an
existing m-file, MATLAB will choose the one which appears first in the path order (type help
path in the command window for more information). To make life easier, choose a name for
your m-file which doesn't already exist. To see if a filename.m already exists, type help
filename at the MATLAB prompt.
MATLAB allows writing two kinds of program files −
 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.
 Functions − functions files are also program files with .m extension. Functions can
accept inputs and return outputs. Internal variables are local to the function.

QUEST.4 Write 10 important command of Matrix.


ANS.4

Sr. no. command Purpose

1 eye Create an identity matrix

2 cross Computes matrix cross products.

3 dot Computes matrix dot products.

4 inv Computes inverse of a matrix.

5 Pinv Computes inverse of a matrix.

6 rank Computes rank of a matrix.


7 rref Computes reduced row echelon form.

8 sum Sums each column.

9 sort Sorts each column

10 prod Product of each column.

QUEST.5 Write 10 important command of Vector.


ANS.5
Sr.No. Command Purpose

1 ones Creates an array of ones.

2 zeros Creates an array of zeros.

3 det Computes determinant of an array.

4 num2cell Converts numeric array to cell array.

5 deal matches input and output lists.

6 iscell Identifies cell array

7 logspace Creates logarithmically spaced vector.

8 max Returns largest element.

9 min Returns smallest element.

10 size Compute arrey size

QUEST.6 Write 10 important command of plotting.


ANS.6
Sr. no. command purpose

1. fplot Intelligent plotting of functions.

2. plot Generates xy plot.


3. axis Sets axis limits.

4. print Prints plot or saves plot to a file.

5. title Puts text at top of plot.

6. close Closes the current plot.

7. hold Freezes current plot.

8. loglog Creates log-log plot.

9. polar Creates polar plot.

10. stairs Creates stairs plot.

QUEST.7 Write 10 important command of graphs.

ANS.7
Sr. no. command purpose

1. grid Display gridlines.

2. figure Opens a new figure window.

3. text Places string in figure.

4. bar Creates bar chart.

5. set Specifies properties of objects such as axes.

6. refresh Redraws current figure window.

7. gtext Enables label placement by mouse.

8. axes Creates axes objects.

9. xlabel Adds text label to x-axis.


10. ylabel Adds text label to y-axis.

QUEST.8 -: Write 10 important command of differential calculus.


ANS.8
Sr. no. command purpose

1 ode45 Nonstiff ,medium-order solver

2 ode113 Nonstiff ,variable-order solver

3 ode23s Stiff , low-order

4 ode23t Moderately stiff, trapezoidal rule solver

5 ode15s Stiff , variable-order solver

6 diff  computing symbolic derivatives

7 subs  evaluate the function by substitute a value

8 dsolve solving differential equations

9 odeset Creates integrator options structure for ODE solvers

10 ode23 Nonstiff ,low-order solver

QUEST.9 -: Write 10 important command of integral calculus.

ANS.9
Sr.no. command purpose

1 dblquad Double numerical integration

2 cumtrapz Computes the cumulative integral of the data

3 trapz Numerical integration with the trapezoidal rule

4 inline Create the integrand

5 int Calculating integral of an expression


6 quad Numerical integration with adaptive simpson’s

7 Quadl Numerical integration with adaptive lobatto quadrature

8 inline Create the integrand

9 cumtrapz Computes the cumulative integral of the data

10 quad Numerical integration with adaptive simpson’s

QUEST.10 Write 10 important command of Fourier transform.

ANS.10

Sr. no. command purpose

1 abs Returns the absolute value of each element in array X

2 angle Return the phase angle in the interval [-π ,π]

3 cplxpair Sorts the elements along the different dimensions of a complex


array , grouping together complex conjugate pair.

4 nextpow2 Returns the exponents for the smallest power of two.

5 unwrap Unwrap the radian phase angles in a vector.

6 fft Compute the discrete Fourier transform using Fast Fourier


transform algorithm.

7 fft2 Calculates the two-dimensional fft

8 fftshift Shift zero-frequency component of DFT to center of spectrum.

9 ifft Computes the inverse discrete Fourier transform.

10 ifft2 Returns the two-dimensional inverse discrete Fourier transform.

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