Output value doesn't change for different inputs to muPad procedure

I am using MATLAB procedures to generate a 1024 bit number randomly. I am using this code for it.
z:=26;num:=1;
while z>0 do
num:=num*random();
z:=z-1;
end_while;
Thus, 'num' will be random()^26.
I call this procedure in my MATLAB code. Since 'num' is a random number it should change every time i call the procedure. But it doesn't. I get only one value for 'num' always.
Where am I going wrong? And how can i correct it?
Thank you for your time and help.

Answers (0)

This question is closed.

Asked:

on 16 Jan 2015

Closed:

on 20 Aug 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!