Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7960365
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:44:07+00:00 2026-06-04T04:44:07+00:00

I’m iterating a single-input-single-output linear system by sending inputs to it and getting outputs

  • 0

I’m iterating a single-input-single-output linear system by sending inputs to it and getting outputs from it. The nominator and denominator of the transfer function of the system are represented by Nom and Den in the code respectively.

Nom and Den are calculated after some complex operations on some polynomials, so I don’t have prior information on the degree of these polynomials. The only thing I know is that the system is proper (i.e.; the degree of Den is greater than or equal to the degree of Nom).

My code goes like this:

% ...

Nom = (...);  % calculated after some complex operations
Den = (...);  % calculated after some complex operations

[A, B, C, D] = tf2ss(Nom, Den);
x = zeros(size(B));  % state vector
xp = x;              % derivative of the state vector

% ...

for t = 0 : SAMPLING_PERIOD : TIME_END
    % ...
    xp = A * x + B * u;    % 'u' is some scalar input, calculated in the code previously
    y  = C * x + D * u;    % 'y' is some irrelevant output signal, to be used in somewhere else in the code
    x  = xp * SAMPLING_PERIOD;
    % ...
end

% ...

When Den is 0th order (which requires Nom to be 0th order as well), tf2ss() returns empty matrices for A, B, C and D. This is somewhat problematic in my other parts of code. I need these matrices to be at least 1-by-1.

So, my question is, what equivalent non-empty matrices can I use instead of A, B, C and D for those who return empty? For example, can I assume that all empty matrices are 1-by-1 zero matrices?


Example:

[A, B, C, D] = tf2ss([1], [2])
returns
A = [] % Empty matrix
B = [] % Empty matrix
C = [] % Empty matrix
D = 0.5 % 1-by-1 matrix

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T04:44:08+00:00Added an answer on June 4, 2026 at 4:44 am

    Ultimelty, you need to understand what the output is providing.

    The way the code is written for tf2ss, if size(den) = 1 then a = b =c =[]

    The reason for that is because you are no longer providing a differential equation, and are separating the differential equation component from the output.

    For your purposes, knowing it’s a Single Input Single Output system, A and B can be random matrices, and as long as you have x*C = [0], you should be fine. The idea is there is no real “state to the equation”. However, for your purposes, you should instruct Matlab that there is only a single state which is not influenced by it’s derivative (i.e. the present state, which is accurate for a pure gain system) with A = B = C = 0

    While Matlab may see a difference when building the system, the reality is they are the same:

    [A, B, C, D] = tf2ss([1], [2]);
    H2 = ss(0,0,0,D);
    H1 = ss(A,B,C,D);
    bode(H1/ H2)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I need to clean up various Word 'smart' characters in user input, including but
I have a text area in my form which accepts all possible characters from
Does anyone know how can I replace this 2 symbol below from the string
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I am currently running into a problem where an element is coming back from
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.