vector to sys transformation for bode plot

조회 수: 28 (최근 30일)
aaa
aaa 2012년 7월 1일
답변: lounis chehrit 2021년 6월 8일
Hi,
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
outputs.
How can i resolve this issue such that i can perform the function 'sys' (a transfer function) divided by c (a vector)?

채택된 답변

Craig
Craig 2012년 7월 20일
편집: Craig 2012년 7월 20일
What is the dimension of the final system are you trying to get?
For example,
sys = tf(1,[1,1]);
c = 1:10;
1./c*sys
results into a 10 input and 10 output system.
or
c = 1:10;
sys = tf(1,[1,1])
for ct = 1:length(c)
sysvec(:,:,ct) = sys/c(ct);
end
which is a ten element array of 1 input and 1 output systems.
  댓글 수: 1
aaa
aaa 2012년 7월 23일
i think it may be the latter. i will try this and see what results i get. Thanks Craig.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

lounis chehrit
lounis chehrit 2021년 6월 8일
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 !

카테고리

Help CenterFile Exchange에서 Plot Customization에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by