How can one generate a matrix that the first column is larger than the second column?

1 次查看(过去 30 天)
In a previous question I have learned that, given a matrix, how to pick the rows that the first column entry is larger than the second column entry.
V=V(V(:,1)>=V(:,2),:)
Then, now, I want to generate a 1000*2 matrix where each entry is from randn and that the first column is larger than the second column.

采纳的回答

Arthur Roué
Arthur Roué 2020-8-3
m = randn(1000, 2);
m = [max(m,[],2), min(m,[],2)];

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Code Generation 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by