필터 지우기
필터 지우기

WGS84 Gravity Model C++ Code Generation Error

조회 수: 2 (최근 30일)
samil
samil 2019년 5월 3일
I am using Matlab R2015a Simulink. I have a model with Aerospace Blockset’s WGS84 Gravity Model block, with WGS84 Close Approximation setting selected. When I generate C++ code, I get type cast errors like “error C2440: 'type cast' : cannot convert from 'real_T' to 'MonthIdx'”. The reason for the error is that the code is ok for C but not C++. Interestingly, correct C++ code is generated when I select the WGS84 Taylor Series Approximation setting in gravity block. For now, I manually modify the generated code with the following type conversion workaround , I hope it will be fixed soon:
void InitCalcAtmosProfile310(real_T ppercentReal, real_T pvarReal, real_T paltReal, real_T *altitude, real_T *temperature310, real_T *density310, real_T *minmax) {
int_T ppercent = ppercentReal;
int_T pvar = pvarReal;
int_T palt = paltReal;
....
real_T calc_Julian_date(real_T uDataMonthReal, real_T uDataDay, real_T uDataYear) {
int_T uDataMonth = uDataMonthReal;
...

답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by