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


bug #41504: New function: sprintfc

Submitted by:  None
Submitted on:  Fri Feb 7 16:46:01 2014  
Category: Octave FunctionSeverity: 1 - Wish
Priority: 5 - NormalItem Group: Feature Request
Status: PostponedAssigned to: None
Originator Name: Originator Email: -unavailable-
Open/Closed: OpenRelease: dev
Operating System: Any

Add a New Comment (Rich MarkupRich Markup):

You are not logged in

Please log in, so followups can be emailed to you.


(Jump to the original submission Jump to the original submission)

Thu Mar 20 09:27:24 2014, 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 Mar 19 21:07:10 2014, 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 Mar 5 18:07:35 2014, comment #4:

Submitted a patch that should fix the bug.

(file #30782)

Massimiliano Fasi <mfasi>
Sun Feb 9 02:23:54 2014, 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 Feb 8 04:19:20 2014, 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 Feb 7 17:13:55 2014, comment #1:

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

Jordi GutiƩrrez Hermoso <jordigh>
Project Administrator
Fri Feb 7 16:46:01 2014, original submission:

sprintfc is an undocumented Matlab function

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

ans =

'1' '2' '3'



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

Attach File(s):

Attached Files
file #30954:  sprintfc-2.patch added by mfasi (3kB - text/x-diff)
file #30782:  sprintfc.patch added by mfasi (2kB - text/x-diff)


Depends on the following items: None found

Items that depend on this one: None found


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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed Jun 3 01:30:10 2015mtmillerSeverity3 - Normal=>1 - Wish
    Thu Mar 20 09:27:24 2014mfasiAttached File-=>Added sprintfc-2.patch, #30954
    Wed Mar 5 18:07:35 2014mfasiAttached File-=>Added sprintfc.patch, #30782

    Back to the top

    Powered by Savane 3.1-cleanup1