Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
22 views

Matlab Commands For Lab

wireless network
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
22 views

Matlab Commands For Lab

wireless network
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 6
AA A-2 INTRODUCTION MATLAB is the powerful tool of modern scientific computations. The complex engineering problems can be solved easily with the help of MATLAB programs, Related and required commands can be drawn from respective MATLAB toolbox. { m-files corresponding to the MATLAB statement (concerned MATLAB consists o! algorithm). There are three types of windows concerned to MATLAB viz. 1. MATLAB command window. 2, MATLAB Editor / Debugger window. 3. MATLAB Figure window. MATLAB command window : This window prompts >>, indicating that L it is ready for execution of MATLAB commands. Results are displayed in command window. The command window can also be used to run small programs. 2. MATLAB Editor / Debugger : Actual program is typed in this window and saved the file with extension of mi.e., chetana.m (MATLAB command abbreviations can not be used to save user files). All comments are written after % (percentage) character and ; (semicolon) is used to end the command. MATLAB Figure window : After execution (Running) of MATLAB program, the computed figure is displayed in MATLAB figure window. EXECUTION PROCEDURE + Open MATLAB command window. + — Click on new m-file (MATLAB editor/debugger is opened with file name untitled) + Type the program. + Comments must precede with % (percentage). * Type (semicolon) at the end of each MATLAB command (optional). A-3 + No ‘end’ statement is required for MATLAB main program (if typed, user gets warning message after running the program). Click on ‘saveas’ and save the file with ‘filename.m’ in ‘work’ environment of MATLAB software. Click on ‘Tool’ and then click on ‘Run’ to execute the program (As per setting ofoptions, user finds an arrow to the data to be inputed if program is correctly typed otherwise error is displayed). Enter the data samples (if not specified in program) in MATLAB command window. Enter all data samples within the SQUARE BRACKETS and a SPACE between each sample. ‘After entering all the input data, the result is displayed in command window or figure window (As per program). Users are advised to follow the execution procedure before proceeding with MATLAB programming. M. computation tim far ATLAB programs are compact, flexible and easy to execute except the e for longer programs. As a author, users are advised to look the ntasy of MATLAB programming. LIST OF MATLAB COMMANDS ‘The following list of MATLAB commands are very useful for signal processing. Use “help” or “lookfor” for more information about commands. Command Description Basic Commands. abs (x) ‘Computes the absolute value of vector x. angle (x) Computes the phase angle of vector x in radians. axis (x) Sets the manual scaling value on plots. break Stops the execution of loops. elf Removes all the objects from current figure. ceil(x) Rounds to the nearest integer value of x. real (x) Takes the real part of each exponents of vector X- imag (2) ‘Takes the imaginary part of each exponents of vector © conj (x) Complex conjugate of each components of x- exp (p) Computes the exponential value. sum (x) Sum of components of vector x. force | log (x) 1ogi0 (x) sqrt (x) disp (x) end error format grid gtext help hold input inv legend length linspace load lookfor max min Nan ones pause pi plot rand randn rem return save size Product of components of vector x. Computes natural logarithm of x Computes the logarithm of x with base 10, Computes the squaroot of x. : Displays the tex or z Terminates the — onthe semen, Displays an error message. Displays the format of display (long or short), Adds or deletes grid lines to or from the current plot. Places the text on figure with the help of mouse, Provides on line help of MATLAB commands. Holds the current graph. Request for the data to be supplied by user. Evaluates inverse of matrix. Inserts a legend on current figure. Calculates the length of vector. Generates linearly spaced vectors. Obtain saved data from the disk. Provides search through all help entries. Determines largest element of vector. Determines smallest element of vector. Not-a-Number. Generates a vector with element value 1. Execution stops temporarily until any key is pressed. Value of 2. Generates 2-D plots. Generates random numbers uniformly, distributed in the interval 0 and 1. Generates random numbers with zero mean and unity variance. ’ Determines the reminder from matrix division. Return to the key board. Saves the variables on the disk. dimension. stem Plots the discrete values of sequence. subplot Breaks the figure window into multiple planes for multiple figure display. title Write the heading on the top of current figure. what Provides the directory listing of files. which Locates the functions and files. who Lists the current variables in the memory. whos Lists the variables in memory, their sizes and nonzero imaginary parts xlabel Write the text below the x axis of plot. ylabel Write the text vertically on y axis of plot. zeros Generates the vector with element zero. Convolution and correlation related commands conv Computes convolution of two sequences. decony Performs the operation of polynomial division. xcorr Computes the correlation between two sequences, DEFT / FFT related commands freqz Computes the complex frequency response of digital transfer function. ats Computes the discrete fourier series. rem Determines the reminder after division. mod Computes the mod value. dft Computes the N-point DFT of sequence x. idft Computes the N-point inverse DFT of x. ovrlpsav Computes the linear convolution of real time sequence by overlap save method, fft Implements radix-2 FFT algorithm. ifft Implements radix-2 inverse FFT algorithm. £f£tshift(x)| Rearrange the output of FFT so that the zero frequency component is at the center of the spectrum. Z-Transform related commands zplane Displays poles and zeros in z plane. roots Computes the roots of z polynomial. ———————— a residue Determine the partial fraction of DT tr expressed by ratio of z-polynomial ‘ansfer function residuez Determine the partial fraction of DT transf: expressed by the ratio of 2” polynomial sfer function filter Implements the filter given by difference equati ation. impz Computes the impulse resi : ponse coeffi igi transfer funetion. setents of digital peaen Calculates the zeros, poles and : , gains of function in even transfer apatf Calculates the numerator and denominator coefficients of transfer function. Determines the equivalent second order representation zp2so8 from given higher order pole/zero polynomial. Filter related commands — putter Designs the digitaV/analog Butterworth filters. puttord Selects the minimum order of the digital/analog butterworth transfer function. chebyl Designs the digitaVanalog ‘Type-I Chebyshev filters. cheby2 Designs the digital/analog ‘Type-II Chebyshev filters. chebiord Selects the minimum order of digital/analog Type-1 Chebyshev transfer function. cheb2ord Selects the minimum order of the digitaVanalog Type-2 Chebyshev transfer function. ellip Designs the digital/analog elliptic filter. ellipord Selects the minimum order of digital/analog elliptic transfer function. freqs Computes the complex frequency response of analog transfer function. firl Designs lincar phase FIR filter. fir2 Designs linear phase FIR filter with any magnitude. bilinear This command converts an analog filter with zeros Z, poles (2,P,K,Fs) P and gain Kin to digital filter with sampling frequency Fs Hz. bilinear This command converts an analog filter with numerator (N,D,Fs) polynomial coefficients, denominator polynomial coefficients and sampling frequency Fs. boxcar (M) Generates M point rectangular window. bartiet(m) | Generates M point bartlet window hanning(m) | Generates M point hanning window. hamming (M) Generates M point hamming window. blackman(m)| Generates M point blackman window. kaiser (Mm) Generates M point kaiser window. kaiserord Calculates the filter order. Additional Commands Computes sine function of an array. Determines sine values. Calculates signum function. sine sin sign cos Computes cosine values. Rounds to nearest integer value. Determines reflected (folded) sequence. Computes number of floating point operation. Converts number to string representation. Generates sawtooth wave form. Generates staircase wave form. Computes discrete time wavelet transform. Computes inverse discrete time wavelet transform. Computer’ continuous time wavelet transform. round fliplr flops num2str sawtooth stairs dwt idwt cwr Note: Detailed explanation of each MATLAB command can be obtained by help or lookfor commands.

You might also like