WGS84 Gravity Model C++ Code Generation Error
3 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Get Started with Aerospace Blockset についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!