jsonecode doesn't support complex doubles
33 ビュー (過去 30 日間)
コメント済み: Alexander DeWitt 2022 年 2 月 22 日
After a few error messages about encoding objects of class double, I figuered out that my highlevel structs had a field that contianed complex doubles, and therefore couldn't be encoded. So, I was wondering:
Is there a particular reason that complex doubles aren't supported by jsonecode?
If the reason isn't a lack of general consenus on default encoding of complex doubles in JSON, what is the convention?
Ive J 2022 年 2 月 22 日
"JSON has no standard way to represent complex numbers, so there is no way to test for them in JSON Schema."
Here also, you'll find more:
You have two (maybe more?) options:
x.a = 1 + 2i;
y = x;
y.a = string(y.a);
その他の回答 (0 件)
Find more on JSON Format 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!