How to call This function

4 visualizzazioni (ultimi 30 giorni)
aadhil basha
aadhil basha il 22 Set 2013
function [ solution ] = knapsack_generate_random( problem, ~ ) %KNAPSACK_INITIALIZE_RANDOM generates a solution for the problem
solution = randi(2,1,problem.n_var)-1;
end

Risposta accettata

Walter Roberson
Walter Roberson il 22 Set 2013
Sample call:
prob = struct('n_var', 7);
trial_solution = knapsack_generate_random(prob);
  1 Commento
aadhil basha
aadhil basha il 22 Set 2013
its working :) do u mind if i ask some doubts?

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su MATLAB Coder in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by