Error occurred while running the simulation and the simulations was terminated. Caused by: MATLAB expression '<output of coder.inte​rnal.mxSub​script>' is not numeric.

2 ビュー (過去 30 日間)
I am attempting to implement a Simulink model that uses inputs from a MySQL database. I currently have a MATLAB function block in simulink that uses the database() function to establish a connection to the MySQL database, and uses a fetch() command to retrieve the data from the last row of the database table. The function block has no inputs and the output of the function block are six values from the MySQL database table that are integers.
For example: function [y1,y2,y3,y4,y5,y6] = mySQLfunction(), where y are values from the MySQL table.
The function that I have created works as intended in MATLAB, but when I attempt to implement it in Simulink, the error given in the title is triggered. I have never encountered this issue and have done some digging as to what the issue is, but no luck so far. I understand that this may have something to do with the data from the database being read as mxArray instead of int or double, as I had some issues with that as well (solved by initializing the variables being assinged the values from the database).
Any help with this issue is appriciated.
To reiterate the problem: a function that I have created in MATLAB to read a row from a table in a MySQL databse, and outputs the contents of the table as six values (see function decleration example above). This function works as intended when implemented in MATLAB, but throws the error shown in the title when implemented in Simulink.
Thank you!

回答 (0 件)

カテゴリ

Help Center および File ExchangeDatabase Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by