bugGNU Octave - Bugs: bug #53668, Matlab rand "state"...


bug #53668: Matlab rand "state" vector is 35x1 versus Octave's 625x1

Submitted by:  None
Submitted on:  Mon 16 Apr 2018 09:33:24 AM UTC  
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Matlab Compatibility
Status: Wont FixAssigned to: None
Originator Name: Aditya ChakravartyOriginator Email: -unavailable-
Open/Closed: ClosedRelease: 4.2.2
Operating System: Microsoft Windows

Add a New Comment(Rich Markup)

You are not logged in

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


Mon 16 Apr 2018 03:23:08 PM UTC, comment #1:

It's not wrong, it is just different.

The actual details of the internal state are not important, as long as a programmer can save and restore the state of the random number generators in order to get a consistent random number stream then the function is working well enough.

Consider the example of adding 3 + 5. If you were doing this manually you would keep the numbers in base10, write them down on a piece of paper, and compute the result of 8, also in base10.

A computer, however, would first convert the number 3 to base2 "11" and the number 5 to base2 "101". It would then add to get "1000" and finally convert back to base10 result of 8. The fact that the computer has a completely different representation of the numbers than you or I is unimportant. It is only important that addition actually works correctly, as it indeed does.

Rik <rik5>
Project Administrator
Mon 16 Apr 2018 09:33:24 AM UTC, original submission:

While using the following command:

s = rand('state')

it gives an output matrix of 625 x 1, which in regular Matlab is of only 35 x 1



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

Attach File(s):

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by None (Submitted the item)

    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
    Mon 16 Apr 2018 03:23:08 PM UTCrik5CategoryNone=>Octave Function
      Item GroupIncorrect Result=>Matlab Compatibility
      StatusNone=>Wont Fix
      SummaryWrong result of command=>Matlab rand "state" vector is 35x1 versus Octave's 625x1

    Back to the top

    Powered by Savane 3.1-cleanup1