Error using datcomimport. Problem with arrays sizes.

4 views (last 30 days)
Hello,
I'm trying to import a datcom .out file into my Matlab workspace. The results are generated by means of Datcom+ version (by Holycow). The file is the 1976 version, so it is perfectly compatible. After the computation, I launch the command datcom_data = datcomimport("fastuav_drone.out", true, 0, 6) and I obtain the following error:
Now, the only arrays with nine elements are those of the elevator and the ailerons. So, I tried to delete them (keeping only body + wing + h tail + v tail) and the import actually works. I tried also a problem for a Cessna 172 found online, from which I copied the structure, and it works. Then I "forced" the Cessna code by asking for 20 alphas, 20 Machs, and 20 and altitudes (in the same range using linspace())(for a better interpolation) and it gives me the same error.
I don't really know what is the difference for "usafdatcom()" from mine and the Cessna's .out file. And then, I don't know why datcomimport does not work anymore if I increase the points (I tried also some combinations, e.g. 5 Machs/5 altitudes/15 alphas, and I got the same error).
I attach the .zip with the output files of my uav and the Cessna codes.
Help me before my PC starts to fly through the window.
Thank you so much to everyone who will answer :)

Answers (1)

S@m
S@m on 8 Aug 2025
Edited: S@m on 8 Aug 2025
Hi Antonio,
The "fastuav_drone.out" file has a floating-point data mismatch, which is causing the error when importing data with datcomimport’ function in MATLAB.
We can observe this in the ALSCHD parameter in the fastuav_drone.out file (shown in below figure), which refers to the ALPHA scheduling array in the input card section. For each entry in this array, the MATLAB parser searches for a matching entry in the ALPHA’ column (indicated in blue in the figure below) and extracts the associated 1x9 data array (highlighted in green in the figure below).
However, there is a precision mismatch due to decimal rounding off in the "fastuav_drone.out" file, because of which the MATLAB parser fails to extract data and returns 0x9 array.
I have attached the modified file ("mod_fastuav_drone.out"), where the ALSCHD entries have been made identical to the ALPHA column entries. The entries at all the ‘ALSCHD’ instances in the file have been updated. The datcomimport function is now able to successfully import the data as shown in the figure below.
For more information on ‘datcomimport’ function, refer to the documentation in the below link.

Categories

Find more on Aerospace Applications in Help Center and File Exchange

Products


Release

R2025a

Community Treasure Hunt

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

Start Hunting!