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

mxarray on partially initialized structs #185

Open
maartenvd opened this issue Feb 3, 2021 · 0 comments
Open

mxarray on partially initialized structs #185

maartenvd opened this issue Feb 3, 2021 · 0 comments

Comments

@maartenvd
Copy link

In one of the packages I use there is a struct that gets partially initialized. This makes it so mxarray fails because of :

mxarray.jl:488
set_field(mx, names_str[i], mxarray(getfield(d, names[i])))

getfield throws an error, as this field isn't defined. I'm not entirely sure how to go about fixing this. I guess you could add a new UNDEF struct in matlab.jl, check if isdefined(d,names[i]) and if not, do set_field(mx,names_str[i],mxarray(UNDEF)) (if this sounds ok I'll open a pull request).

Alternatively, I can define my own mxstruct conversions for those problematic types.

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

1 participant