Clear Filters
Clear Filters

WGS84 Gravity Model C++ Code Generation Error

2 views (last 30 days)
samil
samil on 3 May 2019
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;
...

Answers (0)

Categories

Find more on Reference Applications in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!