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에서 Get Started with MATLAB에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by