Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Variable in a transfer function

Subject: Variable in a transfer function

From: Daniel

Date: 10 Oct, 2013 00:58:06

Message: 1 of 2

Hey guys,

I'm very new to MATLAB and don't have a lot of programming experience, so keep that in mind while answering questions.

I have a system that I'm trying to produce in terms of variable 'p' :
clear all;
global p;
sys1=tf([10],[1,0]);
sys2=tf([1],[1,p]);
sys3=series(sys1,sys2);
tf=feedback(sys3,1)

What I would like to have displayed is this:

 tf =
        10
  ---------------
  s^2 + p s + 10

Instead, I get:
sys4 =
 
    10
  ------
  s + 10
 
Does anyone have a solution to this?

Subject: Variable in a transfer function

From: Nasser M. Abbasi

Date: 10 Oct, 2013 02:25:04

Message: 2 of 2

On 10/9/2013 7:58 PM, Daniel wrote:
> Hey guys,
>
> I'm very new to MATLAB and don't have a lot of programming experience,
>so keep that in mind while answering questions.
>
> I have a system that I'm trying to produce in terms of variable 'p' :
> clear all;
> global p;
> sys1=tf([10],[1,0]);
> sys2=tf([1],[1,p]);
> sys3=series(sys1,sys2);
> tf=feedback(sys3,1)
>
> What I would like to have displayed is this:
>
> tf =
> 10
> ---------------
> s^2 + p s + 10
>
> Instead, I get:
> sys4 =
>
> 10
> ------
> s + 10
>
> Does anyone have a solution to this?
>

tf does not supports syms.

So, there is no way to do it directly. Must use numbers.

There is sym2tf() function at matlab centeral that you can try. I did
not use it myself.

Remember, tf in Matlab is not just a plain old polynomial ratio. It is
an actual class. So you can't just use standard num/den and call it tf.

http://www.mathworks.com/matlabcentral/fileexchange/10816-mimo-toolbox/content/Mimotools/sym2tf.m

--Nasser

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us