Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export struct array and non-ascii strings, readable json, save to file problem #2

Open
GoogleCodeExporter opened this issue Apr 1, 2015 · 3 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Using mat2json on a struct array will only export the first element
2. Using mat2json on an array field means the second argument is the field 
value (and is therefore treated like a filename) and not blank.
3. Hard to read very large json output.
4. Strings with non-valid json characters are exported directly, rather than 
being escaped

What version of the product are you using? On what operating system?

Matlab release 13

Please provide any additional information below.

Have attached a version of mat2json which fixes or works around the above 
issues.  May want to consider merging into code base.  In particular:

1. Handle struct arrays by creating [{},{}] (all arrays treated as 
one-dimensional)

2. Changed logic of fopen statement to require the call to be at the top of 
stack only (i.e. recursive calls do not result in trying to fopen)

3. Added some code to put in CR LF after field names and structures

4. Check directly for 'char' class and replace non-printable characters with 
space.

Original issue reported on code.google.com by [email protected] on 9 Dec 2010 at 1:37

Attachments:

@GoogleCodeExporter
Copy link
Author

Original comment by [email protected] on 7 Jan 2012 at 2:24

  • Changed state: Fixed
  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

Thank you for your code Andrew, when I run the "pub" command to test the doce 
it generates an error. Could you run that command with your version of mat2json 
and see what may be causing the problem.

cheers,

Jonas

Original comment by [email protected] on 7 Jan 2012 at 2:30

  • Changed state: Started
  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

in line 49 change 'f' to 'M'.

Original comment by [email protected] on 18 Dec 2012 at 5:18

  • Added labels: ****
  • Removed labels: ****

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant