Closed SDADEEC closed 2 years ago
Hello Jianeng,
I can't reproduce your issue, unfortunatly. Are you using the newest release, 1.5.1? What Matlab version and what operating system are you using?
Hi Martin,
Thanks for replying.
I'm using the newest release (1.5.1). Matlab version is R2021a (9.10.0.1602886) and OS is Ubuntu 20.04
I have an idea what the problem might be, but it will take me some time to fix it.
As a workaround, you could remove line 145 opts.setDefaultFlowStyle(styleFields(styleIndex).get([]));
of dump.m
. which will remove the error but also disable the flow style feature.
Hi Martin,
Thank you very much. After removing that line, the error is solved.
@SDADEEC Since I cant reproduce the bug on my machine, could you please quickly try out the new version v1.5.2 and see if
yaml.dump([1, 2, 3], "block")
executes without problem?
Hi Martin,
Sure, I followed your recent commit to modify the code (seems v1.5.2 is not available in the Matlab Add-on) and the result after executing your provided code is:
>> yaml.dump([1, 2, 3], "block")
ans =
"- 1.0
- 2.0
- 3.0
"
where 'ans' is 1*1 string
For v1.5.1, after removing opts.setDefaultFlowStyle(styleFields(styleIndex).get([]));
, the result I get is:
>> yaml.dump([1, 2, 3], "block")
ans =
"[1.0, 2.0, 3.0]
"
Hi Jianeng,
I forgot that it takes an hour or so until the release is available in Matlab file exchange. But from your feedback it seems like everything is working correctly now. Thanks for reporting the bug and have a nice day.
Hi, Thank you for designing this tool.
I'm trying to write a simple struct to a yaml file using 'dumpFile' function. Here is what I write
But I get the error messages for
yaml.dumpFile("my.yaml",data_towrite);
:Could you please help me with that?