WGS84 Gravity Model C++ Code Generation Error

3 visualizzazioni (ultimi 30 giorni)
samil
samil il 3 Mag 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;
...

Risposte (0)

Categorie

Scopri di più su Reference Applications in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by