find different combinations of splitting a vector

조회 수: 1 (최근 30일)
Elysi Cochin
Elysi Cochin 2020년 3월 23일
편집: Elysi Cochin 2020년 3월 25일
having a vector V, how can i find the different ways to split this vector v into subvectors such that the sum of each subvector does not exceed limit K
  댓글 수: 1
John D'Errico
John D'Errico 2020년 3월 23일
This question is so wildly vague as to be virtually impossible to give an intelligent answer.
What is the real vector length that your REAL problem has? Often the answer is hundreds or thousands of elements, in which case the answer is tyou don't have a large enough computer.
Are there replicate elements in the vector?
Does order matter?
Must each segment be as large as possible?
Lots of other questions that are left unresolved.

댓글을 달려면 로그인하십시오.

채택된 답변

Fangjun Jiang
Fangjun Jiang 2020년 3월 23일
편집: Fangjun Jiang 2020년 3월 23일
try
nchoosek(V,1)
nchoosek(V,2)
% ...
nchoosek(V,8)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Newton-Raphson Method에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by