-1

我想模拟 Y^x 的 150,000 个随机值并创建它们的直方图。谁能告诉我如何在matlab上做到这一点?

4

1 回答 1

1
Y = y_lower + (y_upper-y_lower) * rand(150000,1);
x = x_lower + (x_upper-x_lower) * rand(150000,1);

U = Y .^ x;
hist(U);

Y从 5 到 8 和x从 2 到 2.5 的示例输出:

于 2012-04-11T04:16:00.333 回答