Borrar filtros
Borrar filtros

Matlab simulink error: Only finite double vector or matrix outputs are supported.

59 visualizaciones (últimos 30 días)
In my simulink model where i am using block "Interpreted Matlab function" and the function is:
function test = testFunc()
test = [int16(0) int16(0)]
i get error :
An error occurred while running the simulation and the simulation was terminated Caused by:
Error in 'test2/Interpreted MATLAB Function'. Evaluation of expression resulted in an invalid output. Only finite double vector or matrix outputs are supported
Edit: It crashes in second iteration
What am i doing wrong? Thanks for help
  1 comentario
budi raharjo
budi raharjo el 1 de Jul. de 2018
Editada: budi raharjo el 2 de Jul. de 2018
I have tried by use coder.nullcopy() and it works.
function d=functionsx(s)
a=[5 5 6; 7 6 8];
b=a+s;
d = coder.nullcopy(zeros(size(b)));
d=b

Iniciar sesión para comentar.

Respuesta aceptada

Birdman
Birdman el 2 de Nov. de 2017
Why interpreted matlab function for a function like this? Can't you use instead Data Type Conversion block for it?
  5 comentarios
Birdman
Birdman el 2 de Nov. de 2017
At the end of the page, you'll see Characteristics pane and there, Data Types->Double is written

Iniciar sesión para comentar.

Más respuestas (1)

Xiaoxiong Zhang
Xiaoxiong Zhang el 8 de Mayo de 2019
Maybe your function output is not a double type data, change your output to a double type data and see if it works? I have met the same problem before and I solve it out by changing my output data to double type using "output=double(output)". Hope this is helpful.
  3 comentarios
Zihao Qi
Zihao Qi el 9 de Jun. de 2021
Hi,Ting Liang,
Excuse me,
I encountered the same problem too,have you solved this problem now?

Iniciar sesión para comentar.

Categorías

Más información sobre Configure and View Diagnostics en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by