0% found this document useful (0 votes)
145 views1 page

Matlab Essentials

This document provides an introduction and overview of key MATLAB commands organized into the following categories: 1. Plots - Commands for creating plots like plot, hold, semilogx, loglog, imagesc, imshow, plot3, and surf. 2. Workspace and operators - Commands for managing the workspace and basic operators like edit, save, load, whos, clear, close, and arithmetic operators. 3. Control system - Commands for control system analysis like tf, feedback, pzmap, rlocus, bode, impulse, step, and freqresp. 4. Vector and matrices - Commands for working with vectors and matrices like size, length, ones, zeros, rand,

Uploaded by

prasannakumar_7
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
145 views1 page

Matlab Essentials

This document provides an introduction and overview of key MATLAB commands organized into the following categories: 1. Plots - Commands for creating plots like plot, hold, semilogx, loglog, imagesc, imshow, plot3, and surf. 2. Workspace and operators - Commands for managing the workspace and basic operators like edit, save, load, whos, clear, close, and arithmetic operators. 3. Control system - Commands for control system analysis like tf, feedback, pzmap, rlocus, bode, impulse, step, and freqresp. 4. Vector and matrices - Commands for working with vectors and matrices like size, length, ones, zeros, rand,

Uploaded by

prasannakumar_7
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

MATLAB

tansun Engineering Research Hub

Introduction
For each command, try help <command> or doc <command> to get more information.

4 Plots
plot ( x,y) hold (on) semilogx loglog imagesc imshow plot3 surf - Plot y vs. x . - Keep (discard) current graph. - Plot with logarithmic x-axis. - Plot with logarithmic axes. - Scale and display an image. - Display an image. - Three-dimensional plot. - Surface plot.

1 Workspace and operators


edit save load whos clear close pack clc figure exit +-*/ . .* ./ a :b :c - Open a file in the editor. - Save the workspace. - Load a saved workspace. - List the workspace variables. - Clear the variables. - Close current figure window. - Free the unsued memory. - Clear the command window. - Open a new figure. - Exit MATLAB. - Sum, subtraction, multiplication, division. - Matrix complex conjugate transpose. - Matrix transpose. - term by term multiplication (respectively division). - interval from a to c with step b.

5 Control system
tf series feedback pzmap rlocus bode impulse step freqresp - Define a transfer function. - Cascade systems. - Create feedback system. - Pole-zero map. - Root lo cus diagram. - Bode diagram. - Impulse response. - Step response. - Evaluate frequency response. see doc control for more.

2 Vector and matrices


size - Dimensions of a vector/matrix. length - Largest dimension of a vector/matrix. vec (1) - First element of vector vec . vec (end) - Last element of vector vec . -by- n matrix filled with ones. ones( m ,n) - m zeros ( m,n ) - m -by- n matrix filled with zeros. rand ( m n) - m , -by- n matrix with values uniformly distributed (i.e. following U([0; 1])). randn ( m,n ) - m -by- n matrix with values distributed using normal distribution (i.e. following N (0 , 1)).

6 Image operations
imread imwrite graythres im2bw bwareaopen imdilate imerode strel edge conv2 filt2 medfilt2 - Open an image file. - Write an image file. - Find a gray level for thresholding. - Convert an grayscale image to binary. - Remove small objects in binary image. - Apply image dilation. - Apply image erosion. - Define a structuring element for morphology operations. - Edge detection. - 2D convolution. - 2D filtering. - Median filter.

3 Matrices - operations
Size (A) numel (A) det(A) inv(A) Pinv (A) trace(A) eig(A) expm(A) ) - Size of A . . - Number of elements of A - Determinant of A . - Inverse of A . - Pseudo-inverse of A (equal to inv( A) if A is invertible). - Trace of A (Sum of diagonal elements)

Other useful tools


guide Simulink profiler - Graphic user interfaces. - Simulation of model-based systems. - Performance analysis tool

- Eigen-values of A . - Matrix exponential of A . reshape(A,[p q]) - Reshape matrix A to p-by- q (Number of elements should match). A(:) - Single column version of . A 1

For Further Queries tansun@[Link]

You might also like