开发者

How to draw the transfer function of an RC circuit using MATLAB?

If I have an RC circuit with transfer function 1/(1+sRC) how do I draw the transfer function using MATLAB?

Num2=[1];
De开发者_JS百科n2=[R*C 1];
RCcirc=tf(Num2,Den2);

How do I declare the R and the C so that there are no errors?


tf is the wrong tool for plotting the transfer function. Try these instead:

  1. Use linspace to generate a range of values for s. Give R and C reasonable values of your choice.
  2. Read up on arithmetic operations in MATLAB, especially ./
  3. Look at how to use plot and familiarize yourself with the command using some simple examples from the docs.

With these you should be able to plot the transfer function in MATLAB :)


First of all you need to understand what transfer function you want. Without defined values of R and C you won't get any transfer function. Compare it to this, you want to plot a sine wave: x = sin(w*t), I hope you can agree with me that you cannot plot such a function (including axes) unless I specifically say e.g. t is the time, ranging from 0 seconds to 10 seconds and w is a pulsation of 1 rad/s. It's exactly the same with your RC network: without any values, it is impossible for numerical software such as MATLAB to come up with a plot.

If you fill in those values, you can use th tf function to display the transfer function in whatever way you like (e.g. a bode plot).

On the other hand, if you just want the expression 1/(1+s*R*C), take a look at the symbolic toolbox, you can do such things there. But to make a plot, you will still have to fill in the R and C value (and even a value for your Laplace variable in this case).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜