bugGNU Octave - Bugs: bug #41504, New function: sprintfc

 
 

bug #41504: New function: sprintfc

Submitted by:  None
Submitted on:  Fri 07 Feb 2014 04:46:01 PM UTC
 
Category:  Octave Function Severity:  1 - Wish
Priority:  5 - Normal Item Group:  Feature Request
Status:  Wont Fix Assigned to:  None
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * dev
Operating System:  * Any
* Mandatory Fields

Add a New Comment (Rich Markup)
   

Comment Type & Canned Response:
       

 

( Jump to the original submission )

Wed 01 Dec 2021 07:52:05 PM UTC, comment #9: 

no objection in a year, closing as won't fix.

Nicholas Jankowski <nrjank>
Project Member
Fri 18 Dec 2020 10:11:50 PM UTC, comment #8: 

bug for compose added as bug #59725

Nicholas Jankowski <nrjank>
Project Member
Fri 18 Dec 2020 10:06:51 PM UTC, comment #7: 

1 - the original patch applies fine, but the tests fail. in Matlab 202b , the first two tests produces errors, and the last numerical test has a third input that seems to no longer match Matlab usage. (it should be logical, not an array?)
2 - according to the Undocumented Matlab page, as of v2016b there is now a `compose` function that performs all of the functions of the undocumented sprintfc function (which is still around) and is documented at:
https://www.mathworks.com/help/matlab/ref/compose.html
(and is currently on Octave's missing function list)

I've updated the copyright docstring to current octave format, changed the failing test so it at least passed, even if several of them should produce errors to be matlab compatible, and attached it here as an m-file. it may be compatible enough for anyone that needs it to allow a matlab script to run. 

recommend closing as a 'won't fix' and opening a "missing function - compose" wishlist bug instead.

(file #50517)

Nicholas Jankowski <nrjank>
Project Member
Thu 20 Mar 2014 09:27:24 AM UTC, comment #6: 

I have submitted a new changeset, that addresses the problem you have pointed out, substituting the loopy structure with a reshape. As suggested by nfk, I have also changed the tests, that now use assert ().

(file #30954)

Massimiliano Fasi <mfasi>
Wed 19 Mar 2014 09:07:10 PM UTC, comment #5: 

This implementation with for loops is bound to be very slow. If implemented in m-code, this should at least be done with cellfun, I believe. Did you time a cellfun version? Did you also attempt to write a version in C++?

I suppose having a slow implementation may be better than having no implementation at all. Or it might not be.

Jordi GutiƩrrez Hermoso <jordigh>
Project Administrator
Wed 05 Mar 2014 06:07:35 PM UTC, comment #4: 

Submitted a patch that should fix the bug.

(file #30782)

Massimiliano Fasi <mfasi>
Sun 09 Feb 2014 02:23:54 AM UTC, comment #3: 

A good compromise, if anyone cared to offer it up, would be to implement it in m-code, not C.

Michael C. Grant <mcgrant>
Sat 08 Feb 2014 04:19:20 AM UTC, comment #2: 

It doesn't seem wise to try and match an undocumented internal function that Matlab could choose to change or remove at any time.  Yes, I know that they haven't changed it for 9 years according to this blog (http://undocumentedmatlab.com/blog/sprintfc-undocumented-helper-function/), but that is still no guarantee.

Rik <rik5>
Project Administrator
Fri 07 Feb 2014 05:13:55 PM UTC, comment #1: 

How can we implement it if there's no description of what it does?

Jordi GutiƩrrez Hermoso <jordigh>
Project Administrator
Fri 07 Feb 2014 04:46:01 PM UTC, original submission:  

sprintfc is an undocumented Matlab function

>> sprintfc('%d', 1:3)


ans =

    '1'    '2'    '3'

Anonymous

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #50517:  sprintfc.m added by nrjank (2KiB - text/plain - partially compatible sprintfc.m file)
file #30954:  sprintfc-2.patch added by mfasi (3KiB - text/x-diff)
file #30782:  sprintfc.patch added by mfasi (2KiB - text/x-diff)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by nrjank (Updated the item)
  • -email is unavailable- added by mtmiller (Updated the item)
  • -email is unavailable- added by mfasi (Updated the item)
  • -email is unavailable- added by mcgrant (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by jordigh (Posted a comment)
  •  

    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 project members can vote.

     

     

     

     

    Follow 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-12-01 nrjank StatusPostponed => Wont Fix
        Open/ClosedOpen => Closed
    2020-12-18 nrjank Attached File- => Added sprintfc.m, #50517
    2015-06-03 mtmiller Severity3 - Normal => 1 - Wish
        StatusNone => Postponed
        Releaseother => dev
    2014-03-20 mfasi Attached File- => Added sprintfc-2.patch, #30954
    2014-03-05 mfasi Attached File- => Added sprintfc.patch, #30782

    Back to the top


    Powered by Savane 3.9