Specified key type does not match the type expected for this container. in Simulink code from TCLAB (using Arduino Leonardo and TCLab)

조회 수: 2 (최근 30일)
Hi i'm trying to run the TCLab Code for PID in the simulink files, package from Matlab and Simulink for arduino installed correctly, but at the moment of running the program the following picture shows:
Error due to multiple causes.
Caused by:
Specified key type does not match the type expected for this container.
Error evaluating MATLAB function in 'arduino_pid/Temperature Control Lab/Arduino/Arduino'
When i try to Run the code from Simulink it shows:
An error occurred while running the simulation and the simulation was terminated
Caused by:
And a yellow error block showing a Matlab function block of 'interpreted MATLAB fcn.
There are the same code, one is running from the MATLAB Console and the other is running from a .slx file (it shouldn't matter cause is the same file).
And reinstalling or remove package and add-ons isnt working , thanks in advance. (this error is caused in the 2023b version)

채택된 답변

Uday
Uday 2023년 10월 23일
Dear Camilo,
As per my understanding, you are encountering an issue while trying to run the “TCLab” Code for “PID” in Simulink. You’ve also mentioned that reinstalling or removing packages and add-ons hasn’t resolved the issue.
Here are some possible solutions to resolve the error:
  1. Check Key Type: The error message suggests that there might be a mismatch between the expected key type and the specified key type in your code.
  2. Interpreted MATLAB Function Block: You mentioned a yellow error block showing a MATLAB function block of “interpreted MATLAB fcn”’. The Interpreted MATLAB Function block applies a specified MATLAB function or expression to the input. If there’s an issue with this function or expression, it could lead to errors: https://www.mathworks.com/help/simulink/slref/interpretedmatlabfunction.html.
  3. Reinstallation Issues: If reinstalling or removing packages and add-ons isn’t working, ensure that you’re following the correct steps for uninstallation and reinstallation. Since you mentioned that this error is occurring in the 2023b version, it’s possible that there might be some compatibility issues, check for the compatibility issues if any (https://www.mathworks.com/hardware-support/arduino.html).
I hope this helps!
  댓글 수: 1
Camilo Vicente Gonzalez Pozo
Camilo Vicente Gonzalez Pozo 2023년 10월 25일
Thanks Uday , most probably is that MATLAB 2023b no longer support interpreted MATLAB fcn , because i tried the same code in a 2021b version and it works (in the interpreted MATLAB fcn was a notification of end in support that block), do you think if i re code that blocks with a s-function or MATLAB function block , maybe i could Run the code successfully ?

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Programmatic Model Editing에 대해 자세히 알아보기

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by