Deleting a line in an XML file

6 views (last 30 days)
Cameron Best
Cameron Best on 17 Apr 2015
Hey there,
I'm fairly new to MatLab's features of reading files and whatnot, and I'm stuck on trying to get rid of a line, or maybe read a different line in an XML file. I'mm using xml2struct ( XML2Struct ) to try and get data from a file downloaded from the internet. The program is only reading the comment in the XML, and since it is a file downloaded from the internet, I cannot control the comment being there. Her's the code I have so far:
urlwrite('http://earthquake.usgs.gov/designmaps/us/inc/data-api.inc.php?latitude=40&longitude=-122&edition=ibc-2009&siteclass=3&riskcategory=0','1.xml');
test = xml2struct('1.xml')
test.output
Doing this gives me the comment in the XML file only. If I go through and manually delete the comment, the code works, but I would like a code or method to do it automatically. Any suggestions?
Thanks in advance!

Answers (0)

Community Treasure Hunt

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

Start Hunting!