bugGNU Octave - Bugs: bug #49077, Missing MEX function...


bug #49077: Missing MEX function mxArrayToUTF8String

Submitter:  Rik <rik5>
Submitted:  Mon 12 Sep 2016 11:29:43 PM UTC
Category:  Libraries Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Confirmed Assigned to:  None
Originator Name:  Open/Closed:  * Open
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup

Jump to the original submission

Sat 12 Aug 2017 04:09:53 PM UTC, comment #7: 

I tested the new mxSetProperty function and it works correctly.

Rik <rik5>
Group administrator
Fri 11 Aug 2017 09:30:35 PM UTC, comment #6: 

I pushed an implementation of mxSetProperty here:


This changeset also moves the real work of getting/setting properties to the octave_value classdef classes.

John W. Eaton <jwe>
Group administrator
Fri 11 Aug 2017 08:28:51 PM UTC, comment #5: 

mxGetProperty was added recently (http://hg.savannah.gnu.org/hgweb/octave/rev/bd9e719f04cc).  Re-titling bug report to list remaining two missing functions.

Rik <rik5>
Group administrator
Wed 14 Sep 2016 12:10:30 AM UTC, comment #4: 

I've been reviewing and improving the MEX interface for the 4.2 release, and it's in a lot better position now.  I filed this bug report mostly as a placeholder because I found these functions missing during the work I was doing.  Given that the 4.2 release is imminent, I don't think we need to include a temporary solution.  These functions can be part of 4.4 release with plenty of time to get it done right.

Rik <rik5>
Group administrator
Tue 13 Sep 2016 04:22:14 PM UTC, comment #3: 

I actually don't need it and wrote it following Rik's bug report. I understand it is probably not the right approach and there is a lower level implementation using Octave API directly.

Guillaume <gyom>
Tue 13 Sep 2016 03:38:08 PM UTC, comment #2: 

If that does what you want, then I suppose it might be OK as a temporary solution but I don't think it's the right thing to att to core Octave.

John W. Eaton <jwe>
Group administrator
Tue 13 Sep 2016 02:54:13 PM UTC, comment #1: 

What about something like this for mxGetProperty?

mxArray *mxGetProperty(const mxArray *pa, mwIndex index, const char *propname) {
    mxArray *mx = NULL, *mc = NULL, *me = NULL, *md = NULL;
    mxArray *mo[1], *m[2];
    const char **fields = (const char *[]){"type", "subs"};

    mx = mxCreateStructMatrix(1, 2, 2, fields);
    mxSetFieldByNumber(mx, 0, 0, mxCreateString("()"));
    mc = mxCreateCellMatrix(1,1);
    mxSetFieldByNumber(mx, 0, 1, mc);
    mxSetFieldByNumber(mx, 1, 0, mxCreateString("."));
    mxSetFieldByNumber(mx, 1, 1, mxCreateString(propname));

    m[0] = (mxArray *)pa;
    m[1] = mx;
    me = mexCallMATLABWithTrap(1, mo, 2, m, "subsref");
    if (me == NULL) {
        md = mxDuplicateArray((const mxArray*)mo[0]);
    return md;

Guillaume <gyom>
Mon 12 Sep 2016 11:29:43 PM UTC, original submission:  

The following three functions are missing from Octave's MEX language interface:


Whether it is important, I can't say.  But to be complete it should have these functions.

Rik <rik5>
Group administrator


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

   bug dependencies.


Carbon-Copy List
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by gyom (Posted a comment)
  • -email is unavailable- added by rik5 (Submitted the item)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.


    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-08-11 jwe SummaryMissing MEX functions mxSetProperty, mxArrayToUTF8String Missing MEX function mxArrayToUTF8String
    2017-08-11 rik5 SummaryMissing MEX functions mxGetProperty, mxSetProperty, mxArrayToUTF8String Missing MEX functions mxSetProperty, mxArrayToUTF8String
    2017-08-11 rik5 Dependencies- bugs #51733 is dependent

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code