Answered

simulation on matlab (not on simulink)

If have the a license for the Control System Toolbox you can use the connect function to build the model you want from a block d...

simulation on matlab (not on simulink)

If have the a license for the Control System Toolbox you can use the connect function to build the model you want from a block d...

3 days ago | 0

Answered

Easier way to remove a response from a response plot (bodeplot, stepplot, etc.)?

Does this do what you want: delete(h.Responses(idx))

Easier way to remove a response from a response plot (bodeplot, stepplot, etc.)?

Does this do what you want: delete(h.Responses(idx))

5 days ago | 0

| accepted

Answered

How to compute control system's performance parameters?

stepinfo(y,t) If you want to use the output from step. Note that stepinfo using the transfer function gives a peculiar result ...

How to compute control system's performance parameters?

stepinfo(y,t) If you want to use the output from step. Note that stepinfo using the transfer function gives a peculiar result ...

6 days ago | 0

Answered

convolution of Heaviside function

Why are do you have a negative sign in the equation for c? You need to scale the discrete convolution, i.e., the output of conv...

convolution of Heaviside function

Why are do you have a negative sign in the equation for c? You need to scale the discrete convolution, i.e., the output of conv...

7 days ago | 1

| accepted

Answered

I want to simulate with various input.

As a general approach, you can compute the impulse response of the product of the transfer function and the input. H = tf(1,[1 ...

I want to simulate with various input.

As a general approach, you can compute the impulse response of the product of the transfer function and the input. H = tf(1,[1 ...

7 days ago | 0

| accepted

Answered

Initial Conditions for first derivative defined as a transfer function

Rob, a. from your clarificatiion, it sounds like you really have a linear, time varying system. So you don't have a transfer fu...

Initial Conditions for first derivative defined as a transfer function

Rob, a. from your clarificatiion, it sounds like you really have a linear, time varying system. So you don't have a transfer fu...

24 days ago | 0

| accepted

Answered

What frustrates you about MATLAB? #2

The documentation. I hate to say that because I do think that TMW puts a lot of effort into the documentation, which makes it a...

What frustrates you about MATLAB? #2

The documentation. I hate to say that because I do think that TMW puts a lot of effort into the documentation, which makes it a...

24 days ago | 1

Answered

What frustrates you about MATLAB? #2

When the debugger stops at a breakpoint, why does the focus and cursor go to the breakpoint, as opposed to the command line? I a...

What frustrates you about MATLAB? #2

When the debugger stops at a breakpoint, why does the focus and cursor go to the breakpoint, as opposed to the command line? I a...

1 month ago | 0

Answered

Number of necessary time steps to handle a Zero-Crossing?

I will speculate on what is happening here. One comment applicable to all three cases is that none of the models involve states...

Number of necessary time steps to handle a Zero-Crossing?

I will speculate on what is happening here. One comment applicable to all three cases is that none of the models involve states...

1 month ago | 0

Answered

Block parameter and values in simulink

get_param(gcb,'DialogParameters') That function returns a struct with all of the dialog parameters for the current block. Or re...

Block parameter and values in simulink

get_param(gcb,'DialogParameters') That function returns a struct with all of the dialog parameters for the current block. Or re...

2 months ago | 0

| accepted

Answered

Why is my MATLAB's bode plot wildly off?

How do you know what the correct Bode plot is that your taking as your reference for comparison? Basically repeating from Star'...

Why is my MATLAB's bode plot wildly off?

How do you know what the correct Bode plot is that your taking as your reference for comparison? Basically repeating from Star'...

2 months ago | 0

Question

Why Do Some Blocks in the Discrecte Library Not Have a Sample Time Parameter?

The doc page "Blocks for Which Sample Time is Not Recommended" has a section "Appropriate Bocks for the Sample Time Parameter" t...

2 months ago | 1 answer | 0

Question

Why is a Number Divided by Itself Not Equal to Unity?

w=0:(pi/100):pi; w = w([17 66 93]); x = exp(1i*w); x./x ans = 1.0000e+00 + 4.8645e-17i 1.0000e+00 - 4.9461e-17i ...

2 months ago | 1 answer | 1

Answered

why freqz with b [1] is different from freqz with b [1,0]

They should be equivalent and it appears that they basically are: >> which freqz -all C:\Program Files\MATLAB\R2019a\toolbox\s...

why freqz with b [1] is different from freqz with b [1,0]

They should be equivalent and it appears that they basically are: >> which freqz -all C:\Program Files\MATLAB\R2019a\toolbox\s...

2 months ago | 0

| accepted

Answered

Strange behaviour of step response (unstable system)

When you do transfer function math like this, matlab doesn't attempt to deal with poles and zeros that should cancel. Then you c...

Strange behaviour of step response (unstable system)

When you do transfer function math like this, matlab doesn't attempt to deal with poles and zeros that should cancel. Then you c...

2 months ago | 1

| accepted

Answered

Integrator State Port: Why is its use restricted?

Only answering the third, supplementary question .... I think I was able to do what you want without using integrator reset at ...

Integrator State Port: Why is its use restricted?

Only answering the third, supplementary question .... I think I was able to do what you want without using integrator reset at ...

2 months ago | 0

Question

Should mvnrnd Always Advance the State of the Global Stream

Consider the following: >> mu=[1 1]; Sigma=eye(2); rng('default') preu1 = rand(1,3); n1 = mvnrnd(mu,Sigma); u1 = rand(1,3);...

2 months ago | 1 answer | 0

Answered

freqresp gives wrong output for purely real inputs

evalfr evalutes the transfer function at the value of the input argument, which can be an arbitrary complex number. For your exa...

freqresp gives wrong output for purely real inputs

evalfr evalutes the transfer function at the value of the input argument, which can be an arbitrary complex number. For your exa...

2 months ago | 1

Answered

using ss2tf command

Are you sure f is known? It looks like f is the input to you system, in which case your B matirix should be B = [0;1/m] You di...

using ss2tf command

Are you sure f is known? It looks like f is the input to you system, in which case your B matirix should be B = [0;1/m] You di...

3 months ago | 0

Question

Is There a Way to Execute splitapply Functionality on Subtables of Master Table?

Suppose I have a function that operates on a table and returns a row vector: function rowvec = myfunc(Table) Suppose I have a ...

3 months ago | 1 answer | 0

Answered

How can I programatically change the transfer function of an LTI block in Simulink and then linearize the system?

Not sure why you're getting that error message, but it seems you can use a simple approach altogether. Just set the 'LTI system...

How can I programatically change the transfer function of an LTI block in Simulink and then linearize the system?

Not sure why you're getting that error message, but it seems you can use a simple approach altogether. Just set the 'LTI system...

3 months ago | 0

Question

How Do I Use a Structure as the Value in a Constant Block to Form a Bus?

I have a Simulink model with a Constant block feeding a scope. The Contant Value parameter is set to foo, a struct defined this ...

4 months ago | 1 answer | 0

Question

Why Does Simulink Model Sometimes Pause Unexpectedly?

I have a Simulink model that very occasionally decides to pause on its own. As far as I know, I don't have anything in the mode...

4 months ago | 1 answer | 0

Question

How do I Trace a Warning in the Simulink Diagnostic Viewer to the Block that Generated It?

I'm running my simulation and I get the following warning in the Diagnostic Viewer: Altitude is out of range. Valid altitudes a...

5 months ago | 1 answer | 0

Question

Why does changing a Subsystem Variant cause code regeneration/recompilation and are there any alternatives?

When Subsystem Variants (and Model Reference) variants first arrived, it was apparent that changing the active variant would cau...

5 years ago | 0 answers | 0

Solved

Determine whether a vector is monotonically increasing

Return true if the elements of the input vector increase monotonically (i.e. each element is larger than the previous). Return f...

7 years ago

Solved

Fibonacci sequence

Calculate the nth Fibonacci number. Given n, return f where f = fib(n) and f(1) = 1, f(2) = 1, f(3) = 2, ... Examples: Inpu...

7 years ago

Solved

Find all elements less than 0 or greater than 10 and replace them with NaN

Given an input vector x, find all elements of x less than 0 or greater than 10 and replace them with NaN. Example: Input ...

7 years ago

Solved

Column Removal

Remove the nth column from input matrix A and return the resulting matrix in output B. So if A = [1 2 3; 4 5 6]; and ...

7 years ago

Solved

Select every other element of a vector

Write a function which returns every other element of the vector passed in. That is, it returns the all odd-numbered elements, s...

7 years ago