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 ...

4 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);...

4 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...

4 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...

5 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 ...

5 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...

5 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 ...

5 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...

6 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...

6 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

Solved

Find the sum of all the numbers of the input vector

Find the sum of all the numbers of the input vector x. Examples: Input x = [1 2 3 5] Output y is 11 Input x ...

7 years ago

Solved

Make the vector [1 2 3 4 5 6 7 8 9 10]

In MATLAB, you create a vector by enclosing the elements in square brackets like so: x = [1 2 3 4] Commas are optional, s...

7 years ago

Solved

Times 2 - START HERE

Try out this test problem first. Given the variable x as your input, multiply it by two and put the result in y. Examples:...

7 years ago

Question

Using Masks inside referenced models

The doc page here: <http://www.mathworks.com/help/releases/R2012a/toolbox/simulink/ug/bqonbts-1.html> says: "To use a mask...

8 years ago | 1 answer | 1

Question

Model Callbacks in Referenced Models

I see inconsistent behavior in the execution of model callback functions in model references. Should the model callback functio...

8 years ago | 1 answer | 1

Question

Using RandStream objects in mask initialization code

Is it possible to use a RandStream object in mask initialization code? For example, in the mask initialization, I'd like to be ...

8 years ago | 1 answer | 1

Answered

Discrepancy between using function 'feedback()' and calculating manually

cl2 can be simplfied by canceling s out of the numerator and denominator of each entry. After that you'll see that cl2 and cl1 ...

Discrepancy between using function 'feedback()' and calculating manually

cl2 can be simplfied by canceling s out of the numerator and denominator of each entry. After that you'll see that cl2 and cl1 ...

9 years ago | 0

| accepted

Answered

Is it possible to calculate and hold a value constant during the Simulink calculation

Put the calculation inside a triggered subsystem and make the output of the system the desired calculated value. Trigger the sub...

Is it possible to calculate and hold a value constant during the Simulink calculation

Put the calculation inside a triggered subsystem and make the output of the system the desired calculated value. Trigger the sub...

9 years ago | 1

| accepted

Question

Why does EMLMEX generate a slow mex file?

I have an eml-compatibile m-function that I converted to a mex file using emlmex. The m-function takes about 0.11 seconds to ru...

9 years ago | 3 answers | 0

Question

What makes Rapid Accelerator regenerate code?

I have a very simple model containing a top model and two Model blocks that reference the same model. When I run with Rapid Acc...

9 years ago | 1 answer | 0

Question

How can I control signal logging in referenced models?

AFAIK, the only way to control signal logging in a referenced model is by right clicking on the model block and pulling up the M...

9 years ago | 2 answers | 0

Question

Can the value of a parameter in a model workspace be determined programatically and not dirty the model workspace?

The only way I know of to determine the value of a parameter in the model workspace is like this: hws = get_param('mymodel','...

9 years ago | 1 answer | 1

Question

Is the Model Workspace dirty?

Is there a programatic way to determine if the model workspace is dirty, which is indicated by an asterisk next to "Model Worksp...

9 years ago | 2 answers | 0