Answered

How to use the Assignment block?

I thing the proper modeling pattern for this case would be an "If Subsystem" connected to two "If-Action" subsystems. If condit...

How to use the Assignment block?

I thing the proper modeling pattern for this case would be an "If Subsystem" connected to two "If-Action" subsystems. If condit...

4 days ago | 0

Answered

Simulink Library Code Generation

Yes this is possible, but only if you ahve an Embedded Coder license. You must first configure the library blocks as follows: ...

Simulink Library Code Generation

Yes this is possible, but only if you ahve an Embedded Coder license. You must first configure the library blocks as follows: ...

4 days ago | 0

Answered

Can I call a Simulink generated DLL file in a Simulink model (Matlab 2018b)?

Yes, creating an S-Function one possible approach. I presonally prefer the legacy_code tool, but S-Function builder will also w...

Can I call a Simulink generated DLL file in a Simulink model (Matlab 2018b)?

Yes, creating an S-Function one possible approach. I presonally prefer the legacy_code tool, but S-Function builder will also w...

4 days ago | 0

Answered

Generate .exe or any other executable for simulink model

Yes, this can be done if you have a Simulink Coder license.

Generate .exe or any other executable for simulink model

Yes, this can be done if you have a Simulink Coder license.

4 days ago | 0

Answered

Debugging C S-Functions called from simulink using Visual Studio Code

https://www.mathworks.com/help/simulink/sfg/debugging-c-mex-s-functions.html

Debugging C S-Functions called from simulink using Visual Studio Code

https://www.mathworks.com/help/simulink/sfg/debugging-c-mex-s-functions.html

29 days ago | 0

| accepted

Answered

How to use structure pointer as an argument of function in code generation?

You should be able to get a pointer to the struct passed to your function if you configure the subsystem to be atomic and set th...

How to use structure pointer as an argument of function in code generation?

You should be able to get a pointer to the struct passed to your function if you configure the subsystem to be atomic and set th...

29 days ago | 0

Answered

integrate two simulink models

Create a new simulink model. Place 2 model blocks inside the new model, assign one model block to the ABS model, the other to t...

integrate two simulink models

Create a new simulink model. Place 2 model blocks inside the new model, assign one model block to the ABS model, the other to t...

1 month ago | 0

Answered

How to simulate huge simulink mode in GPU ?

Simulink does not support GPU for model building or code generation.

How to simulate huge simulink mode in GPU ?

Simulink does not support GPU for model building or code generation.

1 month ago | 0

Answered

Simulink code generation utility function

If you change the configuration parameter UtilityFunctionGeneration to "Shared location", set_param(bdroot,'UtilityFuncGener...

Simulink code generation utility function

If you change the configuration parameter UtilityFunctionGeneration to "Shared location", set_param(bdroot,'UtilityFuncGener...

1 month ago | 0

| accepted

Answered

PWork initialization in c++ s-Function with 'Update Diagram' routine

Check aliveCounter for NULL before trying to delete it.

PWork initialization in c++ s-Function with 'Update Diagram' routine

Check aliveCounter for NULL before trying to delete it.

1 month ago | 0

Answered

how to solve this problem

It looks like a problem in the Message Viewer block. Comment out the block to confirm. You might be able to fix by deleting cu...

how to solve this problem

It looks like a problem in the Message Viewer block. Comment out the block to confirm. You might be able to fix by deleting cu...

1 month ago | 0

Answered

Reuse a State Multiple Times in a Chart (variable times)

One option could be to use a Simulink For-Each subsystem. Inside the for-each subsystem would be a single instance of the state...

Reuse a State Multiple Times in a Chart (variable times)

One option could be to use a Simulink For-Each subsystem. Inside the for-each subsystem would be a single instance of the state...

1 month ago | 1

| accepted

Solved

Project Euler: Problem 6, Natural numbers, squares and sums.

The sum of the squares of the first ten natural numbers is, 1^2 + 2^2 + ... + 10^2 = 385 The square of the sum of the first ...

2 months ago

Solved

Project Euler: Problem 2, Sum of even Fibonacci

Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 te...

2 months ago

Solved

Interpolator

You have a two vectors, a and b. They are monotonic and the same length. Given a value, va, where va is between a(1) and a(end...

2 months ago

Solved

Create a dictionary

The goal is to write a function that returns a dictionary from a list of words or phrases and their definitions. Here is an exam...

2 months ago

Solved

Back to basics 23 - Triangular matrix

Covering some basic topics I haven't seen elsewhere on Cody. Given an input matrix, return a matrix with all elements above a...

2 months ago

Solved

SET (the card game)

<http://www.setgame.com/set/index.html SET> is a card game in which players try to find valid 3-card sets from 12 cards on the t...

2 months ago

Answered

How to be sure that the Simulink model is receiving right tunable parameters?

I found this in the help. Looks like you need to set RapidAcceleratorUpToDateCheck to 'on' Accelerator and SIL/PIL Simula...

How to be sure that the Simulink model is receiving right tunable parameters?

I found this in the help. Looks like you need to set RapidAcceleratorUpToDateCheck to 'on' Accelerator and SIL/PIL Simula...

3 months ago | 0

Solved

Poker Card Deal!

Anyone want to play a card game? Well this is making one deck of cards, with the option of using 2 jokers. The outputs are ...

3 months ago

Answered

Reference Model replaced by S-Function target code generation

Why did you replace the reference model with an S-Function. Best approach is to simply generate code for top model with referen...

Reference Model replaced by S-Function target code generation

Why did you replace the reference model with an S-Function. Best approach is to simply generate code for top model with referen...

3 months ago | 0

Answered

Issue with Integer rounding mode: Floor in Simulink

For the gain block, what are the datatypes for Signal and Parameter? My guess is data type of Parameter is integer, so gain is ...

Issue with Integer rounding mode: Floor in Simulink

For the gain block, what are the datatypes for Signal and Parameter? My guess is data type of Parameter is integer, so gain is ...

3 months ago | 1

| accepted

Answered

Do Matlab Function blocks in Simulink run at different speeds?

The 4th ML Fcn block will not run until all of it's input signals are calculated. You can view the order that Simulink will exe...

Do Matlab Function blocks in Simulink run at different speeds?

The 4th ML Fcn block will not run until all of it's input signals are calculated. You can view the order that Simulink will exe...

3 months ago | 0

Answered

Run a Simulink Simulation based on Input Data files

https://www.mathworks.com/help/releases/R2018b/simulink/ug/comparison-of-signal-loading-techniques.html

Run a Simulink Simulation based on Input Data files

https://www.mathworks.com/help/releases/R2018b/simulink/ug/comparison-of-signal-loading-techniques.html

3 months ago | 0

Answered

Why is my Data Store Memory's initial value ignored?

Are specifying intial value in the Data Store Memory block and/or the Z-2 block? With this design I think you will need to init...

Why is my Data Store Memory's initial value ignored?

Are specifying intial value in the Data Store Memory block and/or the Z-2 block? With this design I think you will need to init...

3 months ago | 0

| accepted

Solved

Combine Cards to make 21

Given between two and six cards, e.g. A _ 3 _ 7 _ 6 _ 2 place one of the mathematical symbols (+,-,*,/) in the space betw...

3 months ago

Answered

How to find all Graphical function inside a chart

Use the Stateflow API as described here. h = sfroot; gf = h.find('-isa','Stateflow.Function')

How to find all Graphical function inside a chart

Use the Stateflow API as described here. h = sfroot; gf = h.find('-isa','Stateflow.Function')

3 months ago | 0

| accepted

Solved

Mongean Shuffle : 2

Extension to <https://www.mathworks.com/matlabcentral/cody/problems/2479-mongean-shuffle problem 2479>: Determine the number...

3 months ago

Solved

Mongean Shuffle

A Mongean shuffle of an n card deck starts with putting the initial deck on the left hand side. * The top card of the deck is...

3 months ago