How to call This function
조회 수: 4 (최근 30일)
이전 댓글 표시
function [ solution ] = knapsack_generate_random( problem, ~ ) %KNAPSACK_INITIALIZE_RANDOM generates a solution for the problem
solution = randi(2,1,problem.n_var)-1;
end
채택된 답변
Walter Roberson
2013년 9월 22일
Sample call:
prob = struct('n_var', 7);
trial_solution = knapsack_generate_random(prob);
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!