0% found this document useful (0 votes)
2 views

MATLAB Commands With Descriptions

This document provides a list of MATLAB commands and their descriptions specifically for control systems lab work. It includes commands for creating matrices, plotting, analyzing system responses, and implementing control algorithms. The commands cover a range of functionalities from basic operations to advanced system analysis techniques.

Uploaded by

hafizfawad118
Copyright
© © All Rights Reserved
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)
2 views

MATLAB Commands With Descriptions

This document provides a list of MATLAB commands and their descriptions specifically for control systems lab work. It includes commands for creating matrices, plotting, analyzing system responses, and implementing control algorithms. The commands cover a range of functionalities from basic operations to advanced system analysis techniques.

Uploaded by

hafizfawad118
Copyright
© © All Rights Reserved
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
You are on page 1/ 2

MATLAB Commands with Descriptions for Control Systems Lab

help function_name Displays documentation for a specific function.

lookfor keyword Searches for functions related to a keyword.

clc Clears the Command Window.

clear Removes all variables from the workspace.

close all Closes all figure windows.

x = 1:10 Creates a row vector from 1 to 10.

linspace(0,10,100) Creates 100 linearly spaced points between 0 and 10.

x' Transpose of a vector or matrix.

zeros(m,n) Creates an m-by-n matrix of zeros.

ones(m,n) Creates an m-by-n matrix of ones.

eye(n) Creates an identity matrix of size n-by-n.

magic(n) Creates a magic square matrix of order n.

randi([a,b],m,n) Generates m-by-n random integers between a and b.

inv(A) Calculates the inverse of matrix A.

det(A) Computes the determinant of matrix A.

rank(A) Finds the rank of matrix A.

abs(z) Returns absolute value or magnitude.

angle(z) Returns phase angle of complex number z.

real(z) Extracts the real part of z.

imag(z) Extracts the imaginary part of z.

conj(z) Computes complex conjugate of z.

plot(x,y) Plots y versus x.

subplot(m,n,p) Creates subplot in m-by-n grid at position p.

title('text') Adds title to a plot.

xlabel('text') Labels the x-axis.

ylabel('text') Labels the y-axis.

legend('label') Displays legend on plot.

grid on Turns on the grid for current plot.

hold on Retains current plot and adds new plots.

tf(num,den) Creates a transfer function model.

zpk(z,p,k) Creates zero-pole-gain model.

step(sys) Plots the step response of a system.


impulse(sys) Plots the impulse response of a system.

lsim(sys,u,t) Simulates response to arbitrary input.

pzmap(sys) Plots pole-zero map of the system.

gensig('square',T,d,Ts) Generates square wave signal.

pid(Kp,Ki,Kd) Defines a PID controller.

stepinfo(sys) Returns step response characteristics.

isstable(sys) Checks stability of the system.

rlocus(sys) Plots root locus of the system.

bode(sys) Generates Bode plot.

nyquist(sys) Generates Nyquist plot.

for Starts a for loop.

while Starts a while loop.

if / elseif / else Conditional logic structure.

break Exits the current loop.

You might also like