Sei sulla pagina 1di 10

What is MATLAB?

- A high performance language for technical computing.



- Computation, visualization and programming are integrated with MATLAB, in easy to use
environment.

- The problems and solutions expressed in mathematical notion.

- Following are the uses of MATLAB:
1. Computations.
2. Development algorithms.
3. Simulation, modeling and prototyping.
4. Visualization, data analysis and exploration.
5. Engineering graphics.
6. GUI application development.
2. What is MATLAB mathematical function library?


- MATLAB mathematical functions include computational algorithms.

- The elementary computational functions are sum, sine, etc.

- Matrix functions are available including matrix inversion.

- Special functions like Bessel are available.

- MATLAB includes transformation functions, namely Fourier Transformation Functions.
3. Explain about MATLAB language.


- MATLAB language is a high-level matrix language.

- It has control structures, functions, data structures, I/O and OOP features.

- Allows rapid creation of throw-away programs.

- Allows creating large and complex application programs.

- MATLAB API allows to author C and FORTRAN programs to interact with MATLAB.
4. What are MATLAB system parts?


Following are the 5 main parts of MATLAB.

- MATLAB Languange.

- MATLAB working environment.

- Graphics handler.

- MATLAB mathematical library.

- MATLAB Application Program Interface.
5. Explain about stress analysis in MATLAB.


- MATLAB is used in aerospace engineering, space environment.

- MATLAB is suitable for flexible dynamics.

- These domain experts conduct stress analysis on various structures like metallic and composite
structures.

- To analyze the stress, NASTRAN, IDEAD, Oracle and PATRAN levels of proficiency is
needed.

- The tasks are also used on aircraft that is metallic structure.

- The stress analysis includes control surface stiffness understanding, loop calculations, finite
element modeling and fatigue testing requirement and analysis.
6. Explain Handle Graphics in MATLAB.


- Handle Graphics is a subsystem of MATLAB that handles graphics.

- Handle Graphics has high level commands for 2D and 3D data visualization.

- Image processing, animation and presentation graphics can be generated using Handle
Graphics.

- Low level commands allow customizing the graphics appearances.

- Handle Graphics allows to build customized Graphics User Interfaces
7. Explain about 3D visualization elements in MATLAB.


3D visualization elements allow MATLAB to deal with 3D graphics.

- Surface and Mesh Plots - It includes plot matrices, visualize functions, color maps.

- View Control - Used to control camera viewpoint, rotation, zooming, and aspect ratio and set
axis limits.

- Lighting - Used for adding and controlling scene lighting.

- Transparency - Used to specify object transparency.

- Volume Visualization - Used for volume data grid.
8. The input was too complicated or too big for MATLAB to parse when such
error occurs and how this error can be prevented?
a) This kind of error occurs when a program file includes thousands of variables
or functions, thousands of statements, or hundreds of language keyword pairs
(e.g., if-else, or try-catch). It can be overcome by following ways:
i) Split large script files into smaller ones, having the first file call the second if
necessary.
ii) Take larger chunks of program code and make separate functions (or sub
functions and nested functions) of them.
iii) If the functions or expressions seem overly complicated, make smaller and
simpler functions or expressions of them. Simpler functions are also more likely
to be made into utility functions that can be shared with others.
Why the conversion of data types of variables is not suggested in matlab? How
the conversion can be done, if required?
If the class or array of a variable is changed it will have the following negative
effects:
It slows down the process.
It takes extra time
It has a negative impact on the performance
So to avoid the above negative effects it is always advisable to create a new
variable.

X which is a double type variable can be changed char type by the following
code:
X = 56;
---Your code here--
X = 'A'; % X changed from type double to char
-----Your code here----
How vectorization is helpful in MATLAB?
Firstly vectorization helps in the conversion of vector or matrix operations from
for and while loops, secondly its algo speeds up the code as it is really short.
For e.g.

One way to compute the sine of 1001 values ranging from 0 to 10:
i = 0;
for t = 0:.01:10
i = i + 1;
y (i) = sin (t);
end

A vectorized version of the same code is
t = 0:.01:10;
y = sin(t);

The second example executes much faster than the first
Which Graphic sytem is used in MATLAB? Explain it.
The graphic system which is used in Matlab is known as handle graphics. It has
few high level and low level commands.
High level commands performs data visualization, image processing, and
animation for two dimensional and three dimensional presentation graphics.
Full customization of the appearance of graphics and building of complete
Graphical user interfaces on is done by low level commands in MATLAB
applications.
Describe the various system parts of MATLAB
Various system parts of MATLAB include:
The MATLAB language: consists of high level array language.
The MATLAB working environment: set of tools and facilities that you work
with as matlab user.
Handle Graphics: It includes high level and low level commands.
The MATLAB mathematical function library: Its a collection of computational
algorithms.
The MATLAB Application Program Interface (API): Its a library which
allows to write C and Fortran programs.
8. Name the Basic Plots and Graphs of MATLAB.


Following table describes basic plots and graphs.

box - Axis border
errorbar - Plots error bars along curve
hold - Retains current graph while adding new graphs
line - Creates line object
LineSpec (Line Specification) - Syntax of Line Specification String
loglog - Log to log scale plot
plot - 2-D line plot
plot3 - 3-D line plot
plotyy - 2-D line plots with y-axis on both left and right side
polar - Polar coordinate plot
semilogx - Semilogarithmic plot
semilogy - Semilogarithmic plot
subplot - Creates axis in tiled positions
xlim - Sets or queries x-axis limits
ylim - Sets or queries y-axis limits
zlim - Sets or queries z-axis limits

How to Pre Allocate a Non Double matrix?


- Preallocating a block of memory for holding a non double matrix is memory efficient.

- It is faster to use the function repmat.

- While allocating block of memory for a matrix, zeros are pre allocated to a matrix.

- The function to pre allocate memory is int8().
Ex: matrix = int8(zeros(100));

- repmat function is used to create a single double matrix.
Ex: matrix2 = repmat(int8(0), 100, 100);

Thus non double matrix is pre allocated.
9. Describe the memory management functions.


Below is the list of memory management functions.

1. clear - Removes variables from memory.
2. pack - Saves the existing variables to disk, and then reloads them contiguously.
3. save - Selectively persists variables to disk.
4. load - Reloads a data file saved with the save function.
5. quit - Exits MATLAB and returns all allocated memory to the system.
10.how to call MATLAB in batch mode?


- Batch mode execution of MATLAB can be done from command line or from makefile.

- A script is needed with extension .m.

- Specify all the commands that are to execute in sequential order in the script.

- The commands are placed in the script by using the command makefile

- To add the commands in command line mode, type all the commands at the command line in
sequential order.

- The commands are executed soon after typing them at the command line.
11. What is LaTeX in MATLAB?


- MATLAB allows Greek letters.

- These letters are to be encoded.

- To encode these Greek letters, LaTeX is used.

MATLAB already handles naturally simple LaTeX encodings that allow introducing Greek
lettters or modifying the font size and appearance in plots.
12. How to correctly apply the graphics patches in MATLAB?


Following is the sequence of commands to apply graphic patches in MATLAB.
- Open the LOCAL MACHINE window.

- Type the command xhost + ashland.

- Add the following code sequence before the plot command.
Figure;
Set(gcf,renderer,zbuffer);
[s,w] = unix(echo $DISPLAY);
Set(gcf, XDisplay,w);
13. Can MATLAB run without graphics?


- At times scripts need to run without displaying the plots.

- By doing this, the script statement need not be commented.

- When working from home, running graphics over the network may be too slow.

- To perform the process, add the following lines of code:
%setenv DISPLAY /dev/null % MATLAB.

- By using these simple tricks, we can run MATLAB without graphics.
14. Explain about Image arithmetic functions in MATLAB.


Following is the list of image arithmetic functions and their usage.

1. imabsdiff - Returns absolute difference of two images.
2. imadd - Performs addition of two images or addition of constant to image.
3. imapplymatrix - Applies linear combination of color channels.
4. imcomplement - Complements an image.
5. imdivide - Divide one image into another or divide image by constant.
6. imlincomb - Linear combination of images.
7. immultiply - Multiplies two images or multiplies image by constant.
8. imsubtract - Subtracts one image from another or subtracts constant from image.
15.What is the process to change default settings for an objects properties?


Following is the process to change the default settings:

- Find the parent object by the statement
Hm=get(objects_handle, Parent)

- To specify the default , specify the following statement
Set(h,DefaultObjectPropertyName,PropertyValue)

- Followed by this process, any line is plotted, will certainly have 25 as the line width.
16. Define Xmath.


- Xmath is an interactive scripting and graphics environment for Xwindow workstations.

- With its significant improvement features on MATLAB-type software, interactive mathematics,
scripting functionalities are elaborated.

- Following are the Xmath features:
1. Sripting languages with OOP features.
2. Libraries that are LNX and C language compatible.
3. A debugging tools with GUI features.
4. Color graphics can be pointed and clickable.
5. A special layer is available that is programmable for MOTIF GUI.

17. How to add noise to an image?
he function noise.m, now installed on ashland too, adds Gaussian, uniform, salt and pepper,
additive or multiplicative noise to an image.


By using the function imnoise we can add noise into an image. The syntax is imnoise(
image,type of noise ).
How to add noise to an image?

View Answer
What can we use Matlab for?

View Answer
How to call matlab in batch mode?

View Answer
Explain The MATLAB mathematical function library?

View Answer
Explain about stress analysis in Matlab?

View Answer
Explain The MATLAB Application Program Interface (API)?

View Answer
Can MATLAB pass by reference?

View Answer
How to add noise to an image in Matlab?

View Answer
How can I make MATLAB use the full window width for displaying matrices?

View Answer
How to save default settings across sessions?

View Answer
Why does MATLAB only calculate to 4 significant digits?

View Answer
Can we run Matlab without graphics?

View Answer
Explain LaTeX in Matlab?

View Answer
Explain The MATLAB working environment?

View Answer
On what machines Matlab should be run

View Answer
LaTeX in Matlab

View Answer
What is MATLAB?

View Answer
Vectorization What is that ? How to do it ?

View Answer
How to correctly apply the graphics patches in Matlab?

View Answer
What Is MATLAB?



18. What can we use Matlab for? What can we use Matlab for?
Simple calculations 2. Plotting and analyzing mathematical relationships (2D and 3D) 3.
List & Matrix Operations 4. Writing script files (a type of programming) 5. Symbolic
manipulation of equations 6. Advanced visualization, animation and GUI interface tools


Matlab is to be utilized for data extraction,data analysis and data processing,it is further
utilized for some statistical task to analyze the behavior of the system by plotting.it is used
to generate stimulus for verification of the system
19. How to call matlab in batch mode?
This can be done from the command line or from a makefile. You need a script (filename.m). Just type
at the command line, or include in the makefile: matlab<filename.m where filename.m can write to
disk a figure, a binary, an ascii file, anything you want.

Potrebbero piacerti anche