A résolu


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

plus de 13 ans il y a

A résolu


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

plus de 13 ans il y a

A résolu


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

plus de 13 ans il y a

A résolu


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

plus de 13 ans il y a

A résolu


Add two numbers
Given a and b, return the sum a+b in c.

plus de 13 ans il y a

A résolu


Is my wife right?
Regardless of input, output the string 'yes'.

plus de 13 ans il y a

A résolu


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

plus de 13 ans il y a

A résolu


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

plus de 13 ans il y a

A résolu


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

plus de 13 ans il y a

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

plus de 13 ans il y a | 1 réponse | 1

1

réponse

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

presque 14 ans il y a | 1 réponse | 1

1

réponse

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

presque 14 ans il y a | 1 réponse | 1

1

réponse

Réponse apportée
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 ...

plus de 15 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 15 ans il y a | 1

| A accepté

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

plus de 15 ans il y a | 3 réponses | 0

3

réponses

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

plus de 15 ans il y a | 1 réponse | 0

1

réponse

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

plus de 15 ans il y a | 2 réponses | 0

2

réponses

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

plus de 15 ans il y a | 1 réponse | 1

1

réponse

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

plus de 15 ans il y a | 2 réponses | 0

2

réponses

Question


How can I log signals in referenced models while running rapid accelerator?
Is it possible to log signals in referenced models in Simulink when the simulation is running under rapid accelerator? As far a...

plus de 15 ans il y a | 1 réponse | 1

1

réponse