Error with Calling "dcmecef2ned" in Simulink

조회 수: 9 (최근 30일)
Richard
Richard 2025년 11월 18일 16:33
댓글: Paul 2025년 11월 19일 22:59
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 대략 9시간 전
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?
  댓글 수: 2
Richard
Richard 대략 7시간 전
편집: Richard 대략 7시간 전
Paul, I am using Matlab 2024b. The dcmecef2ned function is in the Aerospace Toolbox. The function is embedded in a user-defined Matlab function block that I am calling within my Simulink model, thus I can't use the block Direction Cosine Matrix ECEF to NED.
I ended up coping the function, renaming it to "my_dcmecef2ned.m" and deleting the error checking at the beginning of the script. I modified the following function call in the script as follows:
Was:
angles = convang( [lat(:) lon(:)] ,'deg','rad');
Is:
angles = deg2rad([lat lon]);
This worked. I am not sure why I can't use the default function in Matlab.
Paul
Paul 대략 4시간 전
The cited doc page does not include an "Extended Capabilities" section indicating that the function is eligible for Code Generation. So I'm not surprised that it doesn't work inside the MatlabFunction block. I'm more surprised that it did work in a previous version, hence my question regarding which version that was.

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

카테고리

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