Matlab simulink error: Only finite double vector or matrix outputs are supported.
16 次查看(过去 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
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
采纳的回答
更多回答(1 个)
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
2021-6-9
Hi,Ting Liang,
Excuse me,
I encountered the same problem too,have you solved this problem now?
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Event Functions 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!