# Root Locus Method in MATLAB

To start out, setup the open loop transfer function.

Next, you can choose to set up the MATLAB code in a few different ways. First make sure that both the numerator and denominator are in acceptable forms.

[1 2 3] is the same as saying

Using an example:

We can write the numerator and denominator MATLAB codes as:

>>numerator=[1];

>>denominator=[1 8];

For a more complex problem we can bypass the long and tedious expansion process and use the convolution function in MATLAB.

Here, the denominator is also represented by (s+1)*(s+3+3j)*(s+3-3j). Being three seperate parts, we can use convolution once for two of them, then use convolution again with the remaining part. Just look at the example:

conv( A , conv( B , C ) ) —> denominator = conv( [1 1], conv( [1 3+3*j], [1 3-3*j] ) );

After we define our numerator and denominator in MATLAB, we can use the root locus function then set our axis parameters as follows.

>>rlocus( numerator, denominator )

>>axis([-10 10 -10 10])

Your plot should look similar to the following for this example: