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

조회 수: 17 (최근 30일)
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
budi raharjo
budi raharjo 2018년 7월 1일
편집: budi raharjo 2018년 7월 2일
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

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

채택된 답변

Birdman
Birdman 2017년 11월 2일
Why interpreted matlab function for a function like this? Can't you use instead Data Type Conversion block for it?
  댓글 수: 5
Birdman
Birdman 2017년 11월 2일
At the end of the page, you'll see Characteristics pane and there, Data Types->Double is written

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

추가 답변 (1개)

Xiaoxiong Zhang
Xiaoxiong Zhang 2019년 5월 8일
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
Zihao Qi
Zihao Qi 2021년 6월 9일
Hi,Ting Liang,
Excuse me,
I encountered the same problem too,have you solved this problem now?

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

카테고리

Help CenterFile Exchange에서 Event Functions에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by