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 to plaintext #45

Open
erik-roberts opened this issue May 10, 2017 · 6 comments
Open

Export to plaintext #45

erik-roberts opened this issue May 10, 2017 · 6 comments
Assignees

Comments

@erik-roberts
Copy link
Collaborator

erik-roberts commented May 10, 2017

Allow for export to txt/csv tables, which will require unpacking of dims, in export2csv method. This is useful for using with d3js or other web frameworks. also has universal import support for other languages.

extends #40

@erik-roberts
Copy link
Collaborator Author

use csvwrite

@erik-roberts
Copy link
Collaborator Author

time series points should probably be columns to avoid unnecessary replication of the other axes.

@erik-roberts
Copy link
Collaborator Author

erik-roberts commented May 10, 2017

also, currently, unpack dims is really slow on the time dim. to speed the whole thing up, a mat array should be preallocated, and unpack dims probably shouldn't be called directly, something fast and vectorized should be called that handles all the dims at once. it would likely also use less memory in the hand offs.

@davestanley
Copy link
Owner

@erik-roberts Not sure why you need to pack / unpack. Couldn't we just do a separate file for each matrix in obj.cell?

@davestanley
Copy link
Owner

So if I understand correctly, you want to

  1. Unpack all the dims in obj.data, so that time and cells (normally rows and cols of a matrix) will become 2 new axes in obj
  2. Convert this to a 2D table using exportDataTable
  3. Save this to a CVS?

This approach should work for MDD objects, but I would definitely advise against using it on the time dimension, since any cell array of that dimensionality is going to be uber slow.

@erik-roberts
Copy link
Collaborator Author

erik-roberts commented May 11, 2017

The full unpacking is needed for importing to other languages, especially web interfaces like d3js. Time should be columns, not rows, to avoid excess memory size.

An alternative following your idea would be to put the contents of each cell in files if they are matrices, and instead put the filename in the text output.

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

2 participants