Matlab reported an error when using function gpxread() that the file is not a gpx file?
8 views (last 30 days)
Show older comments
I downloaded some track file in the format of GPX and tried to create a track figure with those gpx files, but matlab reported an error when executing the function of gpxread that the file is not a gpx file. The source of the gpx files is https://www.la-flamme-rouge.eu/, the gpx file is fine to be executed on a map on the website, but failed in matlab.
The gpx file is in version 1.1, with metadata tags.
The code and error is here. Need a solution:(
The gpx file is attached in a format of txt, changing the file format directly with renaming it to .gpx is available.
Need a solution:( badly:(
route = gpxread(['tokyo-2020-men-elite-itt.gpx']);
#错误使用 gpxread__ (第 1 行)
#The file, "C:\Users\cyyyy\Downloads\gpx\tokyo-2020-men-elite-itt.gpx", is not a GPX file.
1 Comment
veromora
on 26 Oct 2022
I also had the same problem, but solved it with the new function that can read those .gpx files. Since 2020 the function gpxread no longer works as it used to and you should use readgeotable instead.
Answers (1)
Aniket
on 7 May 2025
I am able to reproduce the issue in MATLAB R2021a but not in R2020b.
The issue occurs because the GPX file does not specify a version or the namespace. Kindly add "version" to 2nd line of the file as shown below:
<gpx version="1.1" xmlns="http://www.topografix.com/GPX/1/1" ...>
Alternatively, as mentioned by @veromora, you may also use readgeotable function if it's a viable option.
Hope this resolves the issue!
0 Comments
See Also
Categories
Find more on MATLAB Report Generator 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!