필터 지우기
필터 지우기

Convert tf to struct

조회 수: 16 (최근 30일)
João
João 2016년 7월 9일
댓글: Walter Roberson 2022년 7월 13일
How do I convert a 2x2 tf to 2x2 struct?
  댓글 수: 1
Steven Lord
Steven Lord 2016년 7월 9일
Why do you want to do this?

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

답변 (2개)

Amanjeet Pani
Amanjeet Pani 2022년 7월 13일

Walter Roberson
Walter Roberson 2022년 7월 13일
G11 = tf([1 2], [3 4]);
G12 = tf([3 4], [5 6 7]);
G21 = tf([8], [9 10]);
G22 = tf([11 12 13], [14 15 16 17]);
G = [G11, G12; G21, G22]
G = From input 1 to output... s + 2 1: ------- 3 s + 4 8 2: -------- 9 s + 10 From input 2 to output... 3 s + 4 1: --------------- 5 s^2 + 6 s + 7 11 s^2 + 12 s + 13 2: --------------------------- 14 s^3 + 15 s^2 + 16 s + 17 Continuous-time transfer function.
S(1,1) = struct(G(1,1));
Warning: Calling STRUCT on an object prevents the object from hiding its implementation details and should thus be avoided. Use DISP or DISPLAY to see the visible public details of an object. See 'help struct' for more information.
S(1,2) = struct(G(1,2));
Warning: Calling STRUCT on an object prevents the object from hiding its implementation details and should thus be avoided. Use DISP or DISPLAY to see the visible public details of an object. See 'help struct' for more information.
S(2,1) = struct(G(2,1));
Warning: Calling STRUCT on an object prevents the object from hiding its implementation details and should thus be avoided. Use DISP or DISPLAY to see the visible public details of an object. See 'help struct' for more information.
S(2,2) = struct(G(2,2));
Warning: Calling STRUCT on an object prevents the object from hiding its implementation details and should thus be avoided. Use DISP or DISPLAY to see the visible public details of an object. See 'help struct' for more information.
S
S = 2×2 struct array with fields:
Numerator Denominator Variable IODelay Variable_ ioDelayMatrix InputDelay OutputDelay Ts TimeUnit InputName InputUnit InputGroup OutputName OutputUnit OutputGroup Notes UserData u y TimeUnit_ InputName_ InputUnit_ InputGroup_ OutputName_ OutputUnit_ OutputGroup_ Notes_ CrossValidation_ Name Name_ IOSize_ Version_ SamplingGrid Data_ SamplingGrid_
  댓글 수: 1
Walter Roberson
Walter Roberson 2022년 7월 13일
Not sure what benefit this gives compared to just indexing the tf object.

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

카테고리

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

제품

Community Treasure Hunt

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

Start Hunting!

Translated by