"Subscripted assignment dimension mismatch.' when running a linprog coding.
Afficher commentaires plus anciens
"Subscripted assignment dimension mismatch.' when running a linprog coding.
My code is
for M = 1 : size(PV_output,1)
for N = 1 : size(WT_output,2)
f(:,M:N ) = [((CRF*CC_PV(M)/PVenergy(M)+OM_PV)); ((CRF*CC_WT(N))/WTenergy(N))+OM_WT]; % Objective function coefficients
%A(:,:) = [-PV_output(:,:,K) -WT_output(:,:,L)];
A (:,M,N) = [-PV_output(:,M) -WT_output(:,N) ];
b(:,:) = -Demand(:);
lb = zeros(2,1);
ub = [max_PV_area/PV_area; max_WT_area/WT_area]';
end
end
[x, fval, exitflag] = linprog(f,A,b,[],[],lb,ub)
PV_output is 8760x1x27 and WT_output is 8760x1x3
I am trying to find the "f" coefficients below for all the combinations of the 27 and 3 PV and WT's in this code Does anyone know how to index the "f" to do so?
Thank you
Réponse acceptée
Plus de réponses (1)
Andrew Alkiviades
le 21 Juin 2012
4 commentaires
Andrew Alkiviades
le 21 Juin 2012
Andrew Alkiviades
le 21 Juin 2012
Sean de Wolski
le 21 Juin 2012
That was a typo, you will want:
A{ii,jj}, note the xcurly '{' which indicates conversion. The regular parenthesis assumes it is a cell already and that is why you see the error.
Andrew Alkiviades
le 21 Juin 2012
Catégories
En savoir plus sur Solver Outputs and Iterative Display dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!