How to call This function
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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
le 22 Sep 2013
Sample call:
prob = struct('n_var', 7);
trial_solution = knapsack_generate_random(prob);
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur MATLAB Coder dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!