how to generate MATLAB code from Simulink model

조회 수: 131 (최근 30일)
Keymand Kiani
Keymand Kiani 2018년 10월 26일
댓글: Walter Roberson 2025년 4월 2일
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
Amare
Amare 2024년 6월 29일
give mathalba code for abouv question
Walter Roberson
Walter Roberson 2024년 6월 30일
  1. That looks like a Doit4Me
  2. It is confusing whether the work is to be done in Simulink or in MATLAB

댓글을 달려면 로그인하십시오.

답변 (5개)

Eric Sargent
Eric Sargent 2020년 12월 9일
편집: Eric Sargent 2020년 12월 9일
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 2018년 10월 31일
편집: Walter Roberson 2024년 6월 30일
There is no support for what you are doing.
You can use Simulink Real Time Explorer, using instrument panels for user interaction.
  댓글 수: 2
Amare
Amare 2024년 7월 5일
cheak it refuse to run
Walter Roberson
Walter Roberson 2024년 7월 5일
It sounds like you do not have Simulink Real Time Explorer installed.

댓글을 달려면 로그인하십시오.


puli
puli 2022년 10월 5일
편집: Walter Roberson 2022년 10월 5일
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:
  댓글 수: 1
Walter Roberson
Walter Roberson 2022년 10월 5일
How does this answer the Question about compiling Simulink ?

댓글을 달려면 로그인하십시오.


EDMOND
EDMOND 2023년 7월 22일
How to convert binary code to gray code in matlab
  댓글 수: 1
Walter Roberson
Walter Roberson 2025년 4월 2일
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.

댓글을 달려면 로그인하십시오.


sandeepnaik
sandeepnaik 2025년 4월 2일
samrt and sustainable agriculture
  댓글 수: 1
Walter Roberson
Walter Roberson 2025년 4월 2일
Please expand on your answer. I do not understand how this answer solves problems with compiling Simulink code.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Simulink Coder에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by