Skip to content

mxarray on partially initialized structs #185

@maartenvd

Description

@maartenvd

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions