m3butler

28 Reputation

One Badge

15 years, 361 days

MaplePrimes Activity


These are answers submitted by m3butler

Both ways worked. Using the first method, like this:

$seed1=range(1,10000);
$A=maple("RandomTools[SetState](state=$seed1);LinearAlgebra[RandomMatrix](4,4,generator=-9..9)");
$seed2=range(1,10000);
$B=maple("RandomTools[SetState](state=$seed2);LinearAlgebra[RandomMatrix](4,4,generator=-9..9)");

The second method is about the same difficulty but seems a little cleaner:

$seed1=range(1,1000);
$A=maple("randomize($seed1):LinearAlgebra[RandomMatrix](4,4,generator=-9..9)");
$seed1=range(1,1000);
$B=maple("randomize($seed1):LinearAlgebra[RandomMatrix](4,4,generator=-9..9)")

@Alex Smith: If you aren't setting the seed value for this second method, what are you setting? They both look very similar.

If you just try to reinitialize seed1 the second time (instead of creating a seed2) both matrices will be the same.

Page 1 of 1