To create a transfer function of any equation in MATLAB, you can use the tf
function. Assuming you have the numerator and denominator coefficients of your equation, you can create a transfer function using the following syntax:
main.m153 chars5 lines
Replace [numerator coefficients]
and [denominator coefficients]
with your actual coefficient values. This will create a transfer function representation of your equation in MATLAB.
Make sure that the values of numerator and denominator coefficients are in descending order of their powers.
Example: Let's say you have the transfer function: [ H(s) = \frac{2s^2 + 3s + 4}{s^3 + 5s^2 + 2s + 1} ]
You can create this transfer function in MATLAB as follows:
main.m112 chars5 lines
Now, sys
will represent the transfer function ( H(s) ) in MATLAB.
gistlibby LogSnag