how to sparse matrix
Info
Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.
Ältere Kommentare anzeigen
In the example given under Intlinprog (factory, warehouse and sales outlet-matlab documenttation), one of the command to specify the sparse matrix is given as :Aineq = spalloc(P*F + W,matwid,P*F*W + S*W); i would please try to understand how the parameters for rows, and nonzero values have been arrived i.e P*F + W and P*F*W + S*W
Antworten (1)
Massimo Zanetti
am 10 Okt. 2016
Bearbeitet: Massimo Zanetti
am 10 Okt. 2016
According to the lines before alloc() call, https://it.mathworks.com/help/optim/ug/factory-warehouse-sales-allocation-model.html
there are
F = floor(f*N2); % number of factories
W = floor(w*N2); % number of warehouses
S = floor(s*N2); % number of sales outlets
and
P = 20; % 20 products
Therefore, to set up the linear system that defines inquality constraints they first allocate sparse matrix place
Aineq = spalloc(P*F + W,matwid,P*F*W + S*W)
and later they fill in the matrix.
1 Kommentar
Sachin Kamble
am 10 Okt. 2016
Diese Frage ist geschlossen.
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!