Can I return the xml string from writestruct?

I am successfully using the "writestruct()" function to export my structure to XML but due to the application this xml is being read into afterwards I need to do a bit of tweaking to the output file contents.
Is there a way to return the generated XML string rather than have Matlab write it to file? I can fopen/fprintf my modifed xml string easily enough afterwards.

댓글 수: 2

Stephen23
Stephen23 대략 3시간 전
writestruct does not provide an option to return the generated XML as a string.
yes, I know that the writestruct function does not naturally return the xml string but was hoping to find out if there was a matlab internal function somewhere within matlab.io.xml.internal that does return the xml string.

댓글을 달려면 로그인하십시오.

답변 (1개)

Matt J
Matt J 대략 3시간 전
편집: Matt J 대략 3시간 전

0 개 추천

You can't suppress file output, but you can use readlines and writelines to retrieve the file contents in string form and then modify them.

제품

릴리스

R2025b

질문:

대략 13시간 전

편집:

대략 11시간 전

Community Treasure Hunt

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

Start Hunting!

Translated by