vector to sys transformation for bode plot

39 views (last 30 days)
As background, I am trying to use the bode() function.
I know that you can extract vectors from a bode(sys) by doing
[mag phase wout] = bode(sys)
but if i have a vector c, can i turn that into a sys and then do a bode?
Although I think this doesn't really make sense because the vector c does not carry enough information to be in the 'sys' form, but my goal is to divide something that is 'sys' with c. However, Matlab doesn't seem to like this and gives the following error.
??? Error using ==> DynamicSystem.mrdivide at 58
In "SYS1/SYS2", the LTI model SYS2 must have the same number of inputs as
How can i resolve this issue such that i can perform the function 'sys' (a transfer function) divided by c (a vector)?

Accepted Answer

Craig on 20 Jul 2012
Edited: Craig on 20 Jul 2012
What is the dimension of the final system are you trying to get?
For example,
sys = tf(1,[1,1]);
c = 1:10;
results into a 10 input and 10 output system.
c = 1:10;
sys = tf(1,[1,1])
for ct = 1:length(c)
sysvec(:,:,ct) = sys/c(ct);
which is a ten element array of 1 input and 1 output systems.
  1 Comment
aaa on 23 Jul 2012
i think it may be the latter. i will try this and see what results i get. Thanks Craig.

Sign in to comment.

More Answers (1)

lounis chehrit
lounis chehrit on 8 Jun 2021
Hello guys:
I have two signal column vectors ( input and output ) : ( very large but they both have the same size):
x_inp=[0.0001, -0.0233, ..... ]
x_out=[0.005, -0.0053, ..... ]
i also have a system TF, which is represented like this:
Real( H(s) ) = 23 cos (2*pi*s) + 12 cos (5*pi*s/10) + 1 cos (2*pi*s)/19 + 0.75 cos (5*pi*s/10).
Imag( H(s) ) =11 sin (3*pi*s) + 7 cos (9*pi*vs2) + 10 sin (2*pi*s)/2 + 1.25 sin (4*pi*s/18).
I want to know if , TF( x_out / x_inp ) = H(s).
I tried this :
sys = Real( H(s) ) + i.* Imag (H(s) ).
so to compute the TF( x_out / x_inp ) i did this :
TL1 = tf ( x_inp )
TL2 = tf ( x_out).
and then :
signal = TL2 ./ TL1.
But it doesn't work.
Can anyone please, tell me how can i compute that tf and compare them to the H(s) system.
Or is there another method to see if TF( x_out / x_inp ) = H(s) ? Wether fft method or something like that.
Thank you in advance !

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by