EVID Solutions and IEEE SPCE-SPIT
EVID Solutions and IEEE SPCE-SPIT
Presents
Why MATLAB?
MATLAB Environment
Command Window
Workspace
Command History
M-File Editor
MATLAB
1.
Environment
Command Window, Workspace
2. Command History
11/02/21
MATRIX Manipulations
• Defining an Integer:
2. while:
while(1)
//Place your code here
end
3. if:
if (Condition)
//Place your code here
end
Exercise 2
Optimal Code for
Take any two input numbers
Convert them into 8-bit binary
Concatenate both of them together
Form 5-6-5 matrices from the available 16-bit data
Plots in MATLAB
Commands covered: plot, xlabel, ylabel, title grid,
axis, stem, subplot
xlabel('time (sec)'); ylabel('step response'); title('My
Plot');
Eg:To plot more than one graph on the screen, use
the command subplot(mnp) which partitions the
screen into an mxn grid where p determines the
position of the particular graph counting the upper
left corner as p=1. For example,
subplot(211),semilogx(w,magdb);
subplot(212),semilogx(w,phase);
3-d Plots in MATLAB
x=[0:10]; y=[0:10]; z=x’*y;
mesh(x,y,z); title(‘3-D Graph’);
Exercise 3
Optimal Code for
Create 5 x 5 matrix in Excel
Import the matrix in MATLAB
Use masking to remove any value above 100
Export the matrix from MATLAB
Read new image in Excel
Basic IP Commands
To Read an Image:
imread()