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

 Réponse acceptée

Walter Roberson
Walter Roberson le 22 Sep 2013

0 votes

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

1 commentaire

aadhil basha
aadhil basha le 22 Sep 2013
its working :) do u mind if i ask some doubts?

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by