Answered
Create a switch case in simulink and generate a .c file
You can do this in Simulink with a multi-port switch block and then generate code with Simulink coder or Embedded Coder. http...

9 months ago | 0

Answered
Is it possible to generate a Matlab script from a Simulink model?
There is no such utility to do this.

9 months ago | 0

| accepted

Answered
Where is the Location of CMakeLists File When I Build Simulink Model With CMake?
On Windows only Visual Studio 2019 is supported. DDS Blockset System Requirements - MATLAB & Simulink (mathworks.com) Thanks. ...

9 months ago | 1

| accepted

Answered
Where is the Location of CMakeLists File When I Build Simulink Model With CMake?
Did you configure the SImulink model for RTI Connext or eProsima? If RTI Connext DDS, do you have MS Visual Studio 2019 install...

9 months ago | 0

Answered
Use of m-scripts in SIMULINK
There is nothing wrong with using Simulink to architect a system comprised entirely of MATLAB Function blocks. NASA has develop...

9 months ago | 0

| accepted

Answered
build the s-function from cli
https://www.mathworks.com/help/simulink/slref/legacy_code.html

9 months ago | 0

Answered
matlab does not see C/C++ compilers
The link you followed for installing the mingw compiler is obsolete. You should use the Add-On Manager to install the proper mi...

9 months ago | 1

| accepted

Answered
Preferred approach for code generation with MATLAB embedded coder
Why are you manually reviewing the generated C code? Many workflows require review of the MATLAB code and then test cases that ...

9 months ago | 0

| accepted

Answered
CodeGen Error using Grouped custom storage classes (struct / bitfield) with referenced model
As the error message indicates, you must write the header file by hand that defines the C structure, and then set the struct sto...

9 months ago | 1

Answered
How do you generate a PWM signal through S function in C.I am facing a build error while building.Could anyone help me in this issue.
Why are you writing an S-Function for this simple C algorithm. If you must write this in C, I suggest using the C Function bloc...

10 months ago | 0

Answered
Parameter writer block use case issue
It sounds like the value for the Constant block is not TEMP. You need to double click on the Constant block and enter "TEMP" as...

10 months ago | 0

Answered
How to have a variable size array out of matlab function block and export that data to matlab (To Workspace) to plot ?
Rather than connecting to a "to workspace" block, did you try right mouse clicking on the signal and marking it as "log" and the...

10 months ago | 0

Answered
Getting issue with init.m files while loading the .slx model in matlab
Set a break point in init.m and then rerun the load_system commands to determine the possible problem.

10 months ago | 0

Answered
set_param invalid setting error
It looks like you have a mask on a subsystem and are using that mask to control the variant choice. You need to associate that ...

10 months ago | 0

| accepted

Answered
Stateflow chart output Initialization
Best guess is the the StateChart also writes to the output on the first activation so the initial value you specifed is optimize...

10 months ago | 1

Answered
How to access structure elements in the stateflow charts
You will need to create a Simulink.Bus with the same layout as the matlab structure. Create a Simulink.Parameter called CarConf...

10 months ago | 0

Answered
Level-2 S-Function doesn't compile after exporting code with Embedded Coder - 'mwSize' type unknown
You are better off inlining the s-function. If you'd prefer to not write the TLC code required for inlining the C function, you...

10 months ago | 0

| accepted

Answered
How to call user-defined C function having return and arguments with GetSet storage class
You should use coder.ceval() to call external C code from Stateflow. https://www.mathworks.com/help/simulink/slref/coder.ceval.h...

10 months ago | 0

Answered
Generate exported_enum_type.h file with different name without modifying getHeaderFile()
The only way to change the header file name is by modifying the getHeaderFile() function. Thanks. Mark.

10 months ago | 1

| accepted

Answered
Facing code generation issue
This looks like a bug in the code generator. Submit your model and error log to support@mathworks.com

10 months ago | 0

Answered
Simulink variable in Code Composer Studio stops incrementing
It sounds like that section of your code is no longer running. You can use CCS to set a breakpoint to confirm this or you can a...

10 months ago | 0

Answered
How to call a .dll and .h into Simulink Realtime?
You can use the C Caller block to do this. Rather than source code, provide the .dll in the "Libraries" tab of the Custom Code ...

11 months ago | 0

Solved


Fibonacci Decomposition
Every positive integer has a unique decomposition into nonconsecutive Fibonacci numbers f1+f2+ ... Given a positive integer n, r...

11 months ago

Solved


How many Fibonacci numbers?
Find the number of unique Fibonacci numbers (don't count repeats) in a vector of positive integers. Example: x = [1 2 3 4...

11 months ago

Solved


Number of Even Elements in Fibonacci Sequence
Find how many even Fibonacci numbers are available in the first d numbers. Consider the following first 14 numbers 1 1 2...

11 months ago

Solved


Fibonacci-Sum of Squares
Given the Fibonacci sequence defined by the following recursive relation, * F(n) = F(n-1) + F(n-2) * where F(1) = 1 and F(1)...

11 months 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: Input...

11 months ago

Solved


Pi Digit Probability
Assume that the next digit of pi constant is determined by the historical digit distribution. What is the probability of next di...

11 months ago

Solved


Volume Pillar
Calculate the volume of a pillar with radius l and heigth ar.

12 months ago

Solved


Convert radians to degrees
Given input in radians, output to degrees

12 months ago

Load more