Hi all,
I am very new to Matlab and I am trying to define a variable V to be any number >=700 within the following for loop:
for i = 1:29 disp(i) = norm([p1(1,i+1),p1(2,i+1)]-[p1(1,i),p1(2,i)])*1000; V = randn(1x29); v >= 700; 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; Wf(i) = SFC*T*(disp(i)/V); W(i+1) = W(i)-Wf(i); end
I have tried defining V to be a random (1×29) matrix but I get the following error:
In an assignment A(I) = B, the number of elements in B and I must be the same.
Error in trial (line 38)
CL(i) = (W(i).*g)./(0.5*density*(V.^2)*S);
Can anybody please help?
Best Answer