Error with Calling "dcmecef2ned" in Simulink

조회 수: 16 (최근 30일)
Richard
Richard 2025년 11월 18일
댓글: Paul 2025년 12월 3일
I am trying to run a Simulink model I initially created with Matlab 2022b on 2024b. I get the following error when I try to run the code.
"Function 'dcmecef2ned' not supported for code generation."
It use to work, but now it does not on 2024b. Is there a fix for this?

답변 (1개)

Paul
Paul 2025년 11월 19일
Hi Richard,
In which version did it used to work? I'm assuming you're calling dcmecef2ned from inside a MatlabFunction block?
Maybe the block Direction Cosine Matrix ECEF to NED would be helpful?
  댓글 수: 4
Richard
Richard 2025년 12월 3일
Paul, I was using this with Matlab 2022b with no issues.
Paul
Paul 2025년 12월 3일
Seeing same issue with code not being generated on R2024A.
If you want to use the toolbox function, then you need to declare it in the Matlab Function block using coder.extrinsic and preallocate the output. Might slow down the runtime, but you might not notice. Something like this:
function y = fcn(u)
coder.extrinsic('dcmecef2ned');
y = zeros(3,3);
y = dcmecef2ned(u(1),u(2));
end
If you want to stay with your current solution then you might consider not using the deg2rad and instead compute cang and sang wth cosd and sind respectively. Then you'll get the exact results as expected for the angles of 90,180,270 which can be nice for test cases (at a minimum).

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

카테고리

Help CenterFile Exchange에서 Aerospace Applications에 대해 자세히 알아보기

제품


릴리스

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by