stiansjogren icon

rnd

stiansjogren | PRO | 05/20/16 01:03:12 PM UTC | 0 ⭐ | 7698 👁️ | Never ⏰ | []
MatLab |

190 B

|

None

|

0 👍

/

0 👎

function res = randnum()
    % Generates a number from a uniform distribution in the interval -pi:pi
    res = 2*pi*rand(1,1,'double') - pi;
    if res == pi
        res = randnum();
    end
end

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎