how to generate MATLAB code from Simulink model

74 Ansichten (letzte 30 Tage)
Keymand Kiani
Keymand Kiani am 26 Okt. 2018
Kommentiert: Walter Roberson am 2 Apr. 2025
Hi, I have a relatively complex simulink model, from which a MATLAB code must be generated. I want to use the generated code in App designer to develop an app and finally compile the app using `Application Compiler`, so that it can be used on every system without having MATLAB installed. The process can be summed up as the following: Simulink --> MATLAB code (.m) --> App Designer --> Application compiler (.exe)
  7 Kommentare
Amare
Amare am 29 Jun. 2024
give mathalba code for abouv question
Walter Roberson
Walter Roberson am 30 Jun. 2024
  1. That looks like a Doit4Me
  2. It is confusing whether the work is to be done in Simulink or in MATLAB

Melden Sie sich an, um zu kommentieren.

Antworten (5)

Eric Sargent
Eric Sargent am 9 Dez. 2020
Bearbeitet: Eric Sargent am 9 Dez. 2020
As of R2020a you can use Simulink Compiler to compile your model and use it with your deployed / compiled App Designer app.
More information about Simulink Compiler can be found here:

Walter Roberson
Walter Roberson am 31 Okt. 2018
Bearbeitet: Walter Roberson am 30 Jun. 2024
There is no support for what you are doing.
You can use Simulink Real Time Explorer, using instrument panels for user interaction.
  2 Kommentare
Amare
Amare am 5 Jul. 2024
cheak it refuse to run
Walter Roberson
Walter Roberson am 5 Jul. 2024
It sounds like you do not have Simulink Real Time Explorer installed.

Melden Sie sich an, um zu kommentieren.


puli
puli am 5 Okt. 2022
Bearbeitet: Walter Roberson am 5 Okt. 2022
image = imread('jump.jpg'); % read image
Error using imread>get_full_filename
File "jump.jpg" does not exist.

Error in imread (line 372)
fullname = get_full_filename(filename);
% get image dimensions: an RGB image has three planes
% reshaping puts the RGB layers next to each other generating
% a two dimensional grayscale image
[height, width, planes] = size(image);
rgb = reshape(image, height, width * planes);
imagesc(rgb); % visualize RGB planes
colorbar on % display colorbar
r = image(:, :, 1); % red channel
g = image(:, :, 2); % green channel
b = image(:, :, 3); % blue channel
The result is:

EDMOND
EDMOND am 22 Jul. 2023
How to convert binary code to gray code in matlab
  1 Kommentar
Walter Roberson
Walter Roberson am 2 Apr. 2025
https://www.mathworks.com/help/comm/ug/symbol-mapping-examples.html shows how to use comm.PSKModulator for gray code.
For standaline functions to convert to gray code, check the File Exchange; there are several there.

Melden Sie sich an, um zu kommentieren.


sandeepnaik
sandeepnaik am 2 Apr. 2025
samrt and sustainable agriculture
  1 Kommentar
Walter Roberson
Walter Roberson am 2 Apr. 2025
Please expand on your answer. I do not understand how this answer solves problems with compiling Simulink code.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Simulink Coder finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by