How to call This function

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
Walter Roberson 2013년 9월 22일

0 개 추천

Sample call:
prob = struct('n_var', 7);
trial_solution = knapsack_generate_random(prob);

댓글 수: 1

aadhil basha
aadhil basha 2013년 9월 22일
its working :) do u mind if i ask some doubts?

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

추가 답변 (0개)

카테고리

Community Treasure Hunt

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

Start Hunting!

Translated by