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

Tuples converted to MATLAB structs #178

Closed
jebej opened this issue Nov 2, 2020 · 1 comment · Fixed by #231
Closed

Tuples converted to MATLAB structs #178

jebej opened this issue Nov 2, 2020 · 1 comment · Fixed by #231

Comments

@jebej
Copy link
Contributor

jebej commented Nov 2, 2020

It seems that tuples are currently being converted to structs, which is wrong. I think it makes more sense to convert tuples to cell arrays. Thoughts?

julia> jvalue(mxarray((2.5,2.6)))
Dict{String,Any} with 1 entry:
  "2.5" => 2.6

As an aside, the reason this happens is because of a default fallback:

mxarray(d) = mxstruct(d)

Maybe this should be changed, it doesn't seem like a great choice.

@tqml
Copy link
Collaborator

tqml commented Feb 9, 2025

Good point, I updated the conversion logic.
Numeric tuple of a single type should now convert to a vector. Otherwise its converted to a cell array and converted individually.

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

Successfully merging a pull request may close this issue.

2 participants