필터 지우기
필터 지우기

Error occurred during compilation in the Simulink project 'Track Point Target in Dense Clutter Using GM-PHD Tracker'

조회 수: 5 (최근 30일)
Hello,
In the Simulink project 'TrackPointTargetsInDenseClutterSimulinkExample', I changed the 'Simulate using' parameter in the Probability Hypothesis Density Tracker bloock from 'Interpreted Execution' to 'code genetation' and then ran the simulation. However, the following error occured during compilation:
An error occurred in the block 'TrackPointTargetsInDenseClutterSimulinkExample/Probability Hypothesis Density Tracker' during compile.
Caused by:
Simulink detected an error
'For code generation, str2func does not support anonymous function character vectors.'.
The error occurred for MATLAB System block 'TrackPointTargetsInDenseClutterSimulinkExample/Probability Hypothesis Density Tracker'. See line 887, column 37 in file 'C:\Program Files\MATLAB\R2023a\toolbox\fusion\fusion\trackingSensorConfiguration.m'. The error was detected during code generation phase.
Start code generation report.
To prevent this error, use one of the following:
* Modify the System object to avoid code that does not support code generation.
* Change 'Simulate using' parameter to 'Interpreted Execution'.
I changed the 'Simulate using' parameter back to 'Interpreted Execution' , but I encountered the same problem when using embedder coder for code generation.

채택된 답변

Prashant Arora
Prashant Arora 2023년 5월 8일
Hi Lechi,
The reason for this error is the use of an anonymous function as a parameter of the PHD tracker block. Simulink does not support this.
This anonymous function is specified through the "Sensor Configurations" parameter of the block as the variable "config". Notice that "config" variable is a struct, which has a field "SensorTransformFcn". This field is currently set to @(x,params)x - which is an anonymous function.
To workaround this issue, use the following steps.
  1. Convert the anonymous function to a regular function on the path. This is replicating the SensorTransformFcn currently used in the example.
function x = transformFcn(x, params)
% Nothing to do
end
2. Specify the new function on the "config" variable using a character vector.
config.SensorTransformFcn = 'transformFcn'
With these two changes, you should be able to run the block in Code Generation mode.
Hope this helps. Please feel free to follow up here if this doesn't resolve your issue.
Thanks,
Prashant

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Synthesis에 대해 자세히 알아보기

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by