添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
体贴的蘑菇  ·  Dynamic MANIFEST.MF ...·  2 周前    · 
打盹的斑马  ·  JavaScript Date Formats·  2 周前    · 
有腹肌的豆腐  ·  Preserving time-date ...·  2 周前    · 
豪爽的麦片  ·  Out of date ...·  19 小时前    · 
爱搭讪的生菜  ·  软路由-openwrt·  9 月前    · 
文雅的开水瓶  ·  python - What is the ...·  1 年前    · 
I have some XML files from another system and I want to be able to process the data therein. The readstruct function mostly fits the bill, but all the date/time fields get filled with "NaT" values because the input format isn't what datetime() expects and the Locale options aren't good enough. In particular, the input fomat is 'HH:mm:ss MM/dd/yyyy' which is I guess backwards from what datetime wants. The best option would be to add a "DateInputFormat" keyword to readstruct() that got passed as "InputFormat" to datetime(). Any other options?
Thanks for reporting this.
There is an undocumented " DetectTypes " parameter on readstruct . Enabling this will read all XML nodes as either string s or missing values. This might help work around the issue for you.
>> type ans.xml
<A>
<B>11:12:13 10/15/2022</B>
</A>
>> S = readstruct( "ans.xml" , DetectTypes=false)
S =
struct with fields:
B: "11:12:13 10/15/2022"
Please note that this is an undocumented parameter, and may change in a future release.

Community Treasure Hunt

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

Start Hunting!