Hi all,
I am very new to Matlab and CVX. I have only been using them for the last few months and my background is in engineering not mathematics. I am having the following problem. I am trying to minimise the following objective function:
sum(sum_square(p1(:,2:30)-p1(:,1:29)))
Based on the requirements of the following equations:
for i = 1:29
V = 900; CL(i) = (W(i).*g)/(0.5*density*(V^2)*S); CD(i) = CDo + ((CL(i).^2)/(3.14*AR*e)); T = ((CD(i)/CL(i))*(W(i)*g))/1000; %convert to KN
cp(i) = {p1(1,i), p1(2,i); p1(1,i+1), p1(2,i+1)}; disp(i) = pdist(cp(i),'euclidean')*1000; %convert to m
Wf(i) = SFC*T*(disp(i)/V); W(i+1) = W(i)-Wf(i);end
Given variables: W, g, V, S, CDo, SFC, density
When I run this I get the following error:
Error using cvx/subsasgn (line 39)
In an assignment A(:) = B, the number of elements in A and B must be the same.
Error in fueloptimal (line 79) cp(i) = {p1(1,i), p1(2,i); p1(1,i+1), p1(2,i+1)};
Can anybody help me with this problem?
Thank you in advance.
Best Answer