Answered
Simulink StateFlow Variable assign
The code gets executed when entering the "Modes" state and every simulation step while the Modes state is active. To understand...

8 years ago | 0

Answered
How to define a 16 bit storage in simulink?
You could try using a <https://www.mathworks.com/help/simulink/slref/datastorememory.html?searchHighlight=data%2520store%2520mem...

8 years ago | 0

| accepted

Answered
Custom sensor library: Execute setup block before others
do you need to execute the configuration block each time "read value" block executes? If so, I use function -call trigger and t...

8 years ago | 0

Answered
How to process CMEX S-Function blocks with variable steps until no signal changes? (Model is interacting with TwinCAT 3)
In your design, the s-function blocks will run only once each time a pulse occurs. If you want the s-function blocks to run N t...

8 years ago | 0

Answered
How to determine a sim. model is being run by itself or as a referencede model?
On the "Data Import/Export" tab of the configuration settings, specify "Input" values for all input ports in the "Load from wor...

8 years ago | 0

| accepted

Answered
Level 2 C++ S-function not showing multiple input output ports
code looks OK. In your Simulink S-Function block, did you create a mask with 207 parameters and pass all 207 parameters in the ...

8 years ago | 0

| accepted

Answered
How to declare and use local variable in level 2 s-function?
You will need to set up a "DWork" variable that gets assigned a value in the mdlStart() function and can then be used in the mdl...

8 years ago | 1

Answered
Loading model into older version of Simulink
Yes, these warnings are due to a version mismatch. You can eliminate these warnings by opening the model in R2015b and then usi...

8 years ago | 0

Answered
Connection between two PCs with Simulink
The solution depends on whether you need real-time performance. If real-time performance is not needed, then you can run Simuli...

8 years ago | 0

| accepted

Answered
Stateflow code generation - how to generate void instead of static void functions?
You could try re-architecting your Stateflow code to use graphical functions. This <https://www.mathworks.com/help/stateflow/ug...

8 years ago | 0

Answered
How to fix gmake error 43?
Although part of the error text is not readable, it looks like problem is related to parameters used in the model. It looks lik...

8 years ago | 0

Answered
Problem using field of structure parameter as constant block value.
You didn't state this, but I assume that RTIP_Param is a Simulink.Parameter? If so, try using RTIP_Param.Gain1. In this case, ...

8 years ago | 0

Answered
How to generate static keyword on local functions
It is currently not possible to do this in Embedded Coder.

8 years ago | 0

Answered
Return Array Pointer with ceval
As described in the <https://www.mathworks.com/help/simulink/slref/coder.ceval.html help> , coder.ceval() can only return a scal...

8 years ago | 1

Answered
Using DDS with Simulink/MATLAB that isn't in the defualt installation location
Hi Eric, Currently the DDS Blockset is set up to use the same DDS libraries for both simulation and code generation, which is o...

8 years ago | 0

Answered
Simulink: dynamic link library initialization routine failed
Simulink gives this error if any depdendent DLL's cant be found at runtime. Make sure canlib32 is on the windows path.

9 years ago | 0

Answered
Create test harness automatically for SIL testing of a model (Embedded Coder)
Yes, test harnesses can be created from referenced models. If you have an SL V&V or SLDV license, you can use slvnvmakeharness...

9 years ago | 0

Answered
StateFlow symbol could resolve to multiple data?
I am guessing that the duplicate symbol error is from the argument you are using for the MATLAB Function. Try changing the argu...

9 years ago | 0

Answered
How can I multiply each bus element with a constant?
This can be done easily with a ML Function block. Code in ML Fcn Block: y = u; elemNames = fieldnames(u); for i=1:numel(el...

9 years ago | 0

Answered
Inserting a space when printing characters using fprintf
You must have stripped out the spaces in m20 before printing. Either add spaces back into m20 before printing or change print st...

9 years ago | 2

Answered
Help needed!!!The function accepts two years and returns the number of days within that interval
function days = days_between_years( firstYear, lastYear ) days = 0; for i=firstYear:lastYear for j=1:...

9 years ago | 0

| accepted

Solved


Wind Chill Computation
On a windy day, a temperature of 15 degrees may feel colder, perhaps 7 degrees. The formula below calculates the "wind chill," i...

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

9 years ago

Solved


Determine if input is odd
Given the input n, return true if n is odd or false if n is even.

9 years ago

Answered
Finding period T from a square signal in Simulink
Feed signal into triggered subsystem. Configure triggered subsystem to active on rising edge. In triggered subsystem, use a Dig...

9 years ago | 0

| accepted

Answered
S-functions with Legacy Code Tool (LCT) in SIL and PIL
Yes the else branch will be used for code generation, which includes SIL and PIL

9 years ago | 0

Answered
Error calling char variable from C code by function block of Simulink
Coder.feval can be used for simulation and code generation. The problem is that your function is supposed to return a single cha...

10 years ago | 0

Answered
In what format does Simulink export signals?
Since the data type of the signal is double, Simulink would send 8 bytes (64 bits) representing the number in IEEE 754 format. ...

10 years ago | 0

Answered
How do I get the SFunction builder to create an SFunction that uses a signed 64 bit integer as input/output?
If you can't migrate to 16a, then here is how you can work around it. It will require you to manually change your .c file and ....

10 years ago | 0

Answered
How do I get the SFunction builder to create an SFunction that uses a signed 64 bit integer as input/output?
Hi Chris, It appears that there is an error in s-function builder in 15b. I was able to reproduce your problem in 15b but then...

10 years ago | 0

Load more