필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Generating row combination from a set of data

조회 수: 2 (최근 30일)
hithere
hithere 2015년 1월 11일
마감: MATLAB Answer Bot 2021년 8월 20일
Lets say i have 37 filters and their transmittance in a (37 x 25) matrix
In this set of 37 filters i like to randomly pick 3 filters out everytime, no repetition. So it's like 37 choose 3, there should be a total of 7770 combinations.
Can I form a 3D matrix using a for loop for this? where it should be (3 x 25 x 7770)
Where 3 is the set of filters for each combinations 25 is the data points as per original and 7770 is the total combinations

답변 (1개)

Shoaibur Rahman
Shoaibur Rahman 2015년 1월 11일
편집: Shoaibur Rahman 2015년 1월 11일
T = rand(37,25);
fil = 1:37;
b = combntns(fil,3);
for k = 1:size(b,1)
out(:,:,k) = T(b(k,:),:);
end

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by