Evaluate function real-time in Simulink

3 visualizaciones (últimos 30 días)
Gergely Hunyady
Gergely Hunyady el 27 de Ag. de 2019
Comentada: Gergely Hunyady el 28 de Ag. de 2019
Hy,
I have the following function in Simulink, which i would like to evaluate for all X, Y values in real-time.
The inputs for X and Y are real time values, changing with sample time, PX and PY are column vectors, which i am searching the optimal point in, LAD is a constant value.
The function searches the point exactly as far from X, Y as the value of LAD and would give it back through GX and GY in real time, but shows me the following error:
The function ports are shown here:
How can I get this done?
Thank you for your help in advance.
Gergely Hunyady

Respuestas (1)

Fangjun Jiang
Fangjun Jiang el 27 de Ag. de 2019
Open the MATLAB function, click "Edit Data", specify the "size" of output GX and GY. Most common is the change from "-1" (inherient) to "1" (scalar).
  1 comentario
Gergely Hunyady
Gergely Hunyady el 28 de Ag. de 2019
Hy,
This should solve some problem, but even if the output is accepted, real-time calculation would not happen.
I will solve this with S-Functions, just need to understand how it works, for example NumDiscStates
Gergely Hunyady

Iniciar sesión para comentar.

Categorías

Más información sobre Simulink en Help Center y File Exchange.

Productos


Versión

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by