Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
MATLAB Tutorial
#1

MATLAB Tutorial

[attachment=477]

MATLAB Basics

MATLAB is started by clicking the mouse on the appropriate icon and is ended by typing exit or by
using the menu option. After each MATLAB command, the "return" or "enter" key must be
depressed.

Definition of Matrices

MATLAB is based on matrix and vector algebra; even scalars are treated as 1x1 matrices. Therefore,
vector and matrix operations are as simple as common calculator operations.
Vectors can be defined in two ways. The first method is used for arbitrary elements:

M-files

M-files are macros of MATLAB commands that are stored as ordinary text files with the extension
"m", that is filename.m. An M-file can be either a function with input and output variables or a list of
commands. All of the MATLAB examples in this textbook are contained in M-files that are available
at the MathWorks ftp site.

Control Design

Consider a feedback loop as shown in Figure 1 where G(s)H(s) = KP(s) and K is a gain and P(s)
contains the poles and zeros of the controller and of the plant. The root locus is a plot of the roots of
the closed loop transfer function as the gain is varied. Suppose that the numerator and denominator
coefficients of P(s) are stored in the vectors num and den. Then the following command computes
and plots the root locus:
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

Powered By MyBB, © 2002-2024 iAndrew & Melroy van den Berg.