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

Julia symbol is returned as matlab struct #160

Open
BambOoxX opened this issue Apr 23, 2021 · 2 comments
Open

Julia symbol is returned as matlab struct #160

BambOoxX opened this issue Apr 23, 2021 · 2 comments

Comments

@BambOoxX
Copy link

BambOoxX commented Apr 23, 2021

If one wants to save a symbol to a .mat file, this symbol is not stored.
See the example below

using MAT
file = matopen("test.mat","w")
write(file,"symbol",:a_symbol)
close(file)

Matlab output

>> load('test.mat')
>> symbol

symbol = 

  struct with no fields.
@JeffFessler
Copy link
Member

AFAIK, Matlab does not support symbol types. So it seems unlikely you would be able to save a symbol to a .mat file. Probably the closest option is to convert it to a string:
write(file, "symbol", string(:a_symbol))

@BambOoxX
Copy link
Author

@JeffFessler matlab surely does not support symbols.

The problem here is that this lack of support is not associated with a warning or an error. So one could assume that something should be expected but not an empty container.

My idea was

  • as you propose implicitly converting the symbol to a string, probably as an option, same goes for reading mat files, or
  • show an error if someone tries to store a symbol so that the conversion has to be performed explicitly by the user

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

No branches or pull requests

2 participants